Memory leak: ~930 MB/min growth in v2.1.101
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?
Bug Report: Memory Leak in Claude Code 2.1.101
Summary
Claude Code process memory grows by ~930 MB per minute during active use, making the
tool unusable within minutes on a typical machine.
Environment
| Field | Value |
|---|---|
| Claude Code version | 2.1.101 |
| OS | Ubuntu 22.04.5 LTS |
| Kernel | Linux 6.8.0-107-generic x86_64 |
| Node.js | v20.19.4 |
| npm | 10.8.2 |
Steps to Reproduce
- Start Claude Code (
claude) - Begin a normal interactive session
- Monitor memory usage with
ps auxor the attached script
Observed Behavior
Memory climbs monotonically from ~3.2 GB to ~4.1 GB in 60 seconds (~15.5 MB/sec).
The leak is isolated to the claude process — Node.js helper processes remain flat at ~2 MB.
At this rate, 8 GB of RAM would be exhausted in under 10 minutes of active use.
Raw Data
Collected with the following one-liner (samples every second for 60 seconds):
for i in $(seq 1 60); do
TS=$(date +%H:%M:%S)
CLAUDE_MB=$(ps aux | awk '/claude/ && !/grep/ && !/monitor/ {sum += $6} END {printf "%.1f", sum/1024}')
NODE_MB=$(ps aux | awk '/node/ && !/grep/ && !/monitor/ {sum += $6} END {printf "%.1f", sum/1024}')
echo "$TS,claude=${CLAUDE_MB}MB,node=${NODE_MB}MB"
sleep 1
done
timestamp,claude_mb,node_mb
08:09:03,3214.2,2.0
08:09:04,3262.5,2.0
08:09:05,3647.6,2.0
08:09:06,3383.1,2.0
08:09:07,3398.7,2.0
08:09:08,3414.1,2.0
08:09:09,3442.6,2.0
08:09:10,3432.5,2.0
08:09:12,3456.6,2.0
08:09:13,3451.6,2.0
08:09:14,3354.1,2.0
08:09:15,3375.5,2.0
08:09:16,3398.8,2.0
08:09:17,3419.4,2.0
08:09:18,3437.6,2.0
08:09:19,3448.0,2.0
08:09:20,3459.8,2.0
08:09:21,3469.3,2.0
08:09:22,3489.7,2.0
08:09:23,3405.7,2.0
08:09:24,3359.0,2.0
08:09:25,3392.1,2.0
08:09:26,3411.7,2.0
08:09:27,3433.6,2.0
08:09:28,3462.4,2.0
08:09:29,3484.1,2.0
08:09:30,3488.4,2.0
08:09:31,3507.7,2.0
08:09:32,3523.9,2.0
08:09:33,3551.1,2.0
08:09:34,3567.9,2.0
08:09:35,3489.0,2.0
08:09:36,3521.0,2.0
08:09:37,3550.4,2.0
08:09:38,3578.6,2.0
08:09:39,3608.1,2.0
08:09:40,3630.7,2.0
08:09:42,3665.5,2.0
08:09:43,3696.0,2.0
08:09:44,3720.5,2.0
08:09:45,3672.7,2.0
08:09:46,3690.9,2.0
08:09:47,3720.9,2.0
08:09:48,3745.6,2.0
08:09:49,3776.2,2.0
08:09:50,3800.6,2.0
08:09:51,3807.7,2.0
08:09:52,3837.3,2.0
08:09:53,3854.8,2.0
08:09:54,3876.8,2.0
08:09:55,3895.4,2.0
08:09:56,3910.9,2.0
08:09:57,3925.6,2.0
08:09:58,3950.2,2.0
08:09:59,3977.5,2.0
08:10:00,4002.7,2.0
08:10:01,4044.8,2.0
08:10:02,4072.3,2.0
08:10:03,4104.1,2.0
08:10:04,4144.3,2.0
Statistics
| Metric | Value |
|---|---|
| Start memory | 3,214 MB |
| End memory | 4,144 MB |
| Net growth | +930 MB in 60 seconds |
| Growth rate | ~15.5 MB/sec |
| Node.js memory | 2.0 MB (flat — not leaking) |
Expected Behavior
Memory should remain roughly stable during a session, or grow only modestly
as conversation context accumulates.
What Should Happen?
There shouldn't be any such memory leak. On a 16GB RAM system one can run claude code for no more than 10 minutes.
Error Messages/Logs
Steps to Reproduce
- Open claude code using "claude" in the terminal.
- Use
ps aux --sort=-%mem | grep -E 'claude|node' | awk '{printf "%s MB %s\n", $6/1024, $11}'to see how the memory usage by claude keeps increasing, even when claude is not prompted at all.
Claude Model
Not sure / Multiple models
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.99
Claude Code Version
2.1.101
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Xterm
Additional Information
_No response_
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗