-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Open
Labels
area:corearea:toolsbugSomething isn't workingSomething isn't workinghas reproHas detailed reproduction stepsHas detailed reproduction stepsperf:memoryplatform:windowsIssue specifically occurs on WindowsIssue specifically occurs on WindowsstaleIssue is inactiveIssue is inactive
Description
Preflight Checklist
- I have searched existing issues and this hasn't been reported yet
- This is a single bug report (please file separate reports for different bugs)
- I am using the latest version of Claude Code
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
claudeprocesses (10+) remain after apparent task completion - Large
nodeprocess (~300MB+) persists - likely stuck subagent /exitdoesn't terminate these processes- Accumulated processes crash Windows
Expected behavior
/exitshould 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
/exitto 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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area:corearea:toolsbugSomething isn't workingSomething isn't workinghas reproHas detailed reproduction stepsHas detailed reproduction stepsperf:memoryplatform:windowsIssue specifically occurs on WindowsIssue specifically occurs on WindowsstaleIssue is inactiveIssue is inactive