The short answer
- A runaway loop is an agentic task stuck repeating itself — re-reading files, retrying a failing command — spending tokens while making no progress.
- Nothing stops it locally. On the API there's no per-session spending cap in Claude Code; on a subscription you're throttled, not warned.
- The cost is the unattended part. A stuck Opus loop can spend several dollars a minute — dangerous mainly because you stepped away.
- The fix is detection. Watch for repeated identical tool calls and spend with no progress — or let a monitor alert you the moment it happens.
What a runaway actually is
Claude Code is agentic: on a hard task it reads files, runs commands, edits code, checks the result, and repeats. Usually that loop converges — each round gets closer and the task finishes. A runaway is when it doesn't converge. The agent gets stuck:
- Re-reading the same files turn after turn without acting on them.
- Retrying a command that keeps failing the same way.
- Editing the same lines back and forth, undoing its own work.
- Chasing a test that can't pass, generating fix after fix.
Each of those rounds costs tokens — and because context is re-sent every turn, a stuck loop pays full freight on a large prompt over and over. The output is nothing; the meter runs anyway — at the same per-token rates that make up a normal Claude Code bill.
Why nothing stops it by default
This is the part people don't expect. There's no line in Claude Code that says "stop at $10 this session."
| Billing mode | What happens during a runaway |
|---|---|
| Subscription (Pro / Max) | You burn through your rolling usage allowance faster, then get throttled. No warning that a loop is why. |
| Anthropic API | No per-session cap in Claude Code. Every token bills. Console-level budget alerts exist but are account-wide and after-the-fact. |
So the only thing standing between a stuck loop and a surprise bill is you noticing. And the whole appeal of an agent is that you don't have to watch it — which is exactly when a runaway does the most damage.
How to spot one early
If you're watching the terminal, the tells are clear:
- Repetition. The same tool call — same file, same command — scrolling by again and again.
- No forward motion. Lots of activity, but the actual diff or answer isn't getting closer.
- Spend climbing on a flat task. The running cost keeps rising for something that should've finished.
- A lone spike in your timeline. After the fact, a runaway shows up as one day (or one session) that dwarfs the rest.
That last signal is why reading your history matters — see how to read your Claude Code usage. A single spike that doesn't match a productive day is almost always a loop you didn't catch.
How to catch one automatically
Watching the terminal defeats the purpose of an agent. The better approach is a monitor that watches for you and only interrupts when something's wrong. That's the job Dinoradar's Runaway Guard does:
- Loop detection: it notices when a session is repeating the same actions without progress and flags it.
- Per-session spend threshold: set a ceiling; if a single session crosses it, you get a native alert with the amount.
- One click back: the alert takes you straight to the exact terminal so you can interrupt the loop and move on.
It runs entirely on your Mac against the local session history — nothing is uploaded. The goal isn't to babysit every task; it's to let you walk away safely, knowing you'll be pulled back the moment a task stops being productive.
Frequently asked
What is a runaway loop in Claude Code?+
An agentic task stuck repeating the same action — re-reading files, retrying a failing command, re-editing the same lines — without making progress. Every round-trip spends tokens, so a loop left running can burn far more than a normal task while producing nothing.
Does Claude Code have a spending limit?+
On a subscription you're capped by rolling plan limits (throttled, not billed more). On the API there's no built-in per-session cap in Claude Code — you pay for every token. The Anthropic Console has account-level budget alerts, but nothing stops a single stuck session locally.
How much can a Claude Code runaway cost?+
It depends on the model and how long it runs unattended. A stuck Opus loop re-sending a big context every turn can spend several dollars a minute — enough to exceed a normal full day if it runs while you're away. The rate isn't the real danger; the fact that nobody's watching is.
How do I stop Claude Code from wasting money on a stuck task?+
Watch for repeated identical tool calls and spend climbing with no progress, then interrupt the session. A monitor like Dinoradar automates it: it detects looping or a per-session spend threshold and sends a native alert so you can jump back and stop it.
Walk away from Claude Code without the bill anxiety.
Dinoradar's Runaway Guard watches your sessions locally and alerts you when one loops or crosses a spend limit. Free forever · Pro $29 once.