[Bug] Subagent processes not terminating on macOS — memory leak persists on v2.1.114

Resolved 💬 4 comments Opened Apr 18, 2026 by iOllivier Closed Apr 21, 2026

Bug Description

Subagent processes spawned by Claude Code fail to terminate after completion, causing memory to accumulate until the system becomes unresponsive. This was previously reported in #22554 (closed as duplicate) but is still occurring on v2.1.114.

Environment

  • Platform: macOS Darwin 24.6.0
  • Hardware: MacBook Pro M2, 16GB RAM
  • Claude Code Version: 2.1.114
  • Terminal: Warp + Claude Code CLI

What Happens

Every time Claude Code spawns subagents (Agent tool calls), the child processes matching claude.*stream-json.*disallowedTools remain running after the task completes. They accumulate over a session — Activity Monitor shows dozens of claude processes all owned by the user, each consuming ~140MB RAM.

The processes can be confirmed with:

ps aux | grep '[c]laude.*stream-json.*disallowedTools' | grep -v 's000'

In a typical session with moderate subagent use, 20-40+ orphaned processes accumulate. Memory pressure eventually causes slowdowns requiring manual intervention.

Activity Monitor Evidence

(Screenshot attached — showing dozens of claude processes accumulating during a session)

Workaround Currently Required

I have had to implement a manual kill script and a UserPromptSubmit hook to clean up on every message:

ps aux | grep '[c]laude.*stream-json.*disallowedTools' | grep -v 's000' | awk '{print }' | xargs kill 2>/dev/null

Expected Behaviour

Subagent processes should terminate automatically when their task completes.

References

  • Original report: #22554 (closed as duplicate, but root issue clearly unresolved)
  • Reported fixed in v2.1.107 — regression confirmed on v2.1.114

<img width="1116" height="902" alt="Image" src="https://github.com/user-attachments/assets/88afd85c-9520-452f-bf8a-230e4af2b1e0" />

View original on GitHub ↗

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