Budget Circuit Breaker

Stop Runaway Agents Before the Bill

Set a budget limit for any AI coding agent — burn-rate, token, or dollar ceilings. When an agent loops, Terse escalates from alert to pause to kill, before the next API call — not after the invoice.

3ceiling types: burn-rate · tokens · $
8agents auto-detected
0tokens billed after trip
1-clickresume paused agent

The Runaway Agent Problem

Autonomous coding agents retry failing tests, re-read the same files, and loop on tool calls — while every iteration is a paid API call. Left running overnight, one stuck agent can burn hundreds of dollars.

Terse — Agent Monitor · claude (PID 48213)
Breaker Armed
02:14:07 claude-code · turn 41 · re-running failing test suite (attempt 12)
02:14:31 duplicate tool call detected · Bash(npm test) ×12 · Read(src/auth.ts) ×9
02:14:31 ⚠ ALERT — burn rate $14.20/hr exceeds ceiling $6.00/hr
02:15:02 ⏸ SIGSTOP — agent paused before next API call · session cost held at $3.87
02:20:02 ✕ SIGTERM (if unattended) — process terminated · trip logged to history
→ Resume anytime — one click continues the session exactly where it stopped
🔥

Burn-Rate Ceiling

Cap spend velocity in dollars per hour. A loop shows up as a burn-rate spike within minutes — Terse trips the breaker long before the session total gets scary.

$/hour
🎟️

Token Ceiling

Hard limit on total tokens per session. Terse tracks input, output, and cache tokens per turn, so the ceiling reflects what the API actually bills.

Per-session
💵

Dollar Ceiling

Set a plain dollar cap — "this session may not cost more than $5." Per-turn cost is computed with model-aware pricing, so the number is real, not a guess.

Model-aware
🚦

Escalation Ladder

Alert first, SIGSTOP pause second, SIGTERM kill last. Each stage is visible and reversible — the breaker never jumps straight to killing your agent.

Alert → Pause → Kill
⏱️

Stops Before the Next Call

Enforcement happens at the process level before the agent's next API request leaves your machine. Once the breaker trips, not one more token is billed.

Zero overshoot
📜

Trip History + Resume

Every trip is logged: which ceiling, which agent, session cost at the moment of the trip. Paused agents resume with one click and continue where they stopped.

One-click

How the Breaker Escalates

Three stages, in order, each one visible in the Terse dashboard and the Alert Center. Nothing is silent, nothing is destructive by default.

What a runaway night costs without a breaker
Agent loops on failing test, 90s per turn~40 turns/hr
Context re-sent every turn50k–150k tokens/turn
8 hours unattended~320 turns
Morning surprise$100s billed
Provider dashboards show this the next day. Terse sees the burn-rate spike in minutes — and acts.
The same night with the breaker armed
1Alert — ceiling crossed; notification via macOS, Slack webhook, or ntfy.sh push to your phone.
2SIGSTOP pause — the agent process freezes before its next API call. State preserved, zero further spend.
3SIGTERM kill — final stage if the ceiling is exceeded further. The trip is logged with full session context.
Result: the loop costs a few dollars, not a few hundred

The breaker pairs with Terse's live agent monitor — per-turn cost, burn rate, context-window fill, duplicate tool calls, and redundant file reads across Claude Code, Cursor, Cline, Windsurf, and more. And every prompt you do send is cheaper thanks to the built-in optimizer.

Frequently Asked Questions

Everything about budget limits, pausing, and killing runaway agents.

How do I set a spending limit for Claude Code?
Open Terse's Budget Circuit Breaker panel and set a dollar, token, or burn-rate ceiling. Terse reads Claude Code's exact token usage from its JSONL session stream and computes per-turn cost with model-aware pricing — no Claude Code config changes needed.
Can I pause an AI agent automatically?
Yes. On a ceiling breach Terse escalates: alert → SIGSTOP pause → SIGTERM kill. The pause freezes the agent process before its next API call, so no further tokens are billed. One click resumes the session exactly where it stopped.
What is a runaway AI agent?
An agent stuck in a loop — retrying a failing test, re-reading the same files, repeating tool calls — while every iteration is a paid API request. Overnight, one loop can burn hundreds of dollars. Terse spots the burn-rate spike and duplicate-call pattern within minutes.
Will stopping the agent corrupt my work?
No. SIGSTOP freezes the process without terminating it — nothing is lost, and resume continues the session. SIGTERM, the final stage, asks the process to exit cleanly. Your files and git history are never touched.
Which agents does the circuit breaker support?
Terse auto-detects 8 agents: Claude Code, OpenClaw, Aider, Cursor Agent, OpenAI Codex, GitHub Copilot CLI, Cline, and Windsurf. Claude Code gets exact token counts via JSONL streaming; the others are tracked via process and config detection with session-level stats.
Does the breaker send my data anywhere?
No. Everything — token counting, cost math, process control — runs on-device on macOS or Windows. Your prompts and code never leave the machine.

Also Works With

The breaker guards every agent Terse monitors — and the optimizer shrinks every prompt you send.

Claude Code — CLI Agent Cursor — AI Editor 🤖Cline — VS Code Agent 🖥️OpenAI Codex — CLI 🛡️MCP Manager — Audit Servers

Never Wake Up to a $300 Invoice

30-day free trial. On-device. Arm the breaker in under a minute.

Start Free Trial Calculate Your Savings