CLI exits to command prompt unexpectedly during active work
Resolved 💬 3 comments Opened Apr 13, 2026 by Alex-R-A Closed May 25, 2026
Description
Claude Code CLI exits to the command prompt unexpectedly during active work sessions. This happened twice within a 2-hour window. Both times the session was actively working (not idle), and the exit was not triggered by the user.
Steps to reproduce
Unable to reliably reproduce. Both occurrences happened during an active browser automation testing session using Chrome DevTools MCP tools, but the specific trigger is unclear.
Observed behavior
- The CLI shows "Working ..." with a spinner, then drops to the shell prompt
- The session ends cleanly (shows "Resume this session with: claude --resume <id>")
- No error message is displayed before the exit
- The exit happens mid-task, not at a natural stopping point
Context from the second occurrence
- Was running browser automation (mcp__chrome-devtools__ tools) in an active test session
- Had just killed dev server processes via
kill $(lsof -t -i :5173 -i :3000 -i :443) - The "Working" spinner ran for ~2m 19s before the CLI exited
- Context usage was at 16% (166,497 tokens of 1M), so this was not a context limit issue
- Model: Opus 4.6 (1M context)
- Permission mode: bypass permissions on
Screenshot
The terminal showed:
* Working ... (2m 19s . down-arrow 956 tokens)
| Tip: Use /btw to ask a quick side question without interrupting Claude's current work
~/code/condo/condoQR [main] | 16% context | Opus 4.6 (1M), High
timing: 28% | weekly: 6%
resets: 3am (-0:09) | resets: Sun 19, 6pm
>> bypass permissions on (shift+tab to cycle) 166497 tokens
Resume this session with:
claude --resume 0e2a2fdc-6492-448c-9064-bb3fe274ed8e
Expected behavior
The CLI should not exit during active work unless the user requests it, a fatal error occurs (which should be reported), or a context/rate limit is hit.
Environment
- macOS (Darwin 25.3.0)
- Claude Code CLI (latest as of 2026-04-13)
- Shell: zsh
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗