Fix the Loop, Not the Output: The Durable AI-Engineering Asset Is the Harness

TV
Thiago Victorino
8 min read
Fix the Loop, Not the Output: The Durable AI-Engineering Asset Is the Harness

Anthropic moved roughly a million lines of the Bun runtime from Zig to Rust in under two weeks. Every one of the project’s existing tests still passed. Nineteen regressions surfaced after merge, and all nineteen were fixed. The run burned 5.9 billion input tokens and 690 million output tokens, about $165,000 of model spend, and the rewritten runtime dropped from 6,745MB to 609MB of memory. What matters here is where the team spent its human hours.

Those hours went into the machine that produced the Rust: the rulebook, the adversarial review pass, the parity harness. The million lines of Rust, they mostly did not read by hand. When output came back wrong, the fix went upstream into the process, and the process regenerated the output.

The Migration Fixed the Process, Not the Code

Anthropic’s own account states the operating rule plainly: the discipline was to repair “the process (loop) that produced the code” and let the loop emit correct output on the next pass. That one sentence is the whole method compressed. A bad translation of one Zig file is a symptom. The cause is a missing rule, an unstated dependency, or a behavior the parity check never asserted. Patch the file and you fix one instance. Patch the loop and you fix every instance that was going to fail the same way.

The loop had six steps, and none of the deterministic ones were left to the model’s discretion:

  1. Prepare. Build a rulebook, a dependency map, and an inventory of what does not translate cleanly yet.
  2. Stress-test the rules. Attack the rulebook before trusting it, so the ambiguities surface on a whiteboard instead of in 400 files.
  3. Translate. Small models do the bulk implementation; large models review the output adversarially, looking for what the cheap pass missed.
  4. Compile. Dedicated fixer agents drive the build to green.
  5. Smoke test. Confirm the thing runs before anyone talks about correctness.
  6. Match behavior. A parity harness compares the new runtime against the old one and holds the line on semantics.

Intelligence sits in exactly two places: the adversarial review in step 3 and the ambiguity hunting in step 2. Everything else is scaffolding. The rulebook is a document. The dependency map is a graph. The compiler is deterministic. The parity harness is a test that either passes or does not. A separate Anthropic port moved 165,000 lines of Python to TypeScript over a single weekend on the same shape of machine, which is the tell that this is a repeatable method and not a one-time heroics story.

The Same Move at One-Hundredth the Scale

Adam Jacob, building System Initiative, took an agent workflow he calls the “swamp” and ran the identical play at the scale of a single task. His Garfield case study started at 4.6 million tokens, 12.8 minutes, and 23 agents coordinating each other in natural language. He rebuilt it to 506,000 tokens, 6.6 minutes, and 3 agents. Eight times cheaper. Half the wall-clock time. Twenty coordinating agents deleted.

The saving came from taking coordination out of the model’s hands. In the swamp version, agents talked to other agents to decide what to do next, and every one of those conversations was tokens, latency, and a fresh chance to drift. In the rebuilt version, the sequencing lives in typed, deterministic code. The model is invoked only where a decision genuinely needs judgment. Everything a function can decide, a function decides.

Two engineering efforts, two orders of magnitude apart in scope, arrived at the same design. When the model is doing work that a typed harness could do more cheaply and more reliably, move that work into the harness. Reserve the model for the steps where its judgment is the actual product.

The Model Is the Swappable Input; The Loop Is the Asset

We have already argued the deterministic-shell case from the primitives up: hooks block and evals verify around a probabilistic core, and loop engineering is where reliability actually lives. These two runs add the part that changes how you should budget. The harness is the durable asset. The model is a component you swap.

Think about what carries forward from the Bun migration. Not the Rust. The rulebook, the dependency map, the parity harness, and the six-step loop all outlive the specific model that filled them in. Run the next migration on a cheaper or newer model and the scaffold still holds, because the scaffold never depended on which model was doing the translating. The same is true of Jacob’s typed coordination code. It does not care which model sits at the one decision point it left open.

This inverts the default instinct. The instinct, when an agent system underperforms, is to reach for a bigger model and hope the extra capability papers over the missing structure. Both of these teams did the opposite and got a result the bigger model alone would not have produced. Anthropic used small models for the bulk of a million-line migration and spent its intelligence budget on adversarial review. Jacob got 8x by removing model calls, not adding capability. The leverage was in the loop the entire time.

There is a governance consequence worth stating. A model you cannot audit becomes trustworthy the moment it runs inside a harness you can. The parity harness is what let Anthropic ship a machine-written runtime with confidence: correctness was asserted by deterministic tests, not by trust in the generator. This is the same logic that makes harnesses for long-running systems the unit of reliability rather than the individual agent call.

Do This Now

Take one agent workflow you already run in production and audit it against a single question: where is the model making a decision that a typed function could make instead?

List every place the model is invoked. For each one, write down what decision it is making and whether that decision has a right answer a function could compute. Sequencing, routing, format validation, retries, and coordination between steps almost never need a model. If agents in your system are talking to other agents to decide what happens next, that conversation is your Garfield swamp, and it is the first thing to move into deterministic code.

Then find the highest-frequency failure your agent produces and refuse to fix the output. Trace it to the step in the loop that let it through. If a translation is wrong, the rule or the parity check is missing, not the line of code. Fix the loop so that this class of failure cannot survive the next run, and you will have spent your hour building an asset that compounds instead of patching an output that does not.

The winning move for 2026 is a loop good enough that a smaller model can run inside it safely.


This analysis synthesizes How Anthropic Runs Large-Scale Code Migrations with Claude Code (Anthropic, July 2026), A Practical Guide to Reducing Token Spend (Adam Jacob, July 2026).

Victorino Group helps engineering leaders turn agent workflows into auditable, deterministic harnesses that stay reliable as models change. Let’s talk.

All articles on The Thinking Wire are written with the assistance of Anthropic's Opus LLM. Each piece goes through multi-agent research to verify facts and surface contradictions, followed by human review and approval before publication. If you find any inaccurate information or wish to contact our editorial team, please reach out at editorial@victorinollc.com . About The Thinking Wire →

If this resonates, let's talk

We help companies implement AI without losing control.

Schedule a Conversation