[BUG] Native memory leak - 4,700 MB/hour growth rate on Windows startup

Resolved 💬 3 comments Opened Mar 10, 2026 by dhruvchandhok Closed Apr 8, 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?

Body:
## Environment

  • OS: Windows 11 Home 10.0.26200
  • Node.js: v24.3.0
  • Claude Code: v2.1.71
  • Shell: bash (Git Bash)

## Symptom
"High memory usage (3.1 GB)" warning appears shortly after starting Claude Code on a fresh session.

## Diagnostics (/heapdump output)

  • heapUsed: ~207 MB
  • RSS: ~592 MB
  • Peak RSS: ~1.29 GB
  • Memory growth rate: 4,700 MB/hour (78 MB/min)
  • arrayBuffers: ~69 MB
  • external (native): ~170 MB

## Analysis from diagnostics.json
Identified potential leaks:

  1. "Native memory > heap — leak may be in native addons (node-pty, sharp, etc.)"
  2. "High memory growth rate: 4700.1 MB/hour"

## Notes

  • Leak appears to be in native C++ addons, not V8 heap
  • node-pty (terminal emulator) is the primary suspect given bash tool usage
  • Removing unrelated global npm packages (openclaw) had no effect
  • Restarting Claude Code temporarily clears memory but leak resumes immediately

8b1e3ca2-1e66-4069-8269-45d7fb6e2ff2-diagnostics.json

What Should Happen?

na

Error Messages/Logs

Steps to Reproduce

na

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

 2.1.72

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

_No response_

View original on GitHub ↗

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