Know the cost first.

Pitstop pauses your AI agent before it overspends, shows how far along it is and what finishing will likely cost, then lets you continue or stop without losing work.

go install github.com/ShadowIzzHerZ/agent-spend-firewall/cmd/pitstop@latest
~/code/checkout-servicezsh
$0.00 / $100/8 stepson track

AI gains, until the bill lands.

NET GAIN FROM AI · daily, in thousands of dollars Illustration with made-up numbers. Not a real company or real data.
$0.0knet gain +$0.000 (+0.00%)
AI spend today$0.0k
Agents running0
Statusgrowing

Your agents ship work. The gains add up.

AI gains Without Pitstop With Pitstop

How a run goes

One command in front of the agent you already use.

run 1124-2050
agentclaude
repocheckout-service
budget$10.00
started

First, it meters every call.

run 1124-2050
steps3 of 8
spent$3.40
likely more$5.10 – $10.20
on track

Then it reads the plan.

run 1124-2050
steps5 of 8
spent$7.10
likely more$4.20 – $8.40
needs you

It pauses when it won't fit.

run 1124-2050
outcomefinished
total$13.30
forecastright
saved to wip branch

You choose. Nothing is lost.

45models priced from the providers' own pricing pages
$0.000001the smallest amount the meter counts
5repeats of the same call, and the loop is stopped
9 minwithout an answer, the run stops. It never continues on its own.
0prompts, code or keys written to disk

What Pitstop never keeps

It sits between your agent and the provider, so it sees every call. It keeps only what it needs to count money.

  • Your API key passes through to the provider and is never written down.
  • Prompts and code are forwarded, not stored. The ledger holds model, tokens, cost, time and tool names.
  • It listens on 127.0.0.1 only, and its control API refuses requests from web pages.
  • An Anthropic key only ever goes to Anthropic, and an OpenAI key only to OpenAI.
  • The whole thing is open source under Apache-2.0, so you can read every line.
Request from claude
x-api-keysk-ant-••••••••••••
modelclaude-sonnet-4-5
messages42 turns, 61,204 tokens
forwarded to api.anthropic.com
Row written to ledger.db
run1124-2050
modelclaude-sonnet-4-5
tokens61,204 in · 812 out
cost$0.195792
promptnot stored
keynot stored

Built around the pause

Everything else is the base that makes the pause trustworthy.

Exact cost meterInput, output, cache read and cache write tokens, priced from a versioned table in integer micro-dollars.
Hard capsPer run, day and month. Each call reserves its worst case first, so parallel runs can't overshoot.
Loop detectorSame call 5 times: stopped.
Reads the planTodoWrite or report_progress.
Stop without losing workYour working tree is committed to a WIP branch. Your own branch, index and files stay untouched.
Public accuracyForecasts scored on your runs.
Nothing leavesKeys pass through, never stored.

What one stuck loop costs

Set it to your agent and see what a loop costs when nobody is watching, and what it costs when Pitstop stops it at the fifth repeat.

$0without Pitstop, over 0 calls
$0with Pitstop: 4 calls, then stopped at the fifth repeat

Prices per million input / output tokens, from the providers' pages on 24 Nov 2026. Assumes every call re-sends the full context at the normal input price and writes 1,000 output tokens. Prompt caching would lower both numbers.

A cap stops. Pitstop asks.

Provider spend limitA plain budget capPitstop
Limit per taskNo, per workspace or monthYesYes, plus day and month
Checks before the call is sentNoDepends on the toolYes, worst case reserved first
Knows how far the task gotNoNoYes, from the agent's plan
Says what finishing will costNoNoYes, a likely range
Lets you continue on the spotNoNoYes, one click
Keeps the work when it stopsNoNoYes, on a WIP branch
Catches loopsNoNoYes, at five repeats

Free, and it stays free

The local core is open source under Apache-2.0. It runs on your machine, as one binary, with no account.

  • Proxy for Anthropic and OpenAI-style APIs
  • Caps, loop stops and the decision card
  • Checkpoint, resume and the local dashboard
  • Every future local feature
Set a budget
$0per month

A hosted Team plan, with shared runs and approvals for leads, is planned from $99 a month. It is not available yet.

Fair questions

Which agents does it work with?

Anything that takes a base URL for Anthropic or OpenAI-style APIs: Claude Code with an API key, Codex CLI, Aider, Cline and your own SDK agents. Start them with pitstop run -- <command>.

Does it see my code or keys?

Keys pass through to the provider and are never written to disk. Prompts and code are never stored. The ledger keeps metadata only: tokens, cost, model, time and tool names.

What if nobody answers the card?

After 9 minutes the run stops and your work is saved to a WIP branch. Pitstop never continues on its own.

How good is the forecast?

Remaining cost is steps left times the average cost per step so far, adjusted for growing context. It is labelled low confidence until 3 steps are done, and every forecast is scored against what really happened.

Is it for ChatGPT or Claude.ai plans?

No. Flat monthly plans have no per-call bill to protect, and a local proxy can't sit inside those apps. The same goes for Claude Code on a Pro or Max subscription.

What happens if the proxy crashes?

Agent calls fail rather than slip past your budget. Restart it with pitstop serve and carry on with pitstop resume.

What does an unknown model cost?

Pitstop blocks the call with a clear message until the model is in the price table. A wrong price would be a bug in the one thing you trust it for.

Set your first budget.

Pick an agent and a budget. Copy the two commands, and your next run pauses before it costs more than you agreed to.

New run budget