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

  1. Each subagent invocation spawns a new Node.exe process
  2. When the subagent completes and returns results, the Node process remains active
  3. After multiple agent uses, Node processes accumulate
  4. No automatic cleanup mechanism exists
  5. 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

  1. Open Cursor with Claude Code extension
  2. Use the Task tool with subagents (general-purpose, Explore, Plan) multiple times
  3. Wait for each agent to complete
  4. Open Task Manager or run: tasklist | findstr node
  5. 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.

View original on GitHub ↗

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