OpenAI Codex stuck in a 9-hour compaction loop drained an entire weekly usage allowance
Codex user (OpenAI Developer Community) · Aug 25, 2026 · Coding agent
What happened
A user asked Codex to make a relatively small change to an existing project. Instead of completing it, the agent entered a continuously repeating loop: it announced the changes it was going to make, ran context compaction, re-explained the same plan, compacted again, and re-started - sometimes pulling previously completed work back into the workflow. The loop ran for roughly 9 hours unattended and took the account's weekly usage from 100% to 0% while the original task remained incomplete. The reporter asked for loop detection, no-progress timeouts, and a warning when a single task consumes an unusual share of usage.
Causal vector
Context-compaction loop: state lost across repeated compactions, same steps re-planned and re-executed for hours with no repetition guard or spend ceiling
Source
Reported by OpenAI Developer Community (first-hand report). Verified against the primary report.
A loop that re-plans the same completed work for nine hours is detectable at the call level: identical-intent requests with no state change are a repetition signature, and a firewall that blocks after N duplicate-intent actions preserves the rest of the week's budget instead of consuming all of it.
The six rule types that contain this class of failure
Per-transaction cap
Any single spend above your ceiling is BLOCKED before it moves.
Daily total
Cumulative spend across all agent calls, bounded per day.
Velocity limit
Stops runaway retry loops — the #1 cause of overnight losses.
Merchant allowlist
Only approved destinations can ever receive funds.
Category rules
Flag high-risk classes (crypto, infra, refunds) for review.
Approval threshold
Above a value, the action waits for a human.
Related incidents
Stanford Digital Economy Lab: agentic coding tasks consume ~1,000x more tokens than chat, with up to 30x variance on the same task
Stanford Digital Economy Lab · May 5, 2026
Forgotten /loop command checking PRs every 30 minutes ran 46 times over 26 hours and burned ~$6,000 overnight
Individual developer (r/ClaudeAI report) · May 1, 2026
Claude Code entered an infinite loop, re-sending the same requests for hours and burning $500+ in tokens
Claude Code user (GitHub issue 35166) · Mar 17, 2026
Don't be the next entry
Every incident in this database is the result of trusting a prompt, a provider cap, or a human review cycle. sipi.bot replaces all three with one deterministic call. 71 documented failures, one control.