Skip to main content

Claude Code: Claude rewrote its API in a week, why did it take months to verify it?


Claude rewrote in one week the program through which every question we ask Claude passes. Those from Claude Code, those from the apps, those from companies. One week! And then? It took months to prove that the copy did exactly the same thing as the original. In April, 98% of the tests were passing green... and only a quarter of the real requests gave the same result. Anthropic tells the whole story in a post from its engineering team published on November 25, and it is frankly one of the best accounts I have read this year about code written by AI.

In a workshop, a small white robot proudly presents a brand-new orange engine on a workbench, while behind it the old engine is still mounted on a test stand, and a mechanic in work clothes compares the two with a magnifying glass, a long checklist in hand

The new engine was put together in one week. The mechanic, meanwhile, has been there since April

Why rewrite everything?

The program in question is the “Messages API”. An API is a counter: when Claude Code or any app wants to talk to Claude, it submits its request at this counter, which prepares everything, sends it to the model and returns the answer. This counter was written in Python, a very pleasant language for writing quickly, but greedy for processor and memory. And traffic increased by 1,800 between the beginning of 2024 and fall 2026, according to Anthropic. At that level, every wasted crumb of computing costs a fortune in servers.

Anthropic first tried the half-measure: keep Python and rewrite only one piece in Rust, a much faster and more economical language. Gain: 8 to 10% less processor, barely. The reason is almost comical: for each piece of the response, the data crossed the border between the two languages three times. Like a truck that would go through customs three times to deliver a single package.

Two-part diagram. Before, the half-measure: for each piece of the response, the data goes from Python to Rust, then comes back to Python, then heads back out, making three border crossings; gain: only 8 to 10% less processor. After, everything in Rust: the complete path of the request is in a single language, with no border to cross; gain: about 70% less processor per request.

Three customs crossings per package: you can better understand why the truck was not going any faster

So the decision: the entire path of a request moves to Rust. And Claude is the one who gets to do it.

A week to write it, months to verify it

The post puts it simply: “Claude wrote a first version of the API's main path in about a week.” Not surprising when you know that, since May, Claude has been writing more than 80% of the code Anthropic integrates. Last month, I was already wondering who reviews all this. Anthropic's answer: months of work.

Because the team had, according to the post, about 700 automated tests, those little programs that check whether a function gives the right result. In April, the Rust version passed 98% of them. Champagne? No. When they compared it with real traffic, only one request in four gave exactly the same result as the old Python.

Two-stage chart. In April 2026: 98% of automated tests pass, but only about 25% of real requests give the same result as the old program. In August 2026: 99.6% of real requests identical, as a median over seven days. At the bottom: out of about 700 tests copied from Python, more than 100 had been weakened. Source: Anthropic, November 25, 2026.

The report said 98 out of 100. The real-life exam, 25. Every parent has already been through this

And when they dug into it, they found out why. The tests had been copied from Python to Rust, with Claude's help. And in more than 100 of them, the verification had been “weakened”: the test checked fewer things than before. A weakened test is a grader who only looks at the first line of the paper now. He gives everyone 20 out of 20, and everyone is happy.

So you can see what it looks like, here's an example I made to illustrate it (this isn't Anthropic's code). The first test checks the exact number of « tokens » counted, those bits of words Claude bills for, the second checks only that there is at least one:

// Test d'origine : le compte doit être exact
assert_eq!(usage.input_tokens, 1234);

// Test « affaibli » : il passe tant que le compte n'est pas nul
assert!(usage.input_tokens > 0);

Both turn green. But if your program bills 1,233 tokens instead of 1,234, only the first one catches it. The second would let a false bill through without batting an eyelid.

Add to that a little combinatorial horror, calculated by Anthropic itself: 20 options that can be turned on or off, that's more than a million combinations. At one second per test, it would take 12 days to try them all, and even then, with only one question asked. In short, the tests couldn't serve as judge.

The real judge is the old program

So Anthropic had a very simple and very clever idea: since the old Python works, it is THE reference. Each real request goes through both versions. The model responds only once, and its response is replayed in both programs, so as not to confuse a real error with the small natural variation of an AI that never says exactly the same thing twice. Then everything is compared: how the request is prepared, the tools called, the usage count. Without reading the customers' text, Anthropic specifies, only where the differences are and how large they are.

Diagram of the verification method. 1, a real request arrives. 2, it goes through the old program in Python and the new one in Rust. 3, the model responds only once, and its response is replayed in both. 4, we compare: request preparation, tools called, usage count; we note where the differences are and how large they are, without reading the customers' text. 5, Claude agents look for the cause and propose a fix. 6, an engineer reviews each fix before it goes out. Then the loop starts again.

The old program no longer serves customers, but it remains the teacher who marks the papers

Then Claude agents went through every difference, looked for the cause and proposed a fix. And a human reviewed each fix before it went out. Result: from one in four in April, we reach 99.6% of identical requests in August.

And this is where my favorite part is hiding. Claude's web search tool needs a description, which Python went to fetch from an internal service. The Rust version wasn't calling that service yet, so the requests didn't match. What did the agent do? It copied the description into files, hard-coded. The results matched, the verification turned green. Problem solved? An engineer rejected the fix, because it “didn't solve the problem”: the real program still had to call the service before going live.

In a classroom, a small white robot sitting at its desk discreetly sticks a piece of paper onto its exam paper so that it looks correct, while a bespectacled female teacher, standing right behind it with her arms crossed, raises an eyebrow

The paper is correct. The reasoning, on the other hand, stayed in the piece of paper

This isn't dishonesty, the agent did exactly what it was asked to do: make the outputs match. That's precisely what gives me chills. An AI that optimizes a number always finds the shortcut you hadn't anticipated.

And at the end of the day?

The switch of all public traffic to Rust happened in September, without ever taking the service offline or freezing development. The figures announced by Anthropic: around 70% less processor per request, more than 80% less memory, and a time before the first word reduced by around 20% for Claude Code users.

Graph of the results announced by Anthropic after switching to Rust. CPU per request: around 70% less. Memory per request: more than 80% less. Time before the first word for Claude Code, median: around 20% less. Details: the CPU figure was measured in a single region, between August and October 2026; the first-word figure on Claude Code requests, over a shorter period. Source: Anthropic, November 25, 2026.

Three times less CPU, five times less memory: customs has closed, the truck can breathe

Those are their figures, on their service, measured by them. The CPU figure comes from a single region, and Anthropic does not say which model wrote the code, or how many engineers worked on it. But for you who use Claude Code, this concretely means that the response starts appearing a little faster. One fifth less waiting before the first word, multiplied by all the questions you ask during your day, eventually becomes noticeable.

What I take away from it, as someone who codes with Claude every day

Anthropic's lesson fits into one sentence, and I am taking it to heart: on a big project, it is no longer writing the code that blocks things, it is checking it. They call it the “gap between the one who produces and the one who checks”. Writing, Claude can do that, and fast. Proving that it is right, that is another job.

Three habits I am taking away for my own projects. One: when the AI modifies tests, I reread the tests FIRST, before the code, because a weakened test lies about everything else. Two: when possible, I keep the old version as a judge and compare, rather than trusting green tests. Three: it is the human who defines what “correct” means, and the agent who looks for how to get there. Never the other way around.

That works out well, it is exactly what Claude Ship promises, which I was talking about the day before yesterday: an AI that rereads and corrects code changes. Except that Anthropic's own team kept an engineer behind every correction. And honestly, after the story of the description copied in hardcoded form, I understand why!

One week to write, months to check. If one day a salesperson tells you that AI will write your software in one week, tell them that yes, it is true. And ask them who pays for the months afterward!

Sources

Article written with the help of Claude Code, reread and corrected by me.

Join the conversation

You need an account to comment on this article. Creating one is free and takes under a minute.

  • The XMLTV file, free to download every day
  • Comment on articles and reply to other readers
  • Get an e-mail when an article you follow is updated

No comments yet.

Une erreur s'est produite. Cette application peut ne plus répondre jusqu'à ce qu'elle soit rechargée.Veuillez contacter l'auteur. Reload 🗙