claude-code - 💡(How to fix) Fix claude agents: daemon and bg-spare processes spin at ~100% CPU when idle

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

After running claude agents, the daemon and background worker processes spin at ~100% CPU per process even when there are no active tasks. The processes never exit on their own.

Root Cause

Root Cause (suspected)

Fix Action

Workaround

pkill -f 'claude agents'
pkill -f 'claude\.exe.*(daemon|bg-)'

Code Example

claude agents          PID 1203  ~100% CPU
├── daemon run         PID 1212  ~100% CPU
│   ├── bg-pty-host    PID 1226  ~100% CPU
│   └── bg-pty-host    PID 1229  ~100% CPU
└── bg-spare           PID 1267  ~100% CPU

---

pkill -f 'claude agents'
pkill -f 'claude\.exe.*(daemon|bg-)'
RAW_BUFFERClick to expand / collapse

Description

After running claude agents, the daemon and background worker processes spin at ~100% CPU per process even when there are no active tasks. The processes never exit on their own.

Steps to Reproduce

  1. Run claude agents in a terminal
  2. Let it sit idle (no tasks running)
  3. Open Activity Monitor (macOS) or top

Observed Behavior

Multiple claude.exe processes each consuming ~99–100% CPU:

claude agents          PID 1203  ~100% CPU
├── daemon run         PID 1212  ~100% CPU
│   ├── bg-pty-host    PID 1226  ~100% CPU
│   └── bg-pty-host    PID 1229  ~100% CPU
└── bg-spare           PID 1267  ~100% CPU

Total CPU usage: ~500% (5 cores pegged) while completely idle.

Expected Behavior

Idle processes should block on socket I/O and consume ~0% CPU.

Root Cause (suspected)

The Node.js child processes appear to be busy-waiting on Unix sockets instead of using blocking I/O or an event loop sleep. This looks like a missing await or an unintentional tight polling loop in the PTY host / spare process code.

Workaround

pkill -f 'claude agents'
pkill -f 'claude\.exe.*(daemon|bg-)'

Environment

  • Claude Code version: 2.1.153
  • OS: macOS 15 (Darwin 24.6.0)
  • Node.js: v22.22.3

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING