Skip to content
#5 Critical

The Runaway Train

Autonomous loops without budget caps or exit conditions

! 71% of monthly budget burned in 3 days

Claude enters a retry loop — running the same failing command 7+ times without changing approach. A 50-iteration autonomous loop costs $50-100+. One developer burned 71% of their $200/month budget in 3 days from unattended sessions.

DON'T No guardrails, no budget, no turn limit
# "Let Claude figure it out overnight"
"color:#7C5CFC">claude -p "Fix all TypeScript errors in this repo"

# 2am: Claude is on iteration 47
# Still running the same tsc command
# Still getting the same error
# $87 burned and counting...
DO Budget + turn cap + verification
# Double safety: budget AND turns
"color:#7C5CFC">claude -p "Fix TypeScript errors in src/auth/" \
  "color:#d97757">--max-budget-usd 5.00 \
  "color:#d97757">--max-turns 15 \
  "color:#d97757">--output-format json

# Check result
result=$("color:#7C5CFC">claude -p "..." "color:#d97757">--max-budget-usd 5 "color:#d97757">--output-format json)
"color:#7C5CFC">if "color:#7C5CFC">echo "$result" | "color:#7C5CFC">jq -e '.subtype | test("error")' > /dev/null; "color:#7C5CFC">then
  "color:#7C5CFC">echo "Hit safety limit — review partial progress"
"color:#7C5CFC">fi

Sources

GitHub #19699 GitHub #25963 GitHub #10505

Related Chapters