claude-code - 💡(How to fix) Fix [BUG] Claude Code corrupts terminal state — new shells hang, affects other apps (macOS) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#47129Fetched 2026-04-13 05:40:42
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×5commented ×1

Error Message

Error Messages/Logs

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Description

After running Claude Code CLI sessions, all new terminal windows hang on launch — the
shell never reaches a prompt. The Terminal.app title bar shows bash · -zsh (unusual) and the cursor sits indefinitely with no output beyond "Last login." This also appears to be affecting other applications — Claude.ai desktop app will not open.

The only fix is a full machine restart. The issue started today (2026-04-12) and is
reproducible — it happens again after running Claude Code.

Environment

  • OS: macOS (Darwin 25.3.0)
  • Shell: zsh
  • Terminal: Terminal.app
  • Claude Code version: Current (as of 2026-04-12)
  • Model: claude-opus-4-6 (1M context)

Steps to reproduce

  1. Run a Claude Code CLI session with multiple tool calls (bash commands, file
    reads/writes)
  2. Open a new Terminal.app window while or after the session is running
  3. New terminal hangs — prompt never appears

Expected behavior

New terminal windows should open normally with a working zsh prompt, regardless of Claude Code session state.

Actual behavior

  • New terminal windows hang at cursor, no prompt
  • Title bar shows bash · -zsh instead of normal shell indicator
  • Claude.ai desktop app also fails to open
  • Persists until full machine restart
  • Shell config files (.zshrc, .zprofile) are unmodified — confirmed clean

Screenshots

(attach your two screenshots here)

Notes

Shell config is minimal and unmodified — this is not a dotfile issue. Claude Code CLI
appears to be leaving orphaned processes or corrupting shared system state that blocks shell initialization and impacts other Electron-based apps.

<img width="583" height="386" alt="Image" src="https://github.com/user-attachments/assets/0165118a-37e6-4cc3-9651-3bef4e8a7548" />

What Should Happen?

Claude Code sessions should not affect system state outside their own process. New terminal windows should always open normally, and other applications
(including Claude.ai desktop) should remain functional regardless of whether Claude Code is running or has recently run.

<img width="583" height="386" alt="Image" src="https://github.com/user-attachments/assets/8cfde809-a5a3-45b8-abd8-9cf3347eeae7" />

Error Messages/Logs

Steps to Reproduce

  1. Run a Claude Code CLI session with multiple tool calls (bash commands, file
    reads/writes)
  2. Open a new Terminal.app window while or after the session is running
  3. New terminal hangs — prompt never appears

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

Current (as of 2026-04-12)

Claude Code Version

claude-opus-4-6

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

Shell config is minimal and unmodified — this is not a dotfile issue. Claude Code CLI
appears to be leaving orphaned processes or corrupting shared system state that blocks shell initialization and impacts other Electron-based apps.

extent analysis

TL;DR

The issue is likely caused by Claude Code CLI leaving orphaned processes or corrupting shared system state, and a potential workaround is to investigate and clean up any leftover processes after a Claude Code session.

Guidance

  • Investigate the system state and processes after a Claude Code session to identify any potential orphaned processes or corrupted state that may be causing the issue.
  • Use tools like ps or Activity Monitor to check for any lingering processes related to Claude Code.
  • Consider adding a cleanup step after a Claude Code session to remove any temporary files or processes that may be causing the issue.
  • Test whether the issue persists when running Claude Code with a single tool call or minimal file operations to isolate the cause.

Example

No code snippet is provided as the issue seems to be related to system state and process management rather than a specific code error.

Notes

The issue appears to be a regression, and the fact that it worked in a previous version suggests that there may be a version-specific bug or change that is causing the issue. The minimal and unmodified shell config suggests that the issue is not related to dotfile configuration.

Recommendation

Apply a workaround to clean up after Claude Code sessions, as the root cause of the issue is not immediately clear and may require further investigation. This workaround may involve manually removing temporary files or processes, or modifying the Claude Code session to include a cleanup step.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] Claude Code corrupts terminal state — new shells hang, affects other apps (macOS) [1 comments, 2 participants]