claude agents: daemon and bg-spare processes spin at ~100% CPU when idle

Resolved 💬 6 comments Opened May 28, 2026 by linfeng16 Closed May 28, 2026

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

View original on GitHub ↗

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