[BUG] Severe native memory leak (~738 GB/h) — CLI fully unresponsive (slash commands frozen) on macOS

Resolved 💬 4 comments Opened May 12, 2026 by cap-flow Closed Jun 12, 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?

I have been using Claude Code daily for about a month without issues.
Starting yesterday, it freezes mid-task in a very specific pattern:

  • I send a prompt. Claude shows the "thinking" timer and starts

consuming tokens.

  • The elapsed-time counter advances, but NO actual work happens —

no tool calls, no edits, no output.

  • I stop / pause and re-send the same prompt. Same result: tokens

consumed, timer runs, nothing executed.

  • This repeats 3–4 times; on the 4th–5th attempt it sometimes

starts working.

When I run /heapdump during a freeze, it reports:
RSS 0.32 GB (peak 0.32 GB), JS heap 0.04 GB, ~0.24 GB unaccounted
native memory.
⚠ Native memory > heap — leak may be in native addons
(node-pty, sharp, etc.)
⚠ High memory growth rate: 765,120 MB/hour

So the native (off-heap) portion is ~6× the JS heap and growing at
~765 GB/h according to Claude's own diagnostic. Slash commands like
/bug, /doctor, /clear are also frozen during the incident.

I'm on the Max plan; this is making the product unusable.

What Should Happen?

A prompt should start producing tool calls / output normally,
without a freeze where tokens are spent but no work happens.
Memory should not grow at hundreds of GB per hour.

Error Messages/Logs

/heapdump output during freeze:

RSS                     0.32 GB (peak 0.32 GB)
JS heap                 0.04 GB   in snapshot
array buffers           0.01 GB   not in snapshot
other external          0.03 GB   not in snapshot
unaccounted             0.24 GB   not in snapshot (code/JIT/stacks/allocator)

⚠ Native memory > heap — leak may be in native addons (node-pty, sharp, etc.)
⚠ High memory growth rate: 765,120.0 MB/hour

Steps to Reproduce

  1. Open my working project (folder on macOS Desktop) in Claude Code.

The project has multiple MCP servers configured (Claude Preview,
Claude in Chrome, Postgres, Sentry, GitHub, Context7,
scheduled-tasks, pdf-viewer, mcp-registry, etc.).

  1. Send any prompt — e.g. ask to edit a file.
  2. The "Claude is thinking" timer starts; tokens are consumed; no

tool calls or output are produced.

  1. Pause and re-send the same prompt — same behavior.
  2. After 3–4 retries it MAY start working; often it does not.

Things I have already tried (none fixed it):

  • Archived all sessions, fully uninstalled and reinstalled Claude

Code, re-imported sessions.

  • Reconnected Wi-Fi (suspected packet loss — no change).
  • Cleared cache.
  • Disconnected MCP servers.

I have NOT yet tested in a completely empty/clean project directory.
Will update the issue after testing.

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

Claude.app 1.6608.2 (desktop app; CLI not installed)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

Plan: Max.

Attached diagnostic bundle: cc-bug-report.tar.gz (95 KB)

  • user-report.md : original first-person account of the

incident and the full /heapdump output

  • logs/Library-Logs-Claude : main.log, mcp.log, etc.
  • logs/dot-claude-telemetry: 1p_failed_events.* (may indicate

connectivity / event-delivery issues)

  • config/*.redacted : MCP and settings configs (secrets

masked)

  • system/* : versions, OS, processes, artifact sizes

Heapdump file (~31 MB) is NOT in the public bundle because raw heap
snapshots can contain in-memory tokens. Happy to share privately with
maintainers — please advise the right channel (support@anthropic.com
referencing this issue?).

Possible angles, just from the /heapdump warning:

  • native-addon leak (node-pty / sharp / similar)
  • very large MCP-server fan-out in this project

Will follow up after testing in an empty directory to isolate
project-specific triggers.

222.tar.gz

View original on GitHub ↗

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