[BUG] Critical Memory Leak in 2.1.8+: 8-12GB RAM vs 324MB in 2.1.7 (macOS)

Resolved 💬 7 comments Opened Jan 27, 2026 by svennhv Closed Mar 8, 2026

Preflight Checklist

SUMMARY (updated): Memory leak introduced in 2.1.8. Last working version is 2.1.7 (324 MB). Versions 2.1.8-2.1.20 consume 8-12GB on ~110K file projects.

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Claude Code versions 2.1.8 through 2.1.20 exhibit severe memory leaks when indexing projects, consuming 8-12GB of RAM compared to 324MB in version 2.1.7 on the same project.

AFFECTED VERSIONS:
❌ 2.1.8 - 2.1.20 - 8-12GB + crashes with "trace trap"
✅ 2.1.7 - 324 MB (working)
✅ 2.0.36 - 245 MB (working)

This represents a 30-50x increase in memory usage compared to the last working version.

What Should Happen?

Memory usage should be similar to version 2.1.7: approximately 300-400MB for initial indexing and normal operation on projects with ~100K files.

Error Messages/Logs

Version 2.1.8+ crashes with:
[1]    23995 trace trap  claude

Versions 2.1.19 and 2.1.20 get stuck on:
"Propagating... (Esc to interrupt · thinking)"

Activity Monitor shows:
Process Name: claude-2.1.20-darwin-arm64
Memory: 12.34 GB
CPU: 100% (multiple threads)
Status: Not responding

Steps to Reproduce

  1. Install Claude Code 2.1.8 or newer:

curl -fsSL https://claude.ai/install.sh | bash -s 2.1.8

  1. Navigate to a project directory with ~100K+ files
  2. Run claude
  3. Monitor memory usage in Activity Monitor (macOS)
  4. Process consumes 8-12GB RAM and crashes with "trace trap"

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.7

Claude Code Version

2.1.20

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

ENVIRONMENT:

  • macOS: 15.7.3 Sequoia (24G419)
  • Machine: Apple Silicon (M-series)
  • Installation: Tested both Homebrew cask and native installer
  • RAM: 16GB physical

PROJECT DETAILS:

  • Type: Elixir/Phoenix backend + Nuxt 3/Vue 3 frontend
  • File count: ~110,000 files after cleanup (originally 539,000 with git worktrees)

RELATED ISSUES:

  • #20777: Memory leak on Linux 2.1.15 (20GB+)
  • #20245: 2.1.17 system freeze (70GB virtual memory)
  • #8968, #11315, #4953: Similar memory leak reports

IMPACT:
This is a critical bug that makes Claude Code 2.1.8+ unusable on projects with more than ~50K files. The memory leak was introduced in version 2.1.8.

View original on GitHub ↗

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