OOM crash on large git repository since v2.1.83+ (was stable on v2.1.81)
Description
Claude Code consistently crashes with "JavaScript heap out of memory" when working in a large git repository (~100GB+ Android platform source tree with millions of files).
This did NOT happen on v2.1.81. Started occurring after upgrading to newer versions (tested on v2.1.89).
The crash happens during basic operations like git log — no heavy file reads or searches involved.
Environment
- OS: Linux x86_64 (Ubuntu 22.04)
- RAM: 94GB
- Claude Code version: 2.1.89 (crashes), 2.1.81 (worked fine)
- Repository: Large Android platform source tree (~100GB+, millions of files)
Error
<--- Last few GCs --->
Mark-Compact 4136.9 (4276.2) -> 4098.1 (4136.0) MB, 588.50 / 0.23 ms
(average mu = 0.884, current mu ...)
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
Heap reaches ~4GB before crashing. This happens repeatedly — not a one-off.
Workaround
Setting export NODE_OPTIONS="--max-old-space-size=16384" avoids the crash, but this was not needed on v2.1.81.
Expected behavior
Should not OOM on a machine with 94GB RAM for basic git operations, especially when v2.1.81 handled the same repository without issues. The default heap limit should be sufficient, or Claude Code should manage memory more efficiently in large repos.
Suspected cause
Between v2.1.81 and v2.1.89, several changes increased baseline memory usage:
- v2.1.83: Non-streaming response token cap increased from 21k to 64k
- v2.1.84: Additional tools and hooks added to baseline
- v2.1.85: yoga-layout replaced with pure TypeScript implementation
- v2.1.89: Alt-screen rendering with virtualized scrollback buffers more content
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗