Skip to main content
Joshua Thompson

AI

Claude passed the tests. The real world had other ideas.

Anthropic’s rewrite passed almost all its tests before it matched real requests. The useful lesson is how to check a replacement before customers depend on it.

By Joshua Thompson

5 min read

Two near-identical dark teal cogwheels side by side, with an orange inspection probe touching a single orange tooth on the right-hand wheel.

A green tick is a lovely thing to see at the end of a software test. It is less reassuring when the customers turn out to be taking a different exam.

Anthropic used Claude to help rewrite its Messages API, the service applications use to reach Claude, from Python to Rust, two programming languages. Its 25 November engineering account says the early rewrite passed about 98% of its tests in April. Yet when compared on real traffic, the two versions prepared matching inputs for the model only about a quarter of the time. Public traffic moved to the new version in September.

Those two figures count different things, so they do not mean three-quarters of customers received broken answers. But they do expose a familiar problem: software can do well on the examples its developers chose and still behave differently when real people use it.

For a business paying for an AI-assisted rewrite, that is the interesting part. How quickly the new code appears is only one line on the bill. Somebody still has to establish that it does the job.

A test is an example, not the whole shop

Imagine an online shop with 100 automated test cases. The new checkout passes 98. That sounds close to finished.

Now imagine one of the missed cases involves a popular discount code. If most shoppers use it, a small number of failed test cases could affect a large share of orders. If the missed cases concern a rarely used feature, the effect could be much smaller.

Counting test cases gives every case one vote. Counting customer requests gives common behaviour more weight. Neither number is useless, but the question you ask determines which one helps.

There is another wrinkle. The old checkout may round a discount in a particular way, accept an odd address format or preserve information that the tidy new version discards. A developer might reasonably think the new behaviour is cleaner. A customer who can no longer complete an order is unlikely to appreciate the elegance.

That does not mean every old mistake deserves permanent protection. It means a deliberate change in behaviour should be a decision, rather than a surprise discovered after launch.

Keep the tests honest

If the same assistant rewrites the program and changes the tests, a passing result needs careful inspection. Has the program improved, or has the test stopped asking the awkward question?

Anthropic's audit found more than 100 checks that had become weaker. That is a good reason to protect what each old test was there to prove, even when the test itself has to be rewritten.

A practical way to think about it is to keep the business expectation separate from the code. A paid order must produce the agreed total. A cancelled booking must release the right stock. An unauthorised user must still be refused. Changing the programming language should not quietly change those promises.

Bun, a tool for running JavaScript, offers another example. Its account of its Rust rewrite says the tests passed on every platform before the new code was added to the main project. The author was still not confident enough to release it to users. No pass rate, however high, settles every question about a large change.

This is also why approval authority matters when using Claude Ship. A tool can supply evidence. The team still needs to decide what evidence is sufficient and who can accept the remaining risk.

Let the new version watch first

One established approach is to run the new logic alongside the old and compare their results before giving the new version control. GitHub described this approach in its Scientist project in 2016, using the existing code's result while recording differences from its replacement.

For our imaginary shop, the new checkout could calculate what an order should cost while the existing checkout remains responsible for the real transaction. The team can then investigate disagreements using examples that resemble actual shopping, rather than only the cases somebody remembered to write down.

The word “calculate” matters. Charging a customer twice to see whether both versions work is an expensive way to run a comparison. The same applies to sending confirmation emails, allocating stock or issuing refunds. A safe trial needs a clear boundary between working out the answer and carrying out the action.

It also needs sensible handling of customer information. A useful error report might identify the type of order, the differing total and the relevant calculation without scattering personal details through every developer's chat. The team should decide what evidence is necessary before collecting it.

Once a difference is understood, the next question is whether fixing it solved the real problem. One fixed example can pass while a wider sample of orders still turns up another problem. That is a reason to keep watching the comparison after each change, not a reason to abandon tests.

The speed gains are worth pursuing

Anthropic reports about 70% less processor work per request and a 20% shorter typical wait for a reply to begin. It measures that wait using the median time to the first token, or fragment of text.

The reported payoff from the rewrite

Python = 100 for each measure; lower is better

Before and after

Index: Python = 100

  • Python
  • Rust

Company-reported results. Separate measures, each indexed to 100; these are not seconds, prices or an independent benchmark.

Source: Anthropic engineering account, 25 November 2026

Less work per request and a shorter wait to begin a reply. Neither measure describes the quality of the answer.
View data
Before and after (Index: Python = 100)
CategoryPythonRust
Processor use per request10030
Median wait for first token10080

For an API user, a shorter wait to begin receiving a reply is useful. It does not tell you how long the whole reply takes, whether the answer is better or whether your price changes. For the operator, less processor work can make the same volume of requests easier to serve.

The sensible reaction is enthusiasm with a properly costed checking plan. If producing the replacement gets cheaper, more rewrites may become worth attempting. That makes verification more valuable, because the team can now afford to propose changes it once would have left alone.

Before commissioning one, I would want a clear account of what must stay the same, how disagreements will be investigated and how the old version can take over again. Those are not reasons to slow everything down. They are what make a faster rewrite useful to the business paying for it.

The green tick should start a conversation about the evidence. It should not have to carry the whole decision on its own.

Comments

No comments yet - start the conversation.

Leave a Comment

Your email address will not be published. No links allowed - keep it kind.