[BUG] KillShell and Bash Commands Cause Claude Code to Crash/Terminate

Resolved 💬 3 comments Opened Nov 1, 2025 by SHAY5555-gif Closed Nov 5, 2025

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

  1. Start Claude Code and begin an autonomous agent task
  2. 2. Have the agent start a background server process (e.g., a development server)
  3. 3. Instruct or allow the agent to kill the server using KillShell tool or Bash commands
  4. 4. Observe that Claude Code itself terminates/crashes instead of just killing the background process
  5. 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_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗