[BUG] KillShell and Bash Commands Cause Claude Code to Crash/Terminate
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?
When Claude Code executes KillShell or certain Bash commands to terminate background servers or processes, it causes Claude Code itself to crash or terminate unexpectedly. This interrupts autonomous agent execution and requires manually restarting Claude Code, breaking the workflow and losing conversation context.
What Should Happen?
KillShell and Bash commands should only terminate the target background processes/servers without affecting Claude Code's own process. Claude Code should remain running and responsive after executing these commands, allowing autonomous agents to continue their work uninterrupted.
Error Messages/Logs
Steps to Reproduce
- Start Claude Code and begin an autonomous agent task
- 2. Have the agent start a background server process (e.g., a development server)
- 3. Instruct or allow the agent to kill the server using KillShell tool or Bash commands
- 4. Observe that Claude Code itself terminates/crashes instead of just killing the background process
- 5. The agent stops execution and you need to manually restart Claude Code
Claude Model
Sonnet (default)
Is this a regression?
No, this never worked
Last Working Version
v2.0.31
Claude Code Version
Latest version (v2.0.31)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗