[BUG]
Environment
- Platform (select one):
- [ ] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [x] Other: Local dev
- Claude CLI version: C
- Operating System: macOS 15
- Terminal: iTerm2
Bug Description
If Claude code has made a tool call and it is waiting on the result, and I hit escape, Claude crashes with a 1000+-deep stacktrace that looks like this:
Error: spawn EBADF
at ChildProcess.spawn (node:internal/child_process:421:11)
at spawn (node:child_process:753:9)
at file:///opt/bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:138:160626
at ck1 (file:///opt/bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:138:161121)
at file:///opt/bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:138:161354
at Array.forEach (
This doesn't happen on Anthropic API calls, only local tool calls.
Steps to Reproduce
- Start claude
- Ask it to run something on the local machine that takes a little bit ("sleep 10")
- Hit escape while it is running
Expected Behavior
It says "User canceled call (call still occurring in background)" or something like that
Actual Behavior
It appears to return, but within a couple seconds it gives the spawn error (with a couple times briefly showing the input box) and then exits.
Additional Context
I think I am using node for claude alone, but but might be using bun.