High CPU usage and memory leak in long-running sessions

Resolved 💬 5 comments Opened Feb 4, 2026 by primshnick Closed Mar 14, 2026

Description

Claude Code processes accumulate excessive CPU and memory over ~30 minutes of use, causing significant slowdown. Killing and resuming the session (same conversation context) immediately restores normal performance, which rules out context window size as the cause.

Environment

  • Claude Code version: 2.1.29 / 2.1.30
  • OS: macOS (Darwin 24.6.0, Apple Silicon)
  • Model: opus

Observed behavior

  • After ~30 minutes, the CLI becomes noticeably slow
  • Process stats on a degraded session:
  • 414 minutes of CPU time on a mostly-idle session left running overnight
  • 823 MB RSS memory (vs ~360 MB on a fresh session)
  • 25-72% CPU while idle (should be near 0%)
  • A fresh session with the same resumed conversation runs normally

Steps to reproduce

  1. Start a claude session with --claude-in-chrome-mcp enabled
  2. Use it normally for ~30 minutes (file reads, edits, bash commands)
  3. Observe increasing response latency and high CPU/memory via ps aux
  4. Kill the process and claude --resume — performance is normal again with the same context

Notes

  • No custom hooks or file watchers configured
  • The --claude-in-chrome-mcp child process persists alongside the main process and may be a contributing factor, but this has not been isolated
  • The pattern (gradual degradation, fixed by restart) suggests a memory leak or accumulating event listeners/timers in the Node.js process

View original on GitHub ↗

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