Anthropic Rewrites Its Messages API in Rust, Cuts CPU Use 70%
Claude wrote most of the new code itself, but the company says verification took months and was the actual hard part of the migration.
Anthropic published an engineering post on November 25 detailing how it moved the Messages API, the endpoint that carries every customer request to Claude, from Python to Rust. According to Anthropic's engineering report reviewed by TechRepublic, the new service uses about 70% less CPU per request and more than 80% less memory per request across production.
The number to hold onto: this is the layer around the model, not the model itself. The savings are real but scoped. Anthropic isn't claiming it cut the cost of running inference on Claude. It cut the cost of handling the HTTP plumbing that wraps those calls.
The team tried a partial approach first. According to Anthropic's engineering post, in March 2026 engineers ported only the response parser to Rust. That brought CPU down by roughly 8% to 10%, but each output token was then crossing the Python-to-Rust boundary three times, which largely canceled the gains. The team concluded that a full rewrite was the only path to meaningful savings.
Here's the detail that changes how you read the headline: the team that started the project had no Rust developers. Claude wrote the first version of the API's core request path in about a week, according to the engineering post as reported by TechRepublic. By May 2026, Claude was writing more than 80% of the code Anthropic merged across the entire company.
But code generation wasn't the bottleneck. As Anthropic put it in its own write-up, "Verification, not generation, had become the bottleneck." Engineers ran the Rust service in shadow mode alongside the live Python service, comparing outputs. According to the terminal.space analysis of Anthropic's post, the Rust service matched Python on 99.6% of shadowed inputs at cutover, up from about 6.5% in early May 2026. That gap, from 6.5% to 99.6% parity, is where the months went.
Public traffic fully moved to the Rust service in September 2026, two months before Anthropic published the write-up. The November post also reports that median time to first token fell by about 20% on Claude Code requests, which is the latency metric developers building on the API actually feel.
One honest caveat in the coverage, flagged by The Terminal, is that an October podcast appearance by two Anthropic engineers put the CPU savings at 40% to 50%. The November post's figure of 70% hasn't been fully reconciled with that earlier number. Anthropic's post says its measurements are from one region over seven-day averages. That's a narrower lens than global production, and the company hasn't published a dollar figure for the savings.
The architectural choice here is straightforward: Rust removes garbage collection overhead, and that matters a lot when you're handling high-concurrency request traffic at the scale Anthropic runs. Python's GC introduces unpredictable pauses. Rust doesn't. The tradeoff is that Rust is harder to write correctly, which is exactly why the verification problem dominated the project timeline.
What's worth watching is whether this becomes a template. Anthropic demonstrated that an AI-assisted Python-to-Rust migration is achievable at the API-layer without taking the service offline. The process, shadow traffic comparison over months until parity, is the same one any team would use for a critical path rewrite. Claude accelerated the generation side. It didn't skip the testing side. That's a usable data point for any infrastructure team eyeing a similar move.
Sources cited:
- Anthropic engineering post, reported by TechRepublic (https://www.techrepublic.com/article/news-anthropic-claude-messages-api-rust-migration/)
- The Terminal (theterminal.space) (https://theterminal.space/software/anthropic-messages-api-rust-70-percent-cpu)
- Mixed News (https://mixed-news.com/en/anthropic-claude-messages-api-rust-rewrite-cpu-memory-savings/)
- DEV Community (Max Quimby) (https://dev.to/max_quimby/anthropics-agents-rewrote-its-messages-api-in-rust-kd2)
This release was originally distributed via ETL Newswire. Visit Anthropic engineering post, reported by TechRepublic for the full story, related releases, and contact information.
Visit Anthropic engineering post, reported by TechRepublic →