Anthropic has rewritten the Claude Messages API, the endpoint most Claude integrations call, from Python to Rust. Katelyn Lesse, who leads engineering on the Claude Platform, and Angela Jiang, who leads product, described the work on the Latent Space podcast published on 27 October. The part that spread on social media is how it was done: Claude wrote the code, and the team proved it right by replaying real traffic.
Why they moved
In the episode transcript, the Messages API of about a year ago is described as “a Python monolith” running in a single Google Cloud region. Usage grew, the team went multi-region, and by early this year they expected to “hit a CPU wall”. The Python service, in their words, was “very CPU inefficient”.
They chose Rust even though, at the start, “we don’t have a single Rust developer in the room”. The episode adds that they have since hired a couple of people with more Rust experience, so the team is no longer Rust-free.
How the port worked
The division of labor they describe: “Claude is going to write the code. The humans design the system.” The two things that mattered most, they say, were the plan and the verification.
- A full fork. They built an entire copy of the API in Rust rather than migrating it one piece at a time.
- Shadow traffic. Real requests were also sent to the Rust system, and its outputs were compared with the Python system’s. Then they slowly turned the Rust system on.
- A pure port. The small team doing the work added no new features, while the rest of the API team kept shipping in Python. Static analysis flagged any new Python feature that had no Rust counterpart.
Without coding agents, they say, this would have been a multi-year, piece-by-piece migration.
The numbers, and how firm they are
Asked for results, the answer was explicitly a ballpark: CPU savings of “somewhere like 40 to 50 percent” and “somewhere between like 10 and 20 percent” better time to first token. They add that gains are higher on longer-running workloads, which “will roll out soon”. These are spoken estimates from the people who ran the project, not a published benchmark, and the episode names no crates, frameworks or code size. The next step they mention is re-architecture work, such as letting the API keep conversation state so clients do not have to resend the whole history.
It is a much larger production case than the agent-written Rust ports we have covered so far, such as pgrust, the agent-built Postgres rewrite. For API users, the visible changes this month were elsewhere, such as the 2026-10-21 API version that drops sampling parameters.
Why this matters
The reusable lesson is the verification setup, not the language: a complete fork, real traffic replayed through both versions, outputs diffed, a feature freeze during the port and a gradual switch-over. pgrust was an agent-built Rust rewrite done in the open; Anthropic’s account adds production shadow traffic as the check. The 40 to 50 percent CPU figure is a ballpark from the team, so measure your own service before promising similar savings.

The Campfire
CommentsThanks. Your comment is waiting for the desk. Once it is approved it appears here within about a minute.
Add a comment