Home/ Incident database/claude-code-autocompact-loop-2025-10
Financial loss Runaway loop verified

Claude Code autocompacting loop spiked token usage until the budget ran out (flagged ACTIVE INCIDENT)

Claude Code users (GitHub issue 9579) · Oct 15, 2025 · Coding agent

What happened

Windows users reported Claude Code entering an autocompaction loop: the session compacted its own context over and over without ever finishing, spiking token usage on every cycle. The issue was labeled 'ACTIVE INCIDENT, Cost escalation ongoing', and linked reports described the loop running infinitely until the token budget was exhausted.

Loss / impact
Oct 15
2025
Runaway
Failure mode
Coding
Agent type

Causal vector

Autocompaction loop, context compaction retried indefinitely instead of terminating, burning tokens until the budget ran dry

Source

Reported by GitHub issue, anthropics/claude-code 9579. Verified against the primary report.

Read the original report ↗

How a spend firewall would have helped

Self-referential loops like autocompaction can't be reasoned away from inside the session: the stop condition has to live outside the model. A budget-bound firewall halts the process the moment cumulative spend crosses the ceiling, loop or no loop.

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

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. 67 documented failures, one control.