Preflight Checklist
What's Wrong?
Description
Using /exit to close Claude Code while subagent tools are still running in the background causes system crashes. The /tasks command shows no active tasks, but orphaned processes remain and accumulate.
Steps to reproduce
- Start a long conversation that spawns subagent tasks
- Wait for apparent completion (no tasks shown via
/tasks)
- Run
/exit
- System crashes/freezes
Observed behavior
- Multiple orphaned
claude processes (10+) remain after apparent task completion
- Large
node process (~300MB+) persists - likely stuck subagent
/exit doesn't terminate these processes
- Accumulated processes crash Windows
Expected behavior
/exit should terminate all spawned processes
- Subagent processes should clean up when parent task completes
Environment
- Windows 10/11
- Claude Code version: [run
claude --version]
Workaround
Manually kill processes before exiting:
Get-Process -Name "claude","node" | Stop-Process -Force
What Should Happen?
When /exit is called or a task completes, Claude Code should:
- Detect and terminate all spawned subagent processes
- Clean up any associated node processes
- Exit gracefully without leaving orphaned processes
- If processes cannot be terminated, warn the user before exiting
Error Messages/Logs
No error messages displayed - system freezes/crashes silently.
Pre-crash process state (captured via Get-Process):
- 10 orphaned `claude` processes (74MB-188MB each)
- 1 large `node` process (322MB RAM, 7.14s CPU) - likely stuck subagent
- Total: ~1.2GB RAM consumed by orphaned processes
No BSOD - Windows becomes unresponsive and requires hard reboot.
The `.claude` cache folder does not exist after crash, suggesting the issue is process accumulation rather than corrupted state files.
Steps to Reproduce
- Start Claude Code and begin a complex task that spawns subagent tools (e.g., multi-file edits, research tasks, or anything using parallel processing)
- Allow task to run to apparent completion
- Check
/tasks - shows no active tasks
- Run
/exit to close Claude Code
- System becomes unresponsive/crashes
- After hard reboot, orphaned processes can be observed if caught before crash:
Get-Process | Where-Object { $_.ProcessName -match "node|claude" }
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
N/A - not confirmed as regression
Claude Code Version
2.0.76 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
No response
Preflight Checklist
What's Wrong?
Description
Using
/exitto close Claude Code while subagent tools are still running in the background causes system crashes. The/taskscommand shows no active tasks, but orphaned processes remain and accumulate.Steps to reproduce
/tasks)/exitObserved behavior
claudeprocesses (10+) remain after apparent task completionnodeprocess (~300MB+) persists - likely stuck subagent/exitdoesn't terminate these processesExpected behavior
/exitshould terminate all spawned processesEnvironment
claude --version]Workaround
Manually kill processes before exiting:
Get-Process -Name "claude","node" | Stop-Process -ForceWhat Should Happen?
When
/exitis called or a task completes, Claude Code should:Error Messages/Logs
Steps to Reproduce
/tasks- shows no active tasks/exitto close Claude CodeGet-Process | Where-Object { $_.ProcessName -match "node|claude" }Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
N/A - not confirmed as regression
Claude Code Version
2.0.76 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
No response