[BUG] Memory leak - Claude Code 2.1.2 grows to 6-7GB RAM in short conversations

Resolved 💬 4 comments Opened Jan 11, 2026 by imurodl Closed Feb 23, 2026

Preflight Checklist

  • [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?

Environment

  • Claude Code version: 2.1.2
  • OS: Arch Linux (kernel 6.18.3)
  • RAM: 8GB
  • Node.js: (run node --version to get this)

## Description
Claude Code consumes 6-7GB RAM within minutes of normal conversation, leading to OOM kills. This did not happen in previous versions.

## Observed behavior

  • Memory grows continuously during conversation
  • Reaches 6-7GB within 2-3 minutes
  • Gets killed by OOM killer
  • --max-old-space-size=2048 does not help (process still grows to 4-5GB, suggesting native memory leak)

What Should Happen?

Memory should stay under 2-3GB for normal conversations.

Error Messages/Logs

OOM killer output:
  oom-kill: task=claude, pid=2552, total-vm:74858512kB, anon-rss:6702608kB

Steps to Reproduce

## Steps to reproduce

  1. Start Claude Code normally: claude
  2. Have a short conversation (5-10 messages)
  3. Monitor memory: watch -n 1 'ps aux --sort=-%mem | head -3'
  4. Observe RSS growing from ~1GB to 6-7GB rapidly

## Workaround
Using systemd-run --user --scope -p MemoryMax=3G claude to hard-cap memory, but this causes frequent kills.

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.2 (Claude Code)

Platform

Anthropic API

Operating System

Arch Linux

Terminal/Shell

Ghostty

View original on GitHub ↗

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