One review. Five parts.

  • Reads: your repo and your eval results, and the model calls it makes itself.
  • Never touches: your production traffic or your request path. There is no proxy and no inline latency.
  • You change: nothing in your code. Margin opens a pull request you merge, and if quality slips it opens the revert as a second pull request.

Margin grades each agent operation on your evals, against what it cost. Only you know what the outcome was worth: a merged PR, a passed test, a resolved ticket. Price it and each operation reports its return; price nothing and it reports cost per outcome, labelled as one.

We turned down a 69% saving. 116 real tasks, a cheaper route at 31% of the incumbent’s bill, quality 93% to 79%, parity 0.85 against a 0.97 bar. The gate refused it. Published, tagged is_simulated=false.

The Meter

Every call, metered: cost, tokens, substrate, and whether it worked, a verdict your own evals supply.

Margin meters the model calls its own runs make, on a connected repository or a dropped folder, and records what each one cost. The verdicts come from the results your eval tools already write, through 8 adapters. Nothing is added to your code or your request path; an optional SDK can record production calls after each response returns.

Cost per outcome is the honest default of a value-per-outcome model. Until you price an outcome, every figure Margin computes is cost per outcome, and it is labelled as one. Price yours and the meter records it beside the cost, every outcome counted once and unweighted. A value you did not supply is never invented.

The first ledger we metered end to end: $1.04 across 332 calls bought 280 outcomes: $0.003722 each.Meter
$1.04 billed280 landed outcomes$0.003722 an outcome
n = 332 metered calls280 of 306 outcomes landedis_simulated=falsecaptured 2026-09-03

Source: the committed artifact provenance/oss_cost_per_outcome_usd.json, Aider and CrewAI on gpt-4o. The published package trails this build: PyPI is 0.6.23 (repo 0.6.24). A plain pip install does not fetch every adapter shown yet. Setup through /start works on it. Registries read 2026-11-02.

A cheaper route, once a person approves it, is held only while quality holds. Today that bar is one we set on your behalf.

The loop

One control loop, five parts.

The Meter, the Estate, the Money Map, the Parity Gate, the Governor. A 1:41 narrated film; no video loads until you press play.

  • Model routing
  • Reasoning effort / thinking budget
  • Output-length control
  • Prompt / prefix caching
  • Batch / flex mode

25 levers in the catalogue · 5 named here

Watch the loop run on real spend.

The console runs it on open-source agents we metered ourselves, every number tagged real or sample.

Free and open: Margin in your coding agent

The Margin plugin for Claude Code, and configs for Cursor and Codex, are MIT licensed. Your agent can ask where the money goes per job, which steps are worth a face-off, and what a face-off found, from your own project. They read; face-offs and pull requests stay in the console.

margin-plugins on GitHub

What Margin adds: the acting half

Proving a cheaper model held quality first, promoting that route, and reverting it when parity slips. Measuring spend is becoming table stakes; this is the product.