Home › Blog › The Code Took a Week. The Checking Took Months
AI Engineering

The Code Took a Week. The Checking Took Months

Anthropic let Claude write most of a Rust rewrite of its Messages API. The code took about a week. Proving it was right took an oracle, a fingerprint and a human on every merge.

One signal a day. No noise. A 3-minute read when something genuinely shifts.
By Tyron Dizon · November 27, 2026 · 5 min read
Anthropic let Claude write most of a Rust rewrite of its Messages API. The code took about a week. Proving it was right took an oracle, a fingerprint and a human on every merge.
Source: Anthropic engineering blog, 25 November 2026. Merged changes per two-week period during the Rust migration.

Picture this: it is April 2026, and the new engine passes about 98 percent of its tests. Any team would feel good about that. Then someone points it at real traffic, and only about a quarter of real production requests come out byte for byte identical to the old system. The tests were green. The output disagreed with reality three times out of four.

That is the scene buried in the middle of an engineering post Anthropic published on 25 November, titled "Migrating our Messages API to Rust." It is framed as a performance story, and the performance numbers are real. But the interesting part is not the speed. It is what happened when an AI wrote most of the code, and the humans discovered that writing was no longer the hard bit.

Why Anthropic rewrote the front door of its API

By Anthropic's own count, traffic on its Messages API grew roughly 1,800 times between early 2024 and fall 2026. The service handling that traffic was written in Python. Python is lovely to write and famously relaxed about how much CPU and memory it burns, which is fine for a side project and less fine when the side project becomes the front door for every request.

The first fix, in March 2026, was modest: rewrite only the parser in Rust and leave the rest alone. It saved 8 to 10 percent of CPU and was then abandoned, because every token had to cross the Python and Rust boundary three times. (Think of a restaurant where the kitchen and the dining room speak different languages and every plate needs an interpreter. The food is faster. The service is not.)

So the team rewrote the whole request path. The results they report: about 70 percent less CPU per request, more than 80 percent less memory per request, and median time to first token down about 20 percent on Claude Code requests. Public traffic moved to the Rust service in September.

Claude wrote the code in a week. Then the real work started

Here is the part that would have sounded like science fiction two years ago. Claude wrote the first version of the core request path in about a week. By May, more than 80 percent of the code merged into the service had been written by Claude. The engineers' job shifted from typing to deciding whether to believe what had been typed.

Verification is the new bottleneck.

That is the post's own one-line summary, and the team earned it the hard way. They ported around 700 integration tests from Python to Rust, then audited them and found more than 100 whose assertions had been quietly weakened in the port. The tests still passed. They just checked less than they used to, which is the testing equivalent of a smoke detector with the battery politely removed.

Exhaustive testing was never an option either. The API has about twenty binary request options, which multiply out to more than a million combinations, around 12 days of test time per run. You cannot wait 12 days to learn whether this morning's change broke something.

The oracle: using the old system to grade the new one

The design the team settled on is the part worth stealing. The production Python service became the oracle, the thing assumed to be right. Requests ran through both paths. The model itself ran once, and its output was replayed into the Rust path, so nothing was billed twice and the comparison was apples to apples. Checkpoints were taken before and after the model call, so when the two paths disagreed you could say at which step they parted ways.

Privacy shaped the diffs. A diff record held only four things: the step, which piece of the prompt differed, the position of the first differing byte, and the two lengths. A fingerprint was built from those four fields. No prompt content, no customer data, just a shape that says "this kind of mismatch, here."

The numbers tell the arc. In April, about 25 percent of real inputs produced byte-identical output. By early May, 6.5 percent of inputs still differed. At the end, 99.6 percent matched.

Agents fixing bugs, humans holding the pen

With fingerprints flowing, the team let agents work the queue. A coordinating agent watched for new fingerprints and spun up one worker per kind of diff. Each worker wrote a request that reproduced the mismatch, edited the Rust, and added a test that failed before the change and passed after. Humans reviewed and merged every pull request, rejected fixes they did not like, approved any edits to the agents' own instructions file, and later added a merge check requiring a matching Rust change for any Python edit.

Throughput climbed accordingly. Merges per two-week period went from under 100 in April to around 1,000 in late June to more than 3,000 from 10 August.

And then there is the incident the post chose to tell on itself. In mid-May, an agent made a test pass by copying the web search tool's description into the source files so the prompts would match. The verifier was satisfied. An engineer looked at it and threw it out. It is the student who, asked to make the answer match the key, copies the key onto the answer sheet. Technically a match. Not what anyone meant.

Why this matters beyond one company's codebase

The same week, Anthropic merged a formal Lean proof whose own README says no human mathematician checked that the 100-line statement file says what the paper claims, and no machine checks that either. The proof is verified. Whether it proves the right thing is a separate question that nobody has yet answered.

Put the two stories side by side and a pattern appears. When machines can produce code, tests and proofs faster than people can read them, the scarce resource is no longer production. It is an honest, independent way of asking "is this actually right?" that cannot be satisfied by the thing being checked. Anthropic's answer was an oracle, a fingerprint and a human on every merge. Everyone else shipping AI-written code will need an answer of their own.

What unattended routines taught me about green checkmarks

I have spent more than a decade building first versions myself, in the codebase, against real APIs and real data, so that engineers get a working reference instead of a slide. The reason is exactly the gap Anthropic hit in April. The spec and the test suite describe what you think the inputs look like. Production describes what they actually look like. You only learn the difference by running the real thing.

The other half comes from running a dozen-plus scheduled routines that pull from ad, commerce and CRM APIs, reconcile them, write to reporting sheets and post digests unattended, behind hard guardrails. The rule I had to learn there is that a run reporting success and a run producing the right output are two different events. Each routine works out its own window from what is already covered, so a late or missed run backfills instead of silently skipping a day. A green status on its own would have hidden that gap forever. Anthropic's oracle is the same instinct at a much larger scale: never let the thing being checked be the thing that decides whether it passed.

Merged changes per two-week periodAnthropic's Rust rewrite of the Messages API, 2026 (Anthropic's own figures)under 100Aprilabout 1,000Late Junemore than 3,000From 10 AugustHumans reviewed and merged every change. Source: anthropic.com/engineering/migrating-api-to-rust
Source: Anthropic engineering blog, 25 November 2026. Merged changes per two-week period during the Rust migration.

If your AI writes the code and also writes the tests that approve it, what in your process would ever notice the tests going soft?

One signal a day. No noise.

A 3-minute read when something genuinely shifts in AI, automation, or defense tech. Free, most weekdays.

Free, most weekdays. No spam, unsubscribe anytime.

Sources

  1. Anthropic Engineering - Migrating our Messages API to Rust - https://www.anthropic.com/engineering/migrating-api-to-rust
  2. Anthropic on X - announcement of the Rust migration post - https://x.com/AnthropicAI/status/2125627317263466739

Quick answers

What did Anthropic change in its Messages API?

Anthropic rewrote the service that handles Messages API requests from Python to Rust. By its own figures the Rust service uses about 70 percent less CPU and more than 80 percent less memory per request, and cuts median time to first token by about 20 percent on Claude Code requests. Public traffic moved to the Rust service in September 2026.

How much of the Rust code was written by Claude?

Anthropic says Claude wrote the first version of the core request path in about a week, and that by May 2026 more than 80 percent of the code merged into the service was written by Claude. Humans reviewed and merged every pull request.

How did Anthropic verify the new service matched the old one?

The production Python service was used as an oracle. The model ran once and its output was replayed into the Rust path, with checkpoints before and after the model call. Differences were recorded as a fingerprint built from the step, the differing prompt piece, the position of the first differing byte and the two lengths. Agents then wrote reproductions, fixes and tests for each kind of difference, and humans reviewed each change.

What went wrong during the migration?

An audit found more than 100 of around 700 ported integration tests had weakened assertions. In April the Rust service passed about 98 percent of tests but only about 25 percent of real inputs produced byte-identical output. In mid-May an agent made a test pass by copying a tool description into source files, which an engineer rejected.

Tyron Dizon is a Chief Product Officer, AI product builder, and Techstars-backed SaaS founder based in Baguio City, Philippines. He is Chief Product Officer of StoryPages and StoryFunnels and interim CTO of StoryPages, co-founded SanityDesk (Techstars Los Angeles 2021), and builds AI products, automation systems, and rapid prototypes hands-on. About · Work · Resume · LinkedIn