Symptom
Mac feels physically hot, UI lag (mouse/keyboard/Terminal stutter, WindowServer at 31% CPU). Reported by user 2026-05-14.
Root cause
Claude Code CLI --bg-spare worker leak — same pathology as documented in docs/debugging/toohot-many-bg-spare-workers.md (2026-05-12 case at loadavg 61). Current state is worse:
| Metric |
2026-05-12 case (doc) |
2026-05-14 (this report) |
| loadavg (1/5/15) |
27 / 46 / 46 |
88.76 / 69.69 / 62.94 |
| oversubscription (loadavg ÷ cores) |
3-7× |
11× |
| bg-spare / bg-pty-host pairs |
20 |
8 (× 2 = 16 procs) |
| daemon claude.exe processes |
1 |
7 (in ~/.claude/jobs/) |
pmset -g therm flag |
normal |
normal (NOT thermal wall) |
TeamBrain attribution: NOT a TeamBrain code bug. The leak is in @anthropic-ai/claude-code CLI daemon (claude.exe daemon run). However, TeamBrain's multi-worktree / multi-driver workflow (/fixed-flow-driver, /review subagent fan-out, 35+ subcommands, FIXEDFLOW parallelism) drives users toward N concurrent claude sessions → amplifies the leak.
Reproduction
# 1) Open ≥3 TeamBrain worktrees in parallel Claude Code sessions
# 2) Run any of: /fixed-flow-driver, /review, claudefast probes
# 3) Let sessions idle for 30+ min between turns
# 4) Check:
ps -axwwwo pid,ppid,pcpu,command | grep -E "bg-spare|bg-pty-host" | grep -v grep | wc -l
sysctl -n vm.loadavg
pmset -g therm # confirms scheduler-overload, not thermal
ls -la ~/.claude/jobs/ # count daemon sessions
Expected on a hot machine: loadavg > 2× cores, multiple bg-spare/bg-pty-host pairs per claude session, thermal flag normal.
Evidence captured (2026-05-14 11:30 local)
loadavg = { 88.76 69.69 62.94 } # M1 8-core → 11× oversubscription
ncpu = 8
thermal = normal (pmset -g therm: no warnings recorded)
bg-spare/bg-pty-host pairs:
daemon 26072 (origin: /Users/m1/projects/metrixMarkets)
├── 4365 ──┬── 4405 bg-spare 0.2% CPU
├── 26105 ──┬── 26111 bg-spare 0.8%
├── 26115 ──┬── 26121 bg-spare 0.6%
├── 26300 ──┬── 26308 bg-spare 2.4%
├── 28553 ──┬── 28564 bg-spare 2.6%
├── 29861 ──┬── 29878 bg-spare 16.2%
├── 43719 ──┬── 43733 bg-spare 10.1%
└── 46939 ──┬── 46973 bg-spare 39.4% ← worst offender
top CPU: claude.exe 44.3%, node 32.5%, WindowServer 31.6%, coreaudiod 20.7%
Mitigation (existing playbook)
Kill recipe in docs/debugging/toohot-many-bg-spare-workers.md:
- Identify own PID chain (
P=$$; while [ "$P" != 1 ]; do ps -o pid,ppid,command -p "$P"; P=$(ps -o ppid= -p "$P"); done)
ps -axo pid,command | awk '/--bg-spare/ {print $1}' | grep -v MY_PIDS | xargs kill -TERM
- Wait 2s, SIGKILL stragglers, daemon auto-prewarms 3-5 spares.
What this issue asks for
Doc-only post-hoc recipe is not enough — 2026-05-12 → 2026-05-14 we hit the same wall twice in 2 days, and the second time loadavg was 45% higher. Proposed scope (needs grill before driver dispatch):
Related
docs/debugging/toohot-many-bg-spare-workers.md — existing post-hoc kill recipe
docs/adr/0013-inner-loop-on-ci.md — same scheduler-overload mechanism, different trigger (vitest fork burst)
- User-level CLAUDE.md
show temperature recipe — Bash-only Top7 monitor
Notification
User asked for @libz mention in Slack when this is fixed. Slack ping has been queued separately.
Filed via /investigate skill on 2026-05-14.
Symptom
Mac feels physically hot, UI lag (mouse/keyboard/Terminal stutter, WindowServer at 31% CPU). Reported by user 2026-05-14.
Root cause
Claude Code CLI
--bg-spareworker leak — same pathology as documented indocs/debugging/toohot-many-bg-spare-workers.md(2026-05-12 case at loadavg 61). Current state is worse:~/.claude/jobs/)pmset -g thermflagTeamBrain attribution: NOT a TeamBrain code bug. The leak is in
@anthropic-ai/claude-codeCLI daemon (claude.exe daemon run). However, TeamBrain's multi-worktree / multi-driver workflow (/fixed-flow-driver,/reviewsubagent fan-out, 35+ subcommands, FIXEDFLOW parallelism) drives users toward N concurrent claude sessions → amplifies the leak.Reproduction
Expected on a hot machine: loadavg > 2× cores, multiple bg-spare/bg-pty-host pairs per claude session, thermal flag normal.
Evidence captured (2026-05-14 11:30 local)
Mitigation (existing playbook)
Kill recipe in
docs/debugging/toohot-many-bg-spare-workers.md:P=$$; while [ "$P" != 1 ]; do ps -o pid,ppid,command -p "$P"; P=$(ps -o ppid= -p "$P"); done)ps -axo pid,command | awk '/--bg-spare/ {print $1}' | grep -v MY_PIDS | xargs kill -TERMWhat this issue asks for
Doc-only post-hoc recipe is not enough — 2026-05-12 → 2026-05-14 we hit the same wall twice in 2 days, and the second time loadavg was 45% higher. Proposed scope (needs grill before driver dispatch):
pnpm teamagent doctor --bg-spareprobe that counts bg-spare/bg-pty-host pairs and yells if > 2× active worktree sessionspnpm teamagent reap-bg-sparethat does the safe SIGTERM-then-KILL recipe with own-PID-chain protection baked in@anthropic-ai/claude-codeif not already knownRelated
docs/debugging/toohot-many-bg-spare-workers.md— existing post-hoc kill recipedocs/adr/0013-inner-loop-on-ci.md— same scheduler-overload mechanism, different trigger (vitest fork burst)show temperaturerecipe — Bash-only Top7 monitorNotification
User asked for @libz mention in Slack when this is fixed. Slack ping has been queued separately.
Filed via /investigate skill on 2026-05-14.