[BUG]
Environment
- Platform (select one):
- Anthropic API
- AWS Bedrock
- Google Vertex AI
- Other:
- Claude CLI version: 1.0.11 (Claude Code)
- Operating System: Linux 6.12.20-amd64 (Debian-based)
- Terminal: zsh
Bug Description
Claude Code consistently crashes with "JavaScript heap out of memory" error even when working on small projects (424KB total size). The error occurs despite
Node being launched with 4GB heap size (--max-old-space-size=4096).
Steps to Reproduce
- Open any project with Claude Code
- Start working on files (editing, reading, basic operations)
- Within minutes, Claude crashes with heap memory error
- Issue persists across different projects (OMNI, CHATAPP, small 424KB project)
- Problem continues even after complete Node.js reinstall
Expected Behavior
Claude Code should handle small projects without memory issues. A 424KB project with 32 files should use minimal memory.
Actual Behavior
Claude crashes with:
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
Despite being launched with 4GB heap allocation and system having 7.7GB total RAM with 3.6GB available.
Additional Context
- System uptime: 8 days
- Node version: v22.16.0
- Crashes occur repeatedly since yesterday
- Complete reinstall of Node.js did not resolve issue
- Current small test project is only 424KB with 32 markdown files
- Error indicates heap usage reaching ~1970-1985 MB out of ~2087 MB limit, suggesting memory leak
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗