Preflight Checklist
What's Wrong?
Multiple idle Claude Code sessions accumulated ~15GB memory each over an 18-hour period without any user interaction. 4 sessions combined used ~60GB, exceeding my 24GB RAM and triggering macOS jetsam (OOM killer), causing a complete system crash.
Key finding: Debug logs show context size remained constant at 6664 chars throughout the 18 hours, yet each process grew to ~15GB. This suggests the leak is NOT from context accumulation but from something else (V8 heap fragmentation, MCP connections, internal caching, etc.).
From jetsam report:
- "largestProcess" : "2.1.7" (Claude Code)
- 4 processes with rpages 950,000-980,000 (~15GB each)
- Combined CPU time suggests processes were actively doing something despite being idle
What Should Happen?
Idle Claude Code sessions should:
- Maintain a low memory footprint (<500MB when idle)
- Release unused memory through garbage collection
- Not grow unboundedly without active user interaction
Error Messages/Logs
From /Library/Logs/DiagnosticReports/JetsamEvent-2026-01-15-182249.ips:
"largestProcess" : "2.1.7"
Process memory details (name: "2.1.7"):
PID 10652: rpages=977,907 (~15GB), cpuTime=1805.89s
PID 11129: rpages=950,678 (~14.5GB), cpuTime=3364.34s
PID 11605: rpages=981,949 (~15GB), cpuTime=391.86s
PID 75191: rpages=976,069 (~15GB), cpuTime=1604.92s
(macOS page size = 16KB, so 977,907 pages × 16KB ≈ 15GB)
From ~/.claude/debug/ logs - context stayed constant:
2026-01-15T00:30:45.055Z [DEBUG] Auto tool search disabled: 6664 chars
...
2026-01-16T02:14:31.824Z [DEBUG] Auto tool search disabled: 6664 chars
Steps to Reproduce
- Run
claude in terminal
- Use the session normally (file reads, bash commands, etc.)
- Stop interacting but keep the session open (don't
/exit)
- Monitor memory usage in Activity Monitor over time
- Memory grows continuously even when idle
My specific case:
- 4 sessions open for ~18 hours
- Each grew to ~15GB despite being idle
- Context size stayed constant at 6664 chars (verified in debug logs)
The core issue: idle sessions accumulate memory without releasing it, regardless of context size.
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
No response
Claude Code Version
2.1.7 (at time of crash), now on 2.1.12
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
Environment:
- macOS 15.7 (24G207)
- Apple M2, 24GB RAM
- iTerm2 with zsh
Session timeline:
- Sessions started: 2026-01-15T00:01 UTC
- Crash time: 2026-01-15T18:22 PST
- Total runtime: ~18 hours
- User idle time before crash: ~2 hours
MCP configuration:
- claude-in-chrome MCP server was connected to some sessions
Available for debugging:
- Full jetsam report at /Library/Logs/DiagnosticReports/JetsamEvent-2026-01-15-182249.ips
- Debug logs in ~/.claude/debug/ from affected sessions
- Willing to provide additional logs or test fixes
Preflight Checklist
What's Wrong?
Multiple idle Claude Code sessions accumulated ~15GB memory each over an 18-hour period without any user interaction. 4 sessions combined used ~60GB, exceeding my 24GB RAM and triggering macOS jetsam (OOM killer), causing a complete system crash.
Key finding: Debug logs show context size remained constant at 6664 chars throughout the 18 hours, yet each process grew to ~15GB. This suggests the leak is NOT from context accumulation but from something else (V8 heap fragmentation, MCP connections, internal caching, etc.).
From jetsam report:
What Should Happen?
Idle Claude Code sessions should:
Error Messages/Logs
Steps to Reproduce
claudein terminal/exit)My specific case:
The core issue: idle sessions accumulate memory without releasing it, regardless of context size.
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
No response
Claude Code Version
2.1.7 (at time of crash), now on 2.1.12
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
Environment:
Session timeline:
MCP configuration:
Available for debugging: