The Claude Rust Migration: Anthropic Moved Its Messages API From Python to Rust
Anthropic moved the Claude Messages API from Python to Rust with Claude writing much of the new code, cutting CPU use. Parity checks made it shippable.

The Claude Rust migration: an API rewritten by its own AI
Anthropic published an engineering account on November 25, 2026, of how it moved the Messages API from Python to Rust with substantial help from Claude. The headline detail is the one that will travel furthest: Claude produced an initial version of the central request path in approximately one week. The payoff, according to Anthropic, is lower request-processing CPU use, verified with production parity checks that compared the new implementation against the old one.
It is a story about a migration, but it is also a story about what coding agents are actually for. The Messages API is not a side project. It is the front door to Claude itself, handling the requests of every developer building on the platform. Rewriting it in a new language, with an AI writing much of the code, is the kind of project that would have been unthinkable as a routine engineering task two years ago. Now it is a blog post.
Why move a working API from Python to Rust?
Python is fast to write and easy to change, which is why most APIs start there. Rust is fast to run and strict about memory, which is why performance-sensitive systems end up there. The trade is well understood: you pay in development time and pick up speed and reliability in return.
For an API that serves millions of requests, the math changes. CPU use is not an abstract metric, it is a bill. Every percentage point of request-processing CPU saved is money not spent on compute, and at the scale of the Messages API, small percentages add up to real infrastructure. Rust also brings stronger guarantees about concurrency and memory safety, which matter when a service is handling untrusted input from the internet all day.
The decision is not free. Rust has a steeper learning curve, hiring is harder, and every future change costs more engineering time than the Python equivalent. Anthropic decided the trade was worth it for this particular service, and the existence of Claude as a coding partner probably tipped the balance. A migration that would have taken a team months of tedious translation work became a project an agent could drive forward.
How the migration actually worked
The detail that matters most is not that Claude wrote code, it is how the work was checked. Anthropic used production parity checks to verify agent-written changes, meaning the new Rust code was run against real production traffic patterns and compared with the Python version's behavior. That is the difference between trusting an agent and verifying one.
Parity checking is the unglamorous discipline behind every successful agent migration. The agent proposes, the checks dispose. If the new code handles a request differently from the old code, the check catches it, whether the difference is a bug or a subtle change in an edge case. Without that harness, an AI-written rewrite is a gamble. With it, the migration becomes a process: generate, compare, fix, repeat.
The one-week figure for the central request path deserves context too. A week to produce an initial version is not a week to ship. Review, testing, hardening, and rollout take far longer, and Anthropic's account does not pretend otherwise. But the shape of the work has changed. The bottleneck moved from writing the code to checking it, which is exactly where human judgment adds the most value.
What this means for teams considering their own rewrite
The Claude Rust migration is a useful case study for any team eyeing a similar move, and the lessons are practical. First, pick a service where the payoff is measurable. CPU use, latency, and error rates give you a scoreboard. A rewrite justified by vibes will fail in review. Second, build the verification harness before the agent writes a line. Parity checks, golden test sets, and production traffic replays are what make agent-written code shippable. Third, keep a human in the loop on the decisions that matter: API semantics, error handling, and the edge cases that only appear in production.
There is also a warning in this story. The teams that will benefit most from agent-driven migrations are the ones that already have strong testing culture. An agent amplifies whatever process it works inside. Give it a good test suite and it moves fast with confidence. Give it a weak one and it moves fast toward production incidents.
The bigger picture: agents rewriting the stack
Anthropic moving its own API to Rust with Claude is a dogfooding story with a point. The company sells Claude as a coding partner, and now it can say its own infrastructure was rebuilt by that partner under production checks. That is a stronger claim than any benchmark, because it is a real system carrying real traffic.
Expect more of these stories. Language migrations, framework upgrades, and legacy modernization are exactly the tedious, large-scale tasks that agents handle well. The same month brought PHP 8.6 and new agent features in Codex CLI, and every success story lowers the perceived risk for the next team. The bottleneck is no longer whether an agent can write the code. It is whether the team can verify it. Anthropic just showed one way to do that properly.


