Code tab (cowork) OOM-crashes: /stats loads all ~/.claude/projects transcripts unbounded; ~/git-as-file makes project scanner walk all of $HOME
Desktop app version: 1.9659.4
Env: macOS 26.5.1 (Darwin 25.5.0, arm64), 24 GB RAM
Chat works fine; the Code tab hard-crashes the entire app with a main-process V8 OOM. Two distinct, reproducible resilience bugs:
1. /stats loads every transcript into the heap with no size cap
On opening the Code tab, the log shows [CCD] /stats scanning N/N transcript files since <date>, then ~8 s later:
<--- Last few GCs --->
Mark-Compact (reduce) 3548.9 -> 3548.9 MB ... last resort; GC in old space requested
ERROR:electron/shell/common/node_bindings.cc:185] OOM error in V8:
CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
Setting --js-flags="--max-old-space-size=8192" made no difference (still died at ~3,549 MB), so it's a runaway allocation, not a tunable cap. Root cause: one ~/.claude/projects subfolder contained multi-GB .jsonl files (a misbehaving plugin), and /stats reads them all into memory at once.
Ask: stream transcripts / cap per-file size / skip oversized files so one large transcript can't OOM the app.
2. Project scanner walks all of $HOME when ~/git is a regular file
Repeated startup error:
[detectedProjects] could not read ~/git: ENOTDIR: not a directory, scandir '~/git'
A stray 0-byte ~/git file (vs. directory) made the scanner error on its intended root and fall back to walking the entire home directory, which on a machine full of dev projects (node_modules, venv, caches) also OOM'd at startup.
Ask: handle ENOTDIR on the projects root gracefully; don't fall back to an unbounded $HOME walk.
Repro
Put a large file tree / multi-GB .jsonl under ~/.claude/projects/, or make ~/git a regular file, then open the Code tab.
Workarounds that fixed it for me
- Moved the oversized transcripts out of
~/.claude/projects/(340 MB of real transcripts → no OOM, peak RSS 668 MB). rm ~/git && mkdir ~/git.
---
Related (the upstream trigger — a plugin writing multi-GB transcripts): https://github.com/thedotmack/claude-mem/issues/2754*
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗