[BUG] CLI silently exits when stopping a background dev server process (Windows)
Resolved 💬 3 comments Opened Mar 15, 2026 by min-hinthar Closed Mar 18, 2026
Bug Description
When stopping a background process (e.g., a dev server started via run_in_background) by using TaskStop or killing the process, the Claude Code CLI silently exits with no error message. The session terminates abruptly and the user is dropped back to their shell.
Steps to Reproduce
- Start a dev server as a background task (e.g.,
pnpm devwithrun_in_background: true) - Do other work in the conversation
- Attempt to stop or kill the background dev server process
- CLI exits silently — no error, no crash log, session just ends
Expected Behavior
The background process should be stopped cleanly without affecting the active CLI session. The conversation should continue normally.
Actual Behavior
The CLI exits silently (appears to be exit code 0). No error message is displayed. The user loses their conversation context.
Environment
- Claude Code version: 2.1.76
- OS: Windows 10 (MINGW64/Git Bash)
- Shell: bash (MSYS2/Git Bash)
- Node.js: LTS
Additional Context
- This has happened multiple times across different sessions
- The background process is a Next.js dev server (
pnpm dev) - Possibly related to SIGCHLD handling when a child process terminates
- Similar to #27236 but specifically triggered by stopping background tasks, not rate limits
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗