Sub-Agent Infinite Loop: ~27 Million Tokens Burned in 4.6 Hours
A Claude Code sub-agent got stuck in an infinite loop, consuming approximately 27 million tokens in 4.6 hours with no way for the user to stop it.
The sub-agent started. The sub-agent didn't stop. 27 million tokens later, someone finally killed the process.
A developer reported on GitHub that a Claude Code sub-agent โ a child process spawned to handle a specific task โ entered an infinite loop that consumed approximately 27 million tokens in 4.6 hours. The agent kept processing, generating, and re-processing in an endless cycle.
The worst part: there was no way to stop it through the normal interface. The developer couldn't cancel the sub-agent. They couldn't interrupt the loop. The only escape was to kill the process at the OS level โ and by then, the token meter had been running for hours.
27 million tokens isn't just expensive โ it represents hours of uncontrolled AI execution that nobody authorized and nobody could stop. The sub-agent wasn't doing anything useful. It was spinning in a loop, burning tokens like fuel.
When your agent spawns sub-agents, and those sub-agents can loop infinitely, and you can't kill them โ you don't have an AI assistant. You have an AI liability.
More nightmares like this

$82,314 in 48 Hours: Stolen Gemini API Key With No Rate Limit
A stolen Gemini API key was used to rack up $82,314 in charges within 48 hours โ Google had no rate limiting or spending cap to stop it.

$47,000 Gone: Multi-Agent System Ran an Infinite Loop for 11 Days Undetected
A multi-agent AI system got stuck in an infinite loop that ran for 11 days before anyone noticed, burning through $47,000 in API costs.

$1,100 in Debt, Agent Lost Identity, Developer Lost Control of Machine
An AI agent accumulated $1,100 in API debt, lost its own identity mid-session, and the developer lost control of their machine until they could kill all processes.

$12,229 in API Calls โ Developer Only Paid $50
A developer's AI agent ran up $12,229 in API charges against a $50 initial payment, with no spending cap or circuit breaker to prevent the runaway costs.
