[BUG] Claude Code terminates itself when asked to kill Node.js processes

Resolved 💬 7 comments Opened Oct 20, 2025 by louisbgl Closed Jan 10, 2026

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 asking Claude Code to kill all Node processes, it executes a command like ``taskkill //F //IM node.exe`` which terminates both the target development processes AND the Claude Code CLI itself, since the CLI runs on Node.js. This results in unexpected termination and complete loss of conversation context.

What Should Happen?

Claude should detect self-terminating commands and either:

  1. Refuse and suggest alternatives
  2. Warn and ask for confirmation
  3. Automatically exclude its own PID
  4. Target specific dev processes by name

Error Messages/Logs

Steps to Reproduce

  1. Start Claude Code CLI (``claude``)
  2. Start a Node-based development server (e.g., ``npm run dev``)
  3. Ask Claude: "kill all node processes for me"
  4. Claude executes ``taskkill //F //IM node.exe`` (Windows) or similar command
  5. The Claude Code CLI immediately terminates

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.0.22 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Other

Additional Information

Shell: Git Bash / MINGW64

First time it happened:
<img width="986" height="285" alt="Image" src="https://github.com/user-attachments/assets/8951e844-2d44-4011-a320-b517ea574227" />

When reproducing it:

<img width="983" height="484" alt="Image" src="https://github.com/user-attachments/assets/463ff223-c170-4413-a010-563e658e3788" />

View original on GitHub ↗

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