Anthropic just published how it moved its Messages API, the service every Claude request goes through, from Python to Rust. Claude agents wrote most of the port.

The headline numbers are good:

  • about 70% less CPU per request
  • over 80% less memory per request
  • about 20% faster median time to first token

(They say some of these are scoped: the CPU figure is one region, and the time to first token figure covers Claude Code customer requests over a shorter window.)

But the speed is not the part worth stealing. The part worth stealing is how they proved the new code was right.

The old system became the test

They had around 700 integration tests, but those were tied to the Python implementation. An audit of the ported tests found more than 100 weakened assertions. So the tests alone could not be trusted.

Instead, they used the live Python API as the answer key:

  1. Real production requests were shadowed through both versions.
  2. The model ran once, and its output was replayed into the Rust version. That removes randomness, so any difference is a real difference.
  3. Every step before and after the model call had to match exactly.
  4. For privacy, nobody read request or reply text. Differences were logged by shape only (which step, which part of the prompt, byte offset, lengths) and grouped by fingerprint.

Three loops

The write-up describes three feedback loops:

  • Inner loop: fast local checks. An input check that runs in under a second, and an output check against a fake model.
  • Outer loop: fixes tested on shadowed production traffic.
  • Memory loop: every correction from an engineer turned into a rule, a test or a lint, and then into CLAUDE.md, so agents stopped repeating the same mistake.

A coordinating agent watched for new kinds of differences and handed each kind to a worker agent. Humans steered in a shared Slack channel and reviewed every PR.

It was not magic

Input match on shadowed traffic started at 24% in late April and took months to reach 99.6%. Parity was a moving target too, because the Python service kept changing during the migration.

My favourite detail: one agent found a cheap shortcut that made outputs match without doing the real work. An engineer rejected it. Passing the verifier is not the same as being correct, so human review stayed as the final gate.

Their own conclusion: verification is the new bottleneck.

Why this matters to me

I research LLM hallucination, and this is the same problem from the other side. Generating text or code is cheap now. Knowing whether it is right is the expensive part.

What a small team (or a student) can copy

You probably do not have production traffic to shadow. You can still steal the pattern:

  • Keep a known-good version as your oracle. Before you let an agent rewrite something, save real inputs and the current outputs. That becomes your answer key.
  • Kill randomness before you compare. If an LLM call is in the middle, record its output once and replay it.
  • Group differences, do not read them one by one. Fingerprint mismatches by type so you fix classes of bugs, not single cases.
  • Turn every correction into a rule. A test, a lint, or a line in your agent's instructions file. Otherwise you will correct the same thing again tomorrow.
  • Keep a human gate. Agents will find ways to pass your checks. Someone still has to ask whether the fix makes sense.

Your turn

If AI writes most of your code, what is your oracle? What do you check it against?

Source: Migrating our Messages API to Rust, Anthropic, Nov 25, 2026.

I'm Veer, I write about AI, tech and society at SpaceRock. More of my work: veersolanki.in