Anthropic had a first version of its main API written in Rust after about a week of coding. In April, it passed roughly 98 percent of the tests. Against live traffic, however, it reproduced only about a quarter of the inputs that the existing Python service sent to Claude. The company moved public traffic over in September, after months of finding and fixing those differences. In its newly published account, Anthropic reports about 70 percent lower CPU use per request. Traffic through the service, including internal use, had grown roughly 1,800-fold between early 2024 and fall 2026. [1][2]
A developer waiting for Claude’s answer depends on both the model and the software handling the request. The API checks the request, assembles the input for Claude and keeps track of usage as the reply comes back. The model supplies the answer. The reported CPU saving belongs to the request-handling software. Anthropic leaves the dollar saving unspecified. Another provider estimating the value of a similar rewrite would need to know how much of its bill goes to request handling and how much goes to running the model. [1]
Why rewriting the parser was insufficient
The original service, written in 2023, had relatively little to do beyond forwarding requests and returning replies. By late 2025, it also had to tokenize prompts and run safety classification. On the way back it sorted the model’s output into distinct streams, including text and tool calls. Creating objects and passing work between tasks each carried a small overhead in Python. As traffic grew, those small costs added up. Python also tied the service to libraries maintained alongside Anthropic’s research and inference code, which had made staying with it attractive in the early years. [1]
Anthropic initially rewrote only the output parser. Calling that Rust code from Python cut API CPU use by roughly eight to ten percent, according to the report. Each token crossed the boundary between the two languages three times. The team judged the savings too small to justify the new complexity. A larger rewrite had become easier to contemplate as Claude took on more coding work. The team still had to work out how much engineering effort it would take to catch small changes in behavior before customers encountered them. [1]
What the test suite missed
About 700 integration tests gave the team a place to start. Many expected to find Python running inside the test process, with services such as billing simulated in memory. When Claude ported the service, it helped port the tests too. Engineers later audited the tests and found more than 100 assertions that had become weaker. When both a program and its tests change, the engineer signing off has to account for what happened to each. Did the new implementation satisfy the old requirement, or did the check get easier? [1]
The gap between the test results and the production comparison partly reflects what each counted. Each test contributes once to the suite’s pass rate. A common request can occur thousands of times in production, which gives a single recurring difference much more weight. Even valid text can be represented in different ways. The report describes a difference in how the two languages encoded some characters in JSON. A person could read the two prompts as equivalent even though their bytes differed. A model might still produce a reasonable answer, leaving the customer with no obvious error message to explain what had changed. [1]
Running every customer request through Claude twice would have introduced another problem. The model can give two different answers to identical input, and the customer should incur only one charge. Anthropic ran the model once, supplied the same output to both versions of the service and compared their handling of that output. On the input side the engineers checked successive stages, from accepting the request to constructing its prompt. They could find the first place the two services diverged without using the natural variation in a model’s answers as a measure of correctness. [1]
How engineers investigated without customer text
The people investigating could not inspect customers’ prompts or replies. Instead they recorded facts such as which part of the prompt differed, where the first different byte occurred and how long each version was. Repeated defects tended to leave similar measurements. By grouping those records, engineers could investigate a widespread problem once and then check which requests it affected. Engineers could follow the work in a shared channel and review proposed changes while the original customer text stayed out of the investigation. [1]
The team gave its coding agents a local copy of both implementations. An agent could create a synthetic input, see whether it produced the same kind of discrepancy and read the full output for the input it had written. The agents could compare inputs locally in under a second, since that check required no model call. A scripted reply could exercise the output path. Once an engineer reviewed a proposed change, a comparison against live traffic could reveal whether the original pattern had actually disappeared. Some changes that worked in local checks still left a difference in production. [1]
The original service kept changing as Anthropic released features. Engineers eventually introduced a merge check requiring a corresponding Rust change when someone altered the Python service, unless they requested an exemption. They also recorded review decisions that could prevent the same work from being done twice. In one case, an engineer’s instruction to check Python’s actual behavior led an agent to identify seven other places where the port had relied on an assumption. A human reviewer still had to decide whether a difference reflected an intentional product change or an error in the port. [1]
What customers might notice
Anthropic reports a reduction of about 20 percent in median time to first token as traffic shifted to Rust. That measures the wait before the response starts. It says little by itself about how long a large answer takes to finish. The report’s CPU series comes from one region, while its latency series covers customer Claude Code requests over a shorter interval. Its chart also shows latency falling before the measured transition, when most requests still ran through Python. A developer estimating the effect on a particular application would need to account for those differences in the measurements. [1]
For another infrastructure team considering a rewrite, the schedule shows how much work came after the first implementation. Anthropic kept shipping features and moved customers without an outage. Doing that meant paying engineers to maintain comparisons and review changes while both versions were alive. The core path took about a week to implement. Engineers then spent months running the two versions alongside each other before the CPU savings reached public traffic. [1]
Sources
[1] Anthropic Engineering’s account of the Messages API migration
[2] Anthropic’s announcement of the report
Have a correction or a useful perspective?
Get in touch with the publication.


