Claude Desktop macOS accumulates orphaned Claude Code backend processes during active use
Summary
Claude Desktop on macOS spawns a new Claude Code backend process each time a Code mode conversation is started or switched, but does not terminate previous processes. These accumulate indefinitely, consuming significant RAM on memory-constrained machines.
Environment
- macOS 15 (Sequoia), Apple M3 Pro, 18 GB RAM
- Claude Desktop 1.1348.0
- Claude Code 2.1.92 (embedded in Desktop)
Reproduction
- Open Claude Desktop, enter Code mode
- Start a conversation, interact normally
- Start a new conversation (or switch away from the current one)
- Repeat 4-5 times over ~2 hours
- Run
ps aux | grep "claude-code/.*claude.app"in Terminal
Observed
After 2.5 hours and ~5 conversation switches, 6 Claude Code backend processes were running. Only 1 was actively in use. The 5 stale processes consumed ~477 MB combined (~95 MB each).
| PID | Started | RSS | State |
|-----|---------|-----|-------|
| 2664 | 2:56 PM | 79 MB | Stale |
| 2736 | 2:57 PM | 106 MB | Stale |
| 3387 | 3:23 PM | 96 MB | Stale (had --resume flag) |
| 3912 | 4:01 PM | 93 MB | Stale |
| 4142 | 4:12 PM | 103 MB | Stale |
| 5400 | 5:20 PM | 247 MB | Active |
All processes: no TTY (??), identical flags (--output-format stream-json, --permission-mode bypassPermissions), same plugin directories. Each had a corresponding disclaimer wrapper process.
Expected
When a Code mode conversation is closed or replaced, the previous backend process should be terminated.
Impact
On an 18 GB machine, an 8-hour workday could waste 2-4 GB in orphaned processes. This directly contributed to severe memory pressure (17/18 GB used, 617 MB swap) observed before a forced restart.
Related Issues
- #19201 -- Desktop macOS leaves orphaned CLI processes after quitting
- #33947 -- MCP/subagent processes not cleaned up (107 orphans, ~7.75 GB)
- #33979 -- Feature request for session manager with process lifecycle
- #1935 -- MCP servers not terminated on exit (original report, June 2025)
- #40706 -- Orphaned child process at 100% CPU for 29 hours
Note
This is specifically about processes accumulating during active Desktop use (conversation switching), not only after quitting the app. The Desktop app was still running and functional throughout.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗