[Bug] v2.1.17: Session hangs - tool execution completes but never returns to prompt, or complete freeze requiring terminal kill
Bug Description
Since upgrading to v2.1.17, I'm experiencing two related but distinct hanging behaviors that have made Claude Code nearly unusable:
Issue 1: Tool execution completes but never returns to prompt
Claude performs an action, the output is fully rendered, but the spinner keeps spinning indefinitely. Claude never recognizes it's "done" and doesn't return control to the user.
Behavior:
- Claude executes a tool (Bash command, web search, file read, etc.)
- Output is fully displayed on screen
- Spinner continues animating as if Claude is still "thinking" or "working"
- User cannot enter new input because Claude appears "busy"
- New input is not queued - it's simply ignored
- Pressing ESC after waiting makes Claude responsive again
- Claude then accepts new input normally
Observed with:
- Shell commands (
pnpm build, etc.) - command completes, output shown, spinner continues - Web searches - results and links fully printed, spinner continues
- Likely affects all tool types
Key observation: Claude has finished its work (output is visible), but it doesn't recognize that the tool execution completed. It's stuck waiting for something that already happened.
Impact: User waits indefinitely for something that's already finished. Must manually press ESC to "unstick" Claude. Workflow is severely disrupted.
Issue 2: Complete terminal hang / freeze
The Claude Code session becomes completely unresponsive. No keyboard input is accepted.
Behavior:
- Spinner keeps animating (sometimes)
- ESC key has no effect
- Cannot type new commands
- No error messages
- Only recovery is to kill the terminal process entirely
- All conversation context is lost
Impact: Complete loss of work context. Must start fresh session.
Environment
- Claude Code version: 2.1.17
- Node.js version: v22.22.0
- pnpm version: 9.15.0
- OS: macOS 15.6.1 (Sequoia)
- Architecture: Apple Silicon (arm64)
- Terminal: Zed 0.218.7
Frequency
Both issues occur multiple times per day since upgrading to 2.1.17. Issue 1 is more frequent (5-10x/day). Issue 2 happens 1-3x/day. This is a significant regression from previous versions.
Steps to Reproduce
Issue 1:
- Start a Claude Code session
- Ask Claude to perform any tool-based action:
- Run a shell command (
pnpm build) - Do a web search
- Read multiple files
- Wait for output to fully render
- Observe: spinner continues indefinitely even though output is complete
- Try to type - input is ignored (Claude is "busy")
- Press ESC
- Claude becomes responsive and accepts new input
Issue 2:
- Use Claude Code normally for 15-30+ minutes
- At some point during tool execution, the session freezes completely
- No keyboard input works, including ESC
- Must force-kill terminal
Expected Behavior
- After tool output is rendered, Claude should immediately return to the prompt
- Session should remain responsive at all times
- If something goes wrong, there should be an error message and graceful recovery
Additional Context
- This appears related to issues #13240, #13224, and #15550
- The regression coincides specifically with upgrading to 2.1.17
- Previous versions (pre-2.1.x) did not exhibit this behavior at this frequency
- Issue 1 feels like a race condition or missed event: the tool completion signal isn't being processed
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗