claude-code - 💡(How to fix) Fix Claude.app leaks claude-code subprocesses; ~150+ accumulate over 12 hours [3 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#55088Fetched 2026-05-01 05:46:33
View on GitHub
Comments
3
Participants
3
Timeline
9
Reactions
0
Author
Timeline (top)
labeled ×4commented ×3closed ×1cross-referenced ×1

Fix Action

Workaround

  • Quit Claude.app fully (Cmd-Q) and relaunch. Process tree dies. Counter resets.
  • This costs the user all in-flight session context.
RAW_BUFFERClick to expand / collapse

Environment

  • Claude Desktop 2.1.121
  • macOS Darwin 25.2.0 ARM64

Steps to reproduce

  1. Open 2 or 3 Claude Code sessions in Claude.app and leave them running for 8+ hours.
  2. From a terminal: `ps -ef | grep claude | wc -l`

Expected

~6-12 claude processes (parent + child for each open session, plus a few MCP server helpers).

Actual

175+ claude processes. They accumulate at a rate of one new pair every ~5 minutes, parented by Claude.app itself (not by any session). Old processes are not killed when new ones spawn. Each consumes 2-4% CPU. Cumulative load can drive the system to 80%+ CPU.

Diagnostics

  • `ps -eo pid,ppid,etime,command` shows pairs of claude processes spaced at exactly 5-minute intervals across the full uptime of Claude.app.
  • All leaked children are parented by the Claude.app PID (`application.com.anthropic.claudefordesktop`), not by any user-opened session.
  • The 3 active session PIDs (matched by `--resume <session-id>` in argv) are clean. Everything else is orphan.
  • No user code or scheduled task in our project invokes the claude binary. Verified by grep.

Workaround

  • Quit Claude.app fully (Cmd-Q) and relaunch. Process tree dies. Counter resets.
  • This costs the user all in-flight session context.

Impact

  • System CPU pegs at 80%+ over time. Laptop fans spin up. Battery drains.
  • User must Cmd-Q + restart on a multi-hour cadence to keep the machine usable.
  • Other agents in the same Claude.app instance experience slow tool execution due to CPU starvation.

Request

  1. Identify the spawn source inside Claude.app (likely a session keepalive or health check on a 5-minute cadence).
  2. Either kill the prior process before spawning the next, or stop spawning entirely if existing children are healthy.

extent analysis

TL;DR

The issue can be temporarily mitigated by quitting and relaunching Claude.app, but a permanent fix requires identifying and modifying the source of the 5-minute cadence process spawning inside Claude.app.

Guidance

  • Investigate the Claude.app codebase for any session keepalive or health check mechanisms that may be causing the 5-minute process spawning cadence.
  • Use the ps -eo pid,ppid,etime,command command to monitor the process tree and identify any patterns or clues that may lead to the spawn source.
  • Consider implementing a mechanism to kill prior processes before spawning new ones, or to stop spawning entirely if existing children are healthy, as suggested in the issue request.
  • Review the --resume <session-id> argument and its relation to the spawning of new processes to ensure it's not contributing to the issue.

Example

No code snippet is provided as the issue lacks specific code references, but the investigation should focus on the session management and health check components of Claude.app.

Notes

The provided workaround of quitting and relaunching Claude.app resets the process tree but comes at the cost of losing in-flight session context. A more permanent solution requires identifying and addressing the root cause of the process spawning issue.

Recommendation

Apply a workaround by modifying the session keepalive or health check mechanism to prevent excessive process spawning, as the issue is likely caused by an internal mechanism within Claude.app rather than an external factor.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING