/insights crashes with JavaScript heap out of memory (OOM)
Resolved 💬 4 comments Opened Feb 6, 2026 by jas-ho Closed Mar 7, 2026
Bug
/insights crashes Claude Code with FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory before any assistant response is generated.
Environment
- Claude Code v2.1.32
- macOS Sequoia (Darwin 24.6.0), Apple M3 Max, 48 GB RAM
- Node 22.13.0 (via Volta)
Reproduction
- Open Claude Code in a project
- Run
/insights - Crash — no assistant output, immediate OOM
Reproduces consistently (tested twice, same result).
Stack trace (key frames)
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
7: v8::internal::FactoryBase<v8::internal::Factory>::NewRawTwoByteString(...)
8: v8::internal::JsonParser<unsigned short>::MakeString(...)
9: v8::internal::JsonParser<unsigned short>::ParseJsonValue<false>(...)
10: v8::internal::JsonParser<unsigned short>::ParseJson(...)
28: node::fs::FileHandle::CloseReq::Resolve()
29: node::fs::FileHandle::ClosePromise()::$_0::__invoke(uv_fs_s*)
The crash is in JSON.parse() of a file read via FileHandle. The GC log shows ~4 GB heap exhausted:
Mark-Compact 4094.5 (4158.3) -> 4094.5 (4174.3) MB, pooled: 0 MB, 68.71 / 0.00 ms (average mu = 0.387, current mu = 0.282) allocation failure; scavenge might not succeed
Notes
- Crash occurs during command expansion, before the assistant gets a turn (confirmed: stop hook reports "No message found for role 'assistant' in transcript")
- Different from existing
/insightsTypeErrors (#23697, #23431, #23138) — this is a memory exhaustion issue
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗