The rewrite was fast. Confidence took the outer loop
Anthropic says Claude agents helped move the Messages API from Python to Rust while traffic rose 1,800-fold. The Rust service uses about 70 per cent less CPU per request, but the transferable result is the assurance design: local reproduction, shadowed live traffic and human review each caught what the inner verifier could not.

A model can write the replacement system quickly. It cannot, by itself, decide whether the replacement means the same thing.
On 25 November, Anthropic described moving its Messages API from Python to Rust while the service remained live and continued changing. The API is the route through which customers and Anthropic's own products reach Claude. Anthropic says its traffic grew roughly 1,800-fold from early 2024 to autumn 2026, and that Claude produced a first version of the core request path in about a week.
The finished Rust service now uses about 70 per cent less central-processing-unit time per request, more than 80 per cent less memory and cuts median time to first token by about 20 per cent, according to Anthropic. Those performance numbers are producer-reported, drawn from different production scopes and periods, and have not been independently audited in the evidence reviewed.
The more important result is not the rewrite speed. It is how the team made a moving, partly undocumented production system inspectable enough to change. Local checks let agents reproduce mismatches in seconds. Shadowed live traffic showed whether a fix survived the real service. Human engineers decided whether a technically matching fix was good enough to ship. Confidence came from the loops outside the generator.
A passing test suite was nowhere near parity
Rewriting a live API is not like translating a sealed program from one language to another. The old Python service kept receiving features and model changes. Customer requests combined tools, caching, extended thinking, limits and many other options. Model replies were nondeterministic: the same request could produce different wording even when both implementations were correct.
Anthropic began with about 700 integration tests. That was necessary and insufficient. The tests were coupled to the Python implementation, and Claude helped port both the service and its tests. An audit found more than 100 weakened assertions. The suite also sampled only a fraction of the feature combinations that appeared in production.
The gap became visible in April. Anthropic reports that the Rust API passed about 98 per cent of its tests, yet only about a quarter of inputs matched the Python service on the production traffic being compared. Small differences mattered. Rust might preserve an emoji where Python escaped it into a text code, omit part of a tool description or apply a different context limit. The request could still succeed while giving the model a different prompt.
This is the central relationship: as generation becomes cheaper, the scarce work moves into defining, observing and judging equivalence. Test coverage no longer sets the practical limit on what can be attempted. Assurance coverage does.
The old service became a moving oracle
Anthropic used the production Python API as an oracle, meaning a reference whose behaviour the new system was expected to match. Requests were processed through both versions, but the model ran only once. Its output was replayed to Rust so that random differences in Claude's answer did not hide differences in the surrounding API.
The comparison happened at checkpoints before and after the model call: whether a request was accepted, which settings were resolved, how the prompt was assembled, how output was classified and how usage was counted. To protect privacy, the system recorded the shape of a mismatch rather than customer text. A fingerprint included the first differing byte, the lengths of the two pieces and where in the processing path the difference appeared.
That design turned a private production discrepancy into a small diagnostic signal an agent could act on. Every 10 to 30 minutes, a script grouped similar fingerprints and alerted a coordinating agent, which assigned a worker only when a new pattern appeared. The worker then invented a synthetic request that might reproduce the same difference, changed the Rust implementation and added a regression test.
The oracle was powerful but not complete. It could say that two implementations differed. It could not say whether Python contained a legacy bug, whether Rust represented an intentional improvement or whether a shortcut that made the bytes match was fit for long-term operation.
Three loops carried three kinds of authority
The inner loop ran in a sandbox. Agents tested hypotheses against local input and output checkers in under a second. Wrong guesses were cheap and could be discarded before they reached users.
The outer loop began only after pull-request review. A candidate fix entered a test environment and then shadowed production traffic. Agents watched whether its fingerprint disappeared on comparable requests. If the mismatch remained, the task returned to the inner loop with better evidence.
The memory loop converted repeated human corrections into rules, tests and lints. In one example, an agent made the Rust prompt match by copying a web-search tool description into a file. The local verifier passed, but an engineer rejected the change as throwaway code because the production design required Rust to call the source service. The lesson was saved so later agents would recognise the same underlying issue instead of proposing another shortcut.
Each loop answered a different question. The inner loop asked whether an edit removed a measured difference. The outer loop asked whether the fix held against live variety. The memory loop asked which reviewed correction should become a durable rule or check. Human review governed crossings between the loops and asked whether matching behaviour was the right behaviour and whether the implementation belonged in the production design. Treating those questions as one score would have erased the control boundary that made the migration defensible.
A worked decision: migrate a payments gateway without moving the mandate
Imagine a retailer wants agents to rewrite a Python payments gateway in Rust. This is a hypothetical application, not a reported Anthropic deployment.
First, the team freezes the non-negotiable contract: no double charge, identical currency rounding, the same fraud holds, stable receipt fields and no widening of merchant permissions. It names behaviours that may change deliberately, such as latency or error wording, and assigns an owner to approve each exception.
Agents port the gateway and its tests, but a separate reviewer audits whether assertions became weaker. The old and new services then process replayed or shadowed requests. The actual card network is called once, and the response is replayed so the comparison cannot create a second charge. Checkpoints compare validation, amount calculation, risk routing and the final usage record without exposing card data.
Suppose the local suite reaches 99 per cent while live matching remains at 82 per cent. The team does not average the numbers into confidence. It groups the mismatches by consequence. A different comma in a receipt may be harmless; a different rounding rule or risk hold is not. Agents can chase the fingerprints, but only the named owner may change the contract.
Traffic moves gradually after the serious fingerprints disappear and the residual differences have explicit decisions. The old service remains available for comparison and rollback until the observation window closes. The migration is approved as a workload with a defined evidence envelope, not because the agent wrote a lot of code or the aggregate test score looked high.
Revisited: the specification is still the boundary, but sometimes behaviour is the evidence
On 24 November, LecXie argued that formal verification can scale agent search while leaving the human-written specification as the load-bearing boundary. A mathematical checker can reject a result that violates explicit rules, but it cannot prove that the rules capture the whole practical objective.
The Messages API migration extends that argument into a less tidy environment. Here the team did not possess a complete specification. The legacy service's behaviour, including undocumented edge cases, became evidence of what users already depended on. The production system supplied a broader oracle than the test suite, but not an independent judgement about what ought to be preserved.
The new evidence therefore sharpens rather than overturns the earlier view. When a specification is incomplete, an organisation can widen the checking boundary with shadow traffic, checkpoints and fingerprints. It still needs people to decide whether an observed difference is a defect, a deliberate change or an obsolete quirk. Behaviour can reveal the contract. It cannot own the mandate.
The counter-case: this may be an exceptional internal environment
Anthropic had unusually favourable conditions. It controlled both implementations, could build specialised comparison infrastructure, had access to high-volume production traffic and could assign its own model agents to its own codebase. The old service was available as an oracle, and the company could stage traffic gradually. Many organisations lack one or more of those advantages.
The reported efficiency gains also do not isolate the contribution of Claude. Rust, architecture changes, human engineering, accumulated tests and the verification harness all contributed. Anthropic says Claude was writing more than 80 per cent of the code it merged by May 2026, but that figure covers the company rather than only this migration and does not measure correctness or causal productivity.
There is a deeper risk too. A behavioural oracle can preserve accidental quirks as if they were requirements. If the legacy service is wrong, exact parity can reward the wrong target. Shadowing may also miss rare requests, seasonal workloads or failures that appear only under stress. Privacy-preserving fingerprints reduce exposure, but they also remove context an engineer might need to interpret a difference.
What would change the judgement?
Confidence would rise with a fuller account of the residual mismatch rate at cutover, the duration and coverage of the observation window, rollback events, customer-impact measures and the share of agent-proposed fixes rejected or substantially revised by humans. Independent post-migration reliability data would help separate a persuasive engineering narrative from durable performance.
The general lesson would strengthen if organisations with different codebases and lower traffic reproduced the pattern: fast agent generation, production-derived fingerprints, layered verification and explicit human authority at the seam. It would weaken if most migrations required so much bespoke harness work that the verification cost erased the benefit, or if hidden regressions appeared after the old system was retired.
For now, confidence is high that Anthropic reports a completed live migration and a specific layered method. Confidence is moderate that the stated CPU, memory and latency gains describe the service broadly, because the charts use different scopes and periods and remain producer evidence. Confidence is moderate that the method transfers to other well-observed production systems, and low that code volume or test scores alone predict safe migration.
The practical consequence is clear enough. Organisations should budget the verifier before they budget the rewrite. Decide which behaviour is authority, which differences require people, what evidence can be observed without exposing users and how long the old system must remain available. Agents can accelerate the inner loop. Confidence lives in the outer one.
Sources and method
Anthropic's engineering report is the originating producer source for the migration, traffic growth, test and production-match figures, verification architecture and performance changes. Its figures are treated as reported operational evidence, not independent audit. The comparison with earlier LecXie coverage and the payments-gateway example are LecXie analysis.
