writingmaclulich.com

How to cut AI coding agent costs: 3 to 5× on real builds, repriced, not rerun

Five changes that make your coding agents cheaper and your savings claims honest

  1. Settle “done” by running the checksA test run costs no tokens. Neo does this, and matched Codex’s score on 33× fewer tokens
  2. Send the building to a cheaper model and keep a stronger one reviewingCodex built 81% of my units, and its own tokens were 4% of the money
  3. Start every task fresh, with an exact briefA Claude subagent’s first call fell from 52k to 6k tokens, and Codex’s from 47k to 21k
  4. Count dollars, not tokensNeo’s 33× fewer tokens was 7.5× less money. Mine was 2.4× fewer tokens and 5.2× less money, on the generous count
  5. Cap any claimed saving at what could reach the modelMy output filter reported 3.5 billion tokens saved. Capped at 30,000 characters, it was 12.4 million
From nine days of builds with Rigby, my harness for AI coding agents: the savings are its calls repriced at ordinary Claude Code rates, and I didn’t run the work twice.

Settle “done” by running the checks

If you run AI coding agents and want to know what a cheaper setup really saves, this is for you. I run mine through Rigby, my own harness that runs several of them at once, and a hackathon winner called Neo made me measure what Rigby saves on real builds.

Congratulations to Avneh Bhatia of Exea Labs and Amar Sakthi. They built Neo, a harness on top of Codex, and it took 1st place for Best Use of Durable Objects at the YC x OpenAI hackathon.

Neo matched Codex’s score on 33× fewer tokens, for 7.5× less money

96/96
the score, with and without Neo
33×
fewer tokens, 555k down to 17k
7.5×
less money, $0.0121 down to $0.0016
Codex alone against Codex with Neo on 36 HumanEval problems, from Avneh Bhatia’s post.

Their post has the idea I like most. Neo settles a “tests pass” claim by running the tests, which costs no tokens.

Rigby does the same. The project’s checks settle “done” at no token cost, and a second model normally reviews before anything merges.

Send the building to a cheaper model

Neo won on a clean benchmark, and I wanted the same answer on long, messy builds. So I priced nine days of mine: 305 merged units across two projects, each one a task handed to a coding agent.

The savings are Rigby’s calls repriced at ordinary Claude Code rates, on a cautious count and a generous one, and I didn’t run the work twice.

Rigby costs a third to a fifth of ordinary session rates, $6,900 to $15,400 less in nine days

What it cost$3,698
Same tokens, all on Opus$7,533
Plus an ordinary Opus call’s extra cost$10,600
Every call at an ordinary Opus price$19,076
At list prices, against ordinary Claude Code sessions on the same machines in the same nine days. These are Rigby’s calls repriced, and I didn’t run the work twice.

Codex built 81% of the units, and its own tokens were 4% of the money

Claude Opus$2,74434,185 calls, 6.5 billion tokens
Claude Sonnet$76426,668 calls, 1.9 billion tokens
Codex$15378,374 calls, 7.6 billion tokens
DeepSeek through Claude Code$1419,006 calls, 1.7 billion tokens
$3,698 at list prices, including $23 of Claude Fable, with up to an estimated 6% more uncounted in background summary calls on one project.

Opus is three quarters of the bill because it plans, coordinates and does most of the reviewing, including Codex’s units. Even so, on the cautious count, sending the building to cheaper models halves the bill on its own.

So Claude plans and reviews while Codex builds, and the review stays with the stronger model.

Start every task fresh with an exact brief

Cheaper models weren’t the only saving, because each task also started with less.

Tokens fell on both sides after a lean start and one task per session

52k → 6k
Claude subagent, size of its first call
47k → 21k
Codex first call, ordinary session against Rigby
28%
fewer tokens per Codex unit, on the same model and size
Subagents 5 to 11 October against 12 October to 3 November, and Codex units before 22 October against those since 26 October.

A subagent now starts with an exact brief instead of the whole project’s context. Codex’s drop came after one task per session and a smaller startup, two changes I can’t separate, so I’d make both at once.

Count dollars, not tokens

Neo’s 33× is in tokens, but what you pay is dollars, and the two moved differently for both of us.

Neo saves more tokens than dollars, and Rigby saves more dollars than tokens

33× / 7.5×
Neo: tokens / dollars
2.4× / 5.2×
Rigby: tokens / dollars, generous count
Neo’s figures are from Avneh Bhatia’s post. Rigby’s are its calls repriced at ordinary Claude Code rates, and I didn’t run the work twice.

97% of my tokens were cache reads, at a tenth of the input price or less, but only 42% of the bill. Routing changes what a token costs, not how many you use, so I compare approaches in dollars.

Cap savings at what could reach the model

My output filter, which trims command output before the agent sees it, claimed billions of tokens saved. But Claude Code cuts long output at 30,000 characters by default.

Capped at what could reach the model, 3.5 billion saved tokens become 12.4 million

What the filter reports3,479 million
Capped at 30,000 characters12.4 million
37,606 commands on two machines in the same nine days, and a cap of 100,000 characters would give 26.9 million.

I’m keeping the filter, and that number stays out of the totals. Any percentage saving deserves the same check, and I did the same for Spotify’s 90% Claude Code figure.

How far to trust it

This is real work repriced, not a benchmark run twice

  1. Repriced, not rerunI didn’t run the work twice, so an ordinary session might need fewer calls than this assumes
  2. Very different workHumanEval is a small function and its test, while my median Codex unit used 6.5 million tokens
  3. A third came back from reviewAnd reviews sent back 38% of Codex’s leaner units, against 30% before
  4. Cost per merged unit has risenSince mid-October, as reviews became a bigger part of the bill

Copy this checklist for your own agents

It’s the list I’d run any saving through, mine included.

  • Send the building to a cheaper model and keep a stronger one reviewing.
  • Start each task in a fresh session with an exact brief, not the whole project’s context.
  • Settle “done” by running the project’s checks, which costs no tokens.
  • Say how a saving was measured: calls repriced, or the same work run twice.
  • Count dollars, not tokens. Cache reads were 97% of my tokens and 42% of my bill.
  • Cap any filter’s claim at what could reach the model. Claude Code cuts long output at 30,000 characters by default.
  • Watch what comes back from review. It sent back 38% of Codex’s leaner units.

How I did it

Strong models plan and judge, a cheap one builds, and checks settle every claim

  1. Claude plansOne Claude Code session sends out the work
  2. Codex buildsMost of the units, each in a fresh session
  3. Checks runThe project’s checks settle “done”, at no token cost
  4. Claude reviewsA second model normally reviews before it merges

One operator, two projects, 305 units merged in nine days

4,386
file changes in those units
158,281
model calls on Claude, Codex and DeepSeek
17.7B
tokens, 97% of them cache reads
26 October to 3 November, priced at list API prices. I pay subscriptions, so these dollars compare approaches and aren’t my bill.

The cautious count prices my exact tokens at Opus and adds the extra an ordinary Opus call costs, 1.4 times a Rigby planning call.

The generous count charges every call the average ordinary Opus call, 12 cents. Rigby’s calls averaged 2.3 cents.

Avneh says they’re turning Neo into a product, and I’d love to see what it does on a long build. Congratulations again to Avneh and Amar.