Rework is where agent cost hides
This is for you if you run AI coding agents and want fewer rounds of fixes per task. It’s one week of changes to mine, measured against the week before.
I run them in Rigby, my own harness for running several AI coding agents. A lead agent, a Claude Code session on Opus, plans each task and reviews it. A builder, Codex, writes the code, and a task that fails review goes back for fixes.
Restart your lead instead of compacting
A long session fills the model’s context, so Claude Code compacts it into a summary. My lead came back from every compaction carrying about 150,000 tokens.
Now it starts a fresh session at 200,000 tokens, with a short note of where it was. Calls cost the same, but it needs fewer and smaller ones.
Last week I asked whether a fresh start would beat compaction. On this project it has, though the trial’s full week ends on 6 November.
Try it on your own lead: restart at a token limit with a short note of where it was, and compare calls per task before and after.
The other cost is a task that fails review and comes back, which is where the briefs come in.
Put the tests in the brief
Since 27 October each task’s brief lists the tests the work has to add. The builder knows what done looks like before it starts, which probably explains the rise.
I can’t prove it. Other changes landed that week too, so I’m calling the briefs the likely cause, not the proven one.
Add the tests to your own briefs the same way, and record first-time passes before and after.
Count rounds of fixes per task
A higher first-time pass rate should mean fewer rounds of fixes, so I counted those too.
Every first-time pass skips a second build and a second review. The worst tasks were also the dearest: the most expensive cost $63 the week before, and $25 last week.
Rework is where cost hides, and the first-time pass rate shows it, so count rounds of fixes per task.
How far to trust it
My other project, Neuma, also passed review first time more often, 56% to 63%. Its lead did much of that week’s work itself through helper agents, which task counts miss, so I’ve left its other numbers out.
Copy these into your briefs and your lead
Both are paraphrases of what mine do, so change the wording to suit your setup. Add this to every task brief:
Tests this task must add:
- <test name>: <what it checks>
Done means these tests exist and pass.And give your lead agent this rule about its own context:
When your context reaches 200,000 tokens, do not compact.
Write a short note of where you are and start a fresh session from it.To compare one week with the week before, keep three records:
- For every task, who built it, its rounds of fixes, its tokens and its cost.
- For the lead, its calls, context and cost per task.
- What could mislead the comparison, written down before you claim a result.
How I measured it
Task figures come from Rigby’s daily ledger, and the lead’s from its Claude Code transcripts, by the same scripts as my earlier audits. Every dollar is a list API price.
Next I’m trying a mode where the lead keeps four helper agents busy and reviews their work itself. I’ll measure it the same way.