runcap
Open source · MIT · 100% local

Know what your agent will cost before you build it.

Runcap estimates the cost of a coding-agent run as a range, sets a hard ceiling that physically stops the run, compresses wasted tokens out of every call, and hands you the exact rescue prompt when the agent gets stuck. Your code and tokens never touch a server.

What you'd see after one day
You saved $7.40
31,000 tokens compressed away

You would have spent $18.40. Runcap compressed it to $11.00 and would have killed the run at your $15 cap. Same answers, fewer tokens, no surprise invoice.

spent $11.00cap $15.00

Every other tool is a rear-view mirror that shows you the bill after you paid it. Runcap estimates the bill before you start and caps it. It's a circuit breaker, not a dashboard.

The 2am surprise invoice

Multi-agent coding runs burn roughly 15x more tokens than a single chat. Agents loop on the same error, rewrite plans, and hand you a confident summary while the task is not actually done, and you find out what it cost when the invoice, or the subscription limit, arrives. Observability tools measure the past. Gateways route the present. Neither stops the spend before it happens.

1. Estimate a cost range before the run starts
2. Cap with a hard ceiling that stops the run
3. Compress wasted tokens out of every call
4. Rescue with a copyable prompt when stuck

See it in 60 seconds

No API key required. Runcap catches a too-broad request before it spends a cent, then hands back a rescue prompt the moment a run gets stuck.

$ runcap preflight -- claude "build the full app with auth, payments, deploy"

Scope risk: high
Recommendation: Do not launch as one broad mission.
  Split into one vertical slice with a verification command.

$ runcap run --label demo -- npm run build

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@/components'

Runcap mission: 20260601T221531-demo
Status: stuck (medium confidence)
Changed files: 0   Parsed errors: 1
Primary recommendation: Resolve missing import before continuing

Rescue prompt: Do not continue broad implementation. Diagnose this
  missing module first: Cannot find package '@/components'. Check
  package.json, tsconfig paths, and the latest git diff. Make the
  smallest change that resolves the import, then run the command again.

The compression no other proxy has

Coding agents read a file, change one line, then re-read it. The two copies are almost identical, so the dedup every other gateway does saves nothing on the second copy. Runcap is the only one that sends a lossless line-diff against the version the model already saw, and the model reconstructs the current file from it. Same answer, a fraction of the tokens.

Real OpenAI call, same question, same correct answer
compression off
1,186 prompt tokens
delta compression on
737 prompt tokens
37.9% saved

These are the token counts OpenAI itself billed on two identical calls, not an estimate. The model never received the full re-read, only the diff, and still answered correctly about the one changed line. Lossless by construction: Runcap refuses to emit a delta unless it reconstructs the original byte for byte.

See the proof and reproduce it

Who this is for

Runcap is a developer tool. It runs a local gateway that your agent's API calls pass through, so it can price and cap them before they reach the paid provider. To use it you already need three things in place.

Your own API key

An OpenAI or Anthropic key. Runcap never sells or supplies model access, it only caps the spend on the key you already have.

Your own agent

Claude Code, Codex, or any script that calls the OpenAI or Anthropic API. Runcap wraps it, it does not replace it.

Comfort with a CLI

You run one command and a local process on your machine. If you want a no-account web app that runs the AI for you, this is not that.

Install in 30 seconds

# run the demo with zero setup
git clone https://github.com/kirder24-code/ai-agent-manager.git
cd ai-agent-manager
npm run setup
npm run demo

# or install the CLI globally
npm install -g runcap

# put a hard daily ceiling on any Claude or OpenAI agent
ANTHROPIC_API_KEY=sk-ant-... AIM_DAILY_BUDGET_USD=5 runcap gateway
# the run is killed the moment spend crosses your ceiling

The honest claim

Runcap does not promise an exact cost oracle. Agent runs are stochastic and nobody can predict the exact token count. So it gives you a range plus a hard cap: "this build is roughly $3 to $7, cap it at $10." The range is the headline. The hard cap is the product. Every output carries a truth label (observed, calculated, provider_usage, unknown). If Runcap can't prove something, it says so.

Pricing

The local core is free forever and never crippled. Only persistence, collaboration, and aggregation are paid: the things that only matter once data leaves your laptop.

Founding offer · limited
$49 once
Lifetime Pro at the founder price. Pay once, keep Pro forever: no monthly fee, locked in before Pro moves to $19/mo for everyone else.
Become a founder, $49 →

After launch, Runcap moves to standard subscription pricing:

TierPriceWhat you get
OSS
MIT, local
$0
forever
All local runs, cost estimation, hard spend cap, run wrapping, stuck detection, rescue prompts, local dashboard.
Pro $19/mo
founders pay $49 once
Cloud sync across machines, hosted dashboard, estimate-vs-actual trends, shareable reports, alerts on cap breach.
Team $49/seat/mo Shared budget pools, org-wide ceilings, per-project rollups, role-based caps for junior devs.