Subagents don't clean up their Node processes
Resolved 💬 3 comments Opened Nov 12, 2025 by slagter Closed Nov 16, 2025
Problem
Subagents spawn Node.exe processes that don't terminate when the agent completes. This causes:
- Process accumulation (60+ zombie Node processes after moderate usage)
- Memory exhaustion (individual processes grow to 295MB+)
- System slowdown and Cursor becoming unresponsive
- Eventually forces system kill of all Node processes
Current Behavior
- Each subagent invocation spawns a new Node.exe process
- When the subagent completes and returns results, the Node process remains active
- After multiple agent uses, Node processes accumulate
- No automatic cleanup mechanism exists
- Processes only terminate when explicitly killed (taskkill)
Expected Behavior
When a subagent completes its task and returns results to the main conversation, its associated Node process should be properly terminated and resources cleaned up.
Steps to Reproduce
- Open Cursor with Claude Code extension
- Use the Task tool with subagents (general-purpose, Explore, Plan) multiple times
- Wait for each agent to complete
- Open Task Manager or run: tasklist | findstr node
- Observe that Node processes continue to accumulate
System Information
- Platform: Windows 11
- Claude Code version: Latest
- Node processes count after moderate usage: 60+
- Memory per heavy process: 197MB-295MB
- Total memory consumed: 500MB+
Impact
This is a critical bug that makes Claude Code unusable for extended work sessions on resource-constrained systems. The documentation doesn't mention any cleanup mechanisms or known workarounds.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗