Desktop app OOM crash on large .jsonl transcripts — /stats scanner has no per-file size limit

Resolved 💬 3 comments Opened Apr 18, 2026 by kdoerfer-cloud Closed Jun 20, 2026

What happened

Claude Code desktop app crashes at startup with a V8 heap-out-of-memory abort when any .jsonl transcript in ~/.claude/projects/** grows past ~1 GB. Root cause: the /stats scanner reads every transcript synchronously into V8's ~4 GB heap with no per-file size limit.

Long-running sessions accumulate context across every close-out and the .jsonl grows indefinitely. A governance session on my machine reached 1,418,037,042 bytes (1.42 GB) before crashing; a parallel session reached 947,151,855 bytes (947 MB). Together they exhausted the heap before the sidebar could render.

Log signatures

  • [CCD] /stats scanning N/M transcript files since <date> immediately before crash
  • OOM error in V8: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
  • zsh: trace trap on the launching shell
  • No DiagnosticReport.app entry — the crash is silent to anyone not watching the launching terminal

Secondary observation (likely amplifier)

On the IndexedDB retry path after the initial failure I saw:

MaxListenersExceededWarning: Possible EventEmitter memory leak detected.
11 change listeners added to [RAr]
11 change listeners added to [Cookies]

Event listeners appear to leak on the retry path. This accelerates heap climb beyond what the scan alone would produce.

Recovery (required manual intervention)

  1. Move oversized .jsonl files out of ~/.claude/projects/ (I quarantined to ~/claude-oversized-transcripts.bak/). The files themselves are preserved but can no longer be opened in the app — reopening would re-trigger the OOM.
  2. Wipe IndexedDB to clear corrupted sidebar state.
  3. Restart.

Requested fixes

  1. /stats scanner: stream files, skip files above a size threshold, or alert on oversized transcripts — don't OOM the whole app.
  2. Listener leak on the IndexedDB retry path.
  3. Surface OOM crashes with a DiagnosticReport entry so users know what happened rather than facing an app that silently won't open.

Environment

  • Claude Desktop: 1.3109.0
  • Claude Agent SDK: 0.2.111
  • OS: macOS (Darwin 25.2.0)

Happy to provide the full OOM trace or additional details if useful. Long-running governance sessions are the most exposed — context accumulates across close-outs and the .jsonl grows indefinitely with no built-in rollover mechanism.

View original on GitHub ↗

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