6 Claude Code agents burned tokens on idle loops until one exit fix cut costs 6×
Icy_Comfort_6220 · reddit · 2026-07-21
A small zero-human publishing setup running 6 Claude Code agents found that the biggest cost driver was not model price, but orchestration mistakes and idle loops.
What went wrong
- The orchestrator used a frontier model for simple triage.
- Heartbeat runs kept waking up, finding nothing to do, and failing to record a clean exit.
- That caused re-wakes and repeated empty runs, which quietly burned tokens.
What changed
- Right-sized the models: routing/triage agents moved from Sonnet 4.6 to Haiku 4.5, while the Writer and Researcher kept the stronger model.
- Added an early-exit gate: if no work is assigned, the run exits immediately before doing deeper checks.
- Used prompt caching for the large static system prompt.
- Added per-agent budgets with soft alerts.
Cost impact
- Orchestrator heartbeat: about $0.40 → $0.06 when idle, or $0.11 when it actually works.
- A typical idle heartbeat now costs $0.06 and exits in 8 seconds.
- The writer remains the biggest cost line item, but that is acceptable because it is the actual product.
The core lesson: the real problem was frequency × giant prompts × idle loops, not token price alone. A cheaper model would have hidden the bug instead of fixing it.
Related event: Recursive Loops in Claude Code Agents Cause Cost Spikes(2 posts)→
More from coding & agent
- HeyGen adds a media-sourcing skill for coding agents with 75k images and 10k tracks — HeyGen · 2026-07-22
- Agent search bottlenecks are now about variance, not raw latency — rohanpaul_ai · 2026-07-22
- LangSmith adds tracing for Pipecat, LiveKit, OpenAI Realtime, and Gemini Live — LangChain · 2026-07-22
- An MCP server signs every AI agent tool call into a verifiable Merkle chain — Funky_Chicken_22 · 2026-07-22
- Annotated transcript of a Claude Code team interview is now available — trq212 · 2026-07-22
- Claude Code skill uses 10 Markdown rules to make outputs ADHD-friendly — alex_verem · 2026-07-22