Memory leak: RSS grows ~1GB/min in 2.1.54+ (regression from 2.1.52)

Resolved 💬 3 comments Opened Feb 25, 2026 by ohrvall Closed Feb 25, 2026

Description

Claude Code process RSS grows rapidly (~1 GB/min) during normal light usage, eventually crashing with OOM. This is a regression — 2.1.52 was stable, the leak appeared in the 2.1.54–2.1.58 range.

Reproduction

  1. Launch claude in a git repository (TypeScript monorepo, ~moderate size)
  2. Have a short conversation (a few tool calls)
  3. Monitor RSS: watch -n 5 'ps -o pid,rss -p $(pgrep -f claude) --no-headers'
  4. RSS grows continuously, reaching multi-GB within minutes

Observed behavior

  • 2.1.56: RSS went from ~1.9 GB → 5.1 GB in approximately 5 minutes of light conversation (~5 tool calls)
  • 2.1.58: Same behavior, still growing fast
  • 2.1.52: Stable, no leak observed (worked fine the day before)
  • Session was fresh/short — not a long conversation or large context issue
  • /proc/<pid>/smaps_rollup showed almost all memory is Private_Dirty anonymous (V8 heap), not file-backed:
Rss:             2079664 kB
Pss_Anon:        2028884 kB
Pss_File:          49130 kB
Private_Dirty:   2028884 kB
  • Top anonymous rw-p regions were heavily fragmented (475 MB, 287 MB, 155 MB, 131 MB, etc.)
  • 3114 memory mappings total

Environment

  • OS: Linux 5.15.167.4-microsoft-standard-WSL2 (x86_64)
  • Node: v22.22.0
  • npm: 10.9.4
  • RAM: 15 GB, 4 GB swap
  • Affected versions: 2.1.54, 2.1.55, 2.1.56, 2.1.58
  • Last working version: 2.1.52 (2026-02-24)

Workaround

Downgrade to 2.1.52:

npm install -g @anthropic-ai/claude-code@2.1.52

View original on GitHub ↗

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