Cost, tokens and quotas
Why loops are expensive in ways a single prompt never is, with real numbers (handled with care) and the levers that help.
Why loops multiply cost
Per-token prices keep falling, but loops make far more calls per task. Secondary sources quoting Gartner put agent token use at 5–30× a chatbot call per task (Spheron); others claim up to 50× (LeanOps). secondary reporting The mechanics:
- Every step re-sends accumulated context. The bill compounds with every action (Unblocked: the auto-loop tax).
- Every continuation re-reads everything. In a goal loop, turn 30 pays for turns 1–29 again (minus cache discounts).
- Waiting turns into polling. A goal loop with no notion of "sleep" re-fires while CI runs. See the Codex pacing analysis.
- Ambient loops pay to do nothing. A heartbeat that finds nothing still pays for a model call, unless the harness skips it.
- Fan-out is invisible. One goal can spawn 10+ model calls through sub-agents (AI Builder Club).
The numbers people cite
Treat these as stories, not statistics
Most dollar figures in the 2026 discourse come from single blog posts without primary data. They're useful as an illustration of failure modes, not as base rates.
| Story | Figure | Source |
|---|---|---|
| Codex goal mode share of input tokens | 52 of 3,808 sessions ate about half of all input tokens | relux.works anecdotal |
| A waiting goal loop | 173 continuations in 48 min, each re-reading 120k–470k tokens | relux.works anecdotal |
| Two agents ping-ponging | 264 hours, about $47,000, stopped only when someone saw the billing dashboard | cost horror stories anecdotal |
| A long weekend | about $4,200 from one forgotten agent | same anecdotal |
| Anthropic's 3-agent harness | about 6 h and $200, roughly 22× a solo run | Ruh AI secondary reporting |
| Annual budgets | Teams over annual token budgets by spring | TrustGate anecdotal |
Subscription quotas: the cost you feel first
For most individuals the binding constraint isn't dollars but plan limits:
- Anthropic introduced weekly limits in 2025 specifically to curb 24/7 background use (TechCrunch). Users report exhausting them in one or two days, and some cancelled (#9424, #76006, The Register, DEV).
- Codex users report "burning half a week overnight" (DEV, #14593).
- Pricing is adapting: the new Claude Ultra plan drops the five-hour window for verified accounts (weekly limits stay) (vanja.io, Online Tech Tips).
Levers that help
Turn caps, token caps, dollar caps. Hermes added gateway spending limits; Codex supports per-goal token budgets. See Budgets.
Sleep, back off or wake on events while waiting for CI or deploys. Don't poll with a model.
If the goal is "tests pass", read the exit code first. Only ask a model when the answer isn't mechanical.
A cheap judge, cheap routine steps, strong models for planning and recovery. See Model choice.
Loops re-send long prefixes, so cache-hit pricing often dominates loop economics (Fastino). Keep stable content (instructions, tool definitions) at the front of the context.
Stop after N identical errors. Stop when nothing measurable has improved in M iterations. The AgentLoop paper reports large savings from stopping when iterations stop adding information.
Cost is also a security issue
Runaway loops can be triggered on purpose. Prompt-injected agents can be made to spend, which is why token costs are increasingly framed as a security risk (Sondera). One May 2026 paper even claims providers could inflate billed token counts without detection. That's a single research claim, not a documented pattern.
Further reading
Verification and false "done"
The root problem. A loop is only as good as its check, and agents both overclaim and game weak checks.
Context, state and memory
Long runs collect noise, compaction loses information, and work has to survive resets and crashes. These are related problems with different fixes.