[BUG] Idle VSCode sessions leave native-binary/claude child spinning at 100% CPU for days
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?
Six separate claude CLI processes (the extension's resources/native-binary/claude,
launched with --output-format stream-json --input-format stream-json ... --debug
--debug-to-stderr) were each pinned at ~100% CPU — one full core apiece — with no
active user interaction. They had been in this state for a long time: elapsed run
time ranged from ~22 hours up to 8 days.
Crucially, these were NOT orphaned. The parent VSCode extension-host (Plugin Helper)
processes were all still alive, and the sessions were idle. So a live, idle session
left its CLI child in a persistent busy-loop. All six were extension build 2.1.165;
sessions from newer builds on the same machine were unaffected.
They responded to SIGTERM cleanly (no SIGKILL needed), so the process was reachable
but was not idling or exiting on its own.
What Should Happen?
An idle session should sit near 0% CPU. It should never spin a CPU core indefinitely.
Error Messages/Logs
No crash/error output available. These sessions ran with --debug over a repository
containing sensitive data, so stderr may include private content and was not captured.
Process-level evidence (sanitized), sorted by elapsed time:
PID %CPU ELAPSED notes
90346 99.4 8-02:17:09 idle session, parent alive, build 2.1.165
5059 100.0 4-02:40:17 "
88082 98.3 2-02:09:23 "
88004 98.1 2-02:09:32 "
93524 99.9 2-00:54:55 "
5249 99.5 1-22:16:32 "
Steps to Reproduce
Not deterministically reproducible. Observed pattern:
- Open multiple VSCode windows, each with a Claude Code session (extension 2.1.165).
- Leave the sessions open and idle for an extended period (hours to days).
- Some sessions enter a persistent ~100% CPU busy-loop that never subsides, even
though the window/extension host is still alive and the session is idle.
ps -Ao pid,pcpu,etime,command | grep native-binary/claudeshows the affected
processes pinned at ~100% CPU with large elapsed times.
Appears specific to, or far more frequent in, build 2.1.165. Happy to capture asample <pid> / spindump <pid> of a repro from a non-sensitive session if that
would help locate the hot loop.
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.165
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
VS Code integrated terminal
Additional Information
Note on "latest version": the affected sessions were long-lived build 2.1.165, kept
alive by VSCode's extension host from when those windows were first opened. The latest
build installed on this machine is 2.1.204, and sessions from newer builds were not
affected — so this may already be fixed, but the severity (a single idle session
spinning a full core for up to 8 days) seemed worth reporting regardless.
I did not attach debug logs or transcripts because those sessions ran with --debug
over a repository containing sensitive data. I can provide a sanitized CPU sample /
spindump from a fresh, non-sensitive repro on request.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗