[BUG] Idle Claude Code instances consume 70-97% CPU in background
Resolved 💬 3 comments Opened Mar 15, 2026 by jLucasvf Closed Apr 13, 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?
Claude Code instances that are idle (no active conversation) consume excessive CPU (70-97%) continuously over extended periods. The problem worsens over time - instances running for 14+ hours show higher
CPU usage than recently started ones. Critically, the idle background instances use far more CPU than active instances with ongoing conversations.
- Main thread continuously reading /proc/self/statm (memory stats) via pread64()
- ~350 pread64() calls per second on this single file
- ~210 sched_yield() calls per second (yielding but immediately rescheduling)
- ~1,032 futex calls per second (thread synchronization spinning)
What Should Happen?
-
Error Messages/Logs
Steps to Reproduce
- Start a Claude Code session in a zellij pane
- Have a conversation or just start the session
- Detach from the zellij session (leave it running in background)
- Wait several hours (problem appears after ~6-8 hours)
- Check CPU usage with top or ps aux
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.0.36
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Other
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗