[BUG]
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
[BUG] Interactive session exits to terminal whenever the Bash tool runs — macOS Tahoe 26.5 + Node v26.2.0 (no crash log)
What's Wrong?
On macOS Tahoe 26.5, the Claude Code interactive session exits back to the terminal the instant the Bash tool is invoked — regardless of the command. Chat works perfectly, and the Write/Edit tools work perfectly. The exit happens specifically when a shell command runs.
Important: this is NOT a crash. There are zero crash reports in ~/Library/Logs/DiagnosticReports/ (total 0). Each time, the session ends cleanly with a "Resume this session with: claude --resume ..." message. The shell command itself actually succeeds (e.g. mkdir creates the directory), but the interactive session exits immediately afterward.
Steps to Reproduce
- macOS Tahoe 26.5, Apple Terminal, Node v26.2.0
cd ~/test2 && claude- Chat normally — works fine
- Ask: "create a folder named A" (or "show today's date with bash" — anything that triggers the Bash tool)
- Approve the permission prompt (1. Yes)
- Session exits immediately to the terminal with a "Resume this session with..." message. The folder/command does succeed.
What I've Confirmed
- Chat alone: works
- Write tool (create file): works
- Edit/Update tool (modify file): works
- Bash tool (any command, e.g.
date,mkdir): session exits immediately - The Bash command DOES succeed (directory/file actually gets created)
- No crash logs in DiagnosticReports (total 0) — clean exit, not a crash
--printmode is also affected (requested Bash command does not complete)- Tested in a non-protected folder (~/test2 under home dir) — same result
- Tested with
--debug— session exits instantly on launch - Tried two Claude Code versions: 2.1.158 AND 2.1.109 — identical behavior, so NOT a version regression
- settings.json is minimal (theme only); tried disabling sandbox — no effect
- Node child_process works fine standalone:
node -e "require('child_process').execSync('date')"returns the date correctly. So Node can spawn subprocesses — the issue appears specific to how Claude Code manages the interactive PTY when running the Bash tool.
Environment
- macOS: Tahoe 26.5
- Claude Code: 2.1.158 (latest, confirmed via
claude update); also reproduced on 2.1.109 - Node.js: v26.2.0
- Terminal: Apple Terminal
- Shell: zsh (default), no tmux/screen
- Hardware: Apple Silicon (Mac)
- Plan: Claude Pro
Note: Node v26.2.0 is a very new (non-LTS) release. This may be relevant — the issue could be an interaction between Claude Code's PTY/subprocess handling and Node 26 on macOS Tahoe 26.5.
Preflight Checklist
- [x] I have searched existing issues
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code
What Should Happen?
[BUG] Interactive session exits to terminal whenever the Bash tool runs — macOS Tahoe 26.5 + Node v26.2.0 (no crash log)
What's Wrong?
On macOS Tahoe 26.5, the Claude Code interactive session exits back to the terminal the instant the Bash tool is invoked — regardless of the command. Chat works perfectly, and the Write/Edit tools work perfectly. The exit happens specifically when a shell command runs.
Important: this is NOT a crash. There are zero crash reports in ~/Library/Logs/DiagnosticReports/ (total 0). Each time, the session ends cleanly with a "Resume this session with: claude --resume ..." message. The shell command itself actually succeeds (e.g. mkdir creates the directory), but the interactive session exits immediately afterward.
Steps to Reproduce
- macOS Tahoe 26.5, Apple Terminal, Node v26.2.0
cd ~/test2 && claude- Chat normally — works fine
- Ask: "create a folder named A" (or "show today's date with bash" — anything that triggers the Bash tool)
- Approve the permission prompt (1. Yes)
- Session exits immediately to the terminal with a "Resume this session with..." message. The folder/command does succeed.
What I've Confirmed
- Chat alone: works
- Write tool (create file): works
- Edit/Update tool (modify file): works
- Bash tool (any command, e.g.
date,mkdir): session exits immediately - The Bash command DOES succeed (directory/file actually gets created)
- No crash logs in DiagnosticReports (total 0) — clean exit, not a crash
--printmode is also affected (requested Bash command does not complete)- Tested in a non-protected folder (~/test2 under home dir) — same result
- Tested with
--debug— session exits instantly on launch - Tried two Claude Code versions: 2.1.158 AND 2.1.109 — identical behavior, so NOT a version regression
- settings.json is minimal (theme only); tried disabling sandbox — no effect
- Node child_process works fine standalone:
node -e "require('child_process').execSync('date')"returns the date correctly. So Node can spawn subprocesses — the issue appears specific to how Claude Code manages the interactive PTY when running the Bash tool.
Environment
- macOS: Tahoe 26.5
- Claude Code: 2.1.158 (latest, confirmed via
claude update); also reproduced on 2.1.109 - Node.js: v26.2.0
- Terminal: Apple Terminal
- Shell: zsh (default), no tmux/screen
- Hardware: Apple Silicon (Mac)
- Plan: Claude Pro
Note: Node v26.2.0 is a very new (non-LTS) release. This may be relevant — the issue could be an interaction between Claude Code's PTY/subprocess handling and Node 26 on macOS Tahoe 26.5.
Preflight Checklist
- [x] I have searched existing issues
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code
Error Messages/Logs
Steps to Reproduce
[BUG] Interactive session exits to terminal whenever the Bash tool runs — macOS Tahoe 26.5 + Node v26.2.0 (no crash log)
What's Wrong?
On macOS Tahoe 26.5, the Claude Code interactive session exits back to the terminal the instant the Bash tool is invoked — regardless of the command. Chat works perfectly, and the Write/Edit tools work perfectly. The exit happens specifically when a shell command runs.
Important: this is NOT a crash. There are zero crash reports in ~/Library/Logs/DiagnosticReports/ (total 0). Each time, the session ends cleanly with a "Resume this session with: claude --resume ..." message. The shell command itself actually succeeds (e.g. mkdir creates the directory), but the interactive session exits immediately afterward.
Steps to Reproduce
- macOS Tahoe 26.5, Apple Terminal, Node v26.2.0
cd ~/test2 && claude- Chat normally — works fine
- Ask: "create a folder named A" (or "show today's date with bash" — anything that triggers the Bash tool)
- Approve the permission prompt (1. Yes)
- Session exits immediately to the terminal with a "Resume this session with..." message. The folder/command does succeed.
What I've Confirmed
- Chat alone: works
- Write tool (create file): works
- Edit/Update tool (modify file): works
- Bash tool (any command, e.g.
date,mkdir): session exits immediately - The Bash command DOES succeed (directory/file actually gets created)
- No crash logs in DiagnosticReports (total 0) — clean exit, not a crash
--printmode is also affected (requested Bash command does not complete)- Tested in a non-protected folder (~/test2 under home dir) — same result
- Tested with
--debug— session exits instantly on launch - Tried two Claude Code versions: 2.1.158 AND 2.1.109 — identical behavior, so NOT a version regression
- settings.json is minimal (theme only); tried disabling sandbox — no effect
- Node child_process works fine standalone:
node -e "require('child_process').execSync('date')"returns the date correctly. So Node can spawn subprocesses — the issue appears specific to how Claude Code manages the interactive PTY when running the Bash tool.
Environment
- macOS: Tahoe 26.5
- Claude Code: 2.1.158 (latest, confirmed via
claude update); also reproduced on 2.1.109 - Node.js: v26.2.0
- Terminal: Apple Terminal
- Shell: zsh (default), no tmux/screen
- Hardware: Apple Silicon (Mac)
- Plan: Claude Pro
Note: Node v26.2.0 is a very new (non-LTS) release. This may be relevant — the issue could be an interaction between Claude Code's PTY/subprocess handling and Node 26 on macOS Tahoe 26.5.
Preflight Checklist
- [x] I have searched existing issues
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code
Claude Model
Sonnet (default)
Is this a regression?
No, this never worked
Last Working Version
2.1.158
Claude Code Version
2.1.158
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗