Desktop: focusing a session with many large subagent transcripts eagerly loads all of them, main process exceeds 7 GB and the app crash-loops (1.34493.1, Windows MSIX)
Summary
Focusing a session whose subagents/ folder contains many large agent transcripts makes the Desktop app's main process load all of them at once (tail-loading 50 MB of each). With ~30 files of 55–203 MB the main process RSS climbs past 7 GB, the event loop stalls for 6–10 s, and the app exits. Re-focusing the same session after restart repeats the crash, so the app is effectively in a crash loop for as long as that session is the last-focused one. Other sessions with large main transcripts (75–85 MB) load fine; the problem is the per-session fan-out over agent logs with no size or count guard.
Environment
- Claude Desktop 1.34493.1 (MSIX / Microsoft Store install), Windows 11 Pro 10.0.26200, x64
- Bundled Claude Code 2.1.237, Node 24.18.1
- 32 GB RAM (19 GB free at the time)
Repro (as observed)
- Have a Claude Code session that ran large multi-agent workflows over time. In my case the session folder held
subagents/with 1,069agent-*.jsonlfiles (2,138 files includingsubagents/workflows/**), 3.7 GB total, 30 files over 50 MB, largest 203 MB. Main transcript for the same session: 46 MB. - Click that session in the Desktop sidebar.
- Chat renders, hangs for a few seconds, app closes. Happens every time; three consecutive occurrences today at 17:24:25, 17:26:08 and 17:28:12.
Evidence from %LOCALAPPDATA%\Claude\Logs\main.log
Each occurrence shows the same sequence (abridged; one line per agent file, ~30 lines per occurrence):
17:28:12 [warn] [CCD] agent-a994d6017796ecdcc.jsonl is 202999064 bytes; tail-loading last 50 MB
17:28:12 [warn] [CCD] agent-abd3bf36ae983c2fc.jsonl is 127415146 bytes; tail-loading last 50 MB
17:28:12 [warn] [CCD] agent-a038ba76ef6574c3f.jsonl is 97407635 bytes; tail-loading last 50 MB
... (27 more, 55–97 MB each)
17:28:15 [warn] [event-loop-stall] main process blocked for 1745ms (... rss 5050MB)
17:28:22 [info] [process-memory] trigger=stall tree_rss_sum=6272MB ... top=[electron_main:17448:5050MB ...]
17:28:23 [warn] [event-loop-stall] main process blocked for 8446ms [likely sleep: duration_heuristic] (... rss 7638MB)
17:29:16 [info] Starting app { appVersion: '1.34493.1', ... }
Earlier occurrences: 17:24:25 (rss 4586 → 7279 MB, restart 17:24:52) and 17:26:08 (rss 4590 → 7391 MB, restart 17:26:33). A similar restart cluster appears between 14:07 and 15:15 the same day, which I now believe was the same cause. Sentry event IDs logged at the restarts: 6d197b57df11400c9bb0cb6e5f4e4951, ac8cb06339684e1eba4c74a8d7a73938, e96e6c519ed146ddb2d5e26b2f468783, 68c0f505c2c94d418dea50dae7434728, 4dfc076570d04fe5af17e5943d401309.
For comparison, sessions with 57 MB, 75 MB and 85 MB main transcripts and no large agent logs log a single transcript is N bytes; tail-loading last 50 MB line and open normally.
Workaround
Moving ~/.claude/projects/<project>/<session-id>/subagents/ out of the projects tree stops the crash; the session then opens normally from its main transcript.
Suggestions
- Don't eagerly load agent transcripts when a session is focused; load a given agent's log on demand when the user expands it.
- If eager loading stays, cap the total bytes (or count) loaded per session and degrade gracefully instead of exhausting the main process.
- Consider loading transcripts in a utility process or worker rather than the Electron main process, so a heavy session can't take the whole app down.
- Since the app re-focuses the last session on startup, a crash on focus becomes a crash loop; a "failed to load last time, open without it" safeguard would help.