Anthropic Moves Messages API From Python to Rust, Cutting CPU Use by About 70%
Anthropic published an engineering blog post on November 25 on moving its Messages API from Python to Rust; the new version uses about 70% less CPU per request and cuts median time to first token by about 20%, with public traffic moved in September.

What happened
The Messages API was built in 2023 as a simple Python request forwarder, and is the primary way customers — as well as Anthropic's own apps such as Claude Code and Cowork — reach Claude. From early 2024 to fall 2026, API traffic grew roughly 1,800 times, with every request passing through validation, prompt conversion, tokenization and safety classifiers, driving up the cost of the Python version.
Claude wrote a first version of the API's core request path in about a week; by May 2026, Claude was writing more than 80% of the code Anthropic merged, so falling generation costs made a full rewrite possible. The team first tried rewriting only the model-output parsing in Rust, which cut CPU use by only about 8–10% while making each token cross between the two languages three times, failing to justify the added complexity.
The hard part of the migration was verification, not generation: the Python version kept changing during the migration, Claude's replies to the same request are nondeterministic, and the team could not read customer requests. The team turned the production Messages API itself into a verifier, running both versions on shadow traffic, comparing differences item by item, and dispatching Claude agents to fix them; public traffic moved to Rust in September, without ever taking the service offline or freezing feature development.
Key facts
- The new version uses about 80% less memory, : alongside about 70% less CPU per request and about 20% faster median time to first token.
- The 700 existing integration tests were not enough to verify the migration, : as some were coupled to the Python implementation and passed incorrectly.
- The team discussed migration languages internally in 2024, : when one engineer flatly ruled out rewriting the API in Go or Rust.
- Shadow-traffic comparison shares no customer content, : with difference records describing only what differed and where.
Why it matters
Claude wrote the core path in about a week, but proving the old and new versions behave the same was the real engineering work, shadow-traffic verification became the migration method, and once generation gets cheap, verification becomes the bottleneck.
CompaniesAnthropic
Grab todayAdobe Creative Cloud Pro: 57% off first yearHIMIAO Picks →Follow HIMIAO Horizon
No sign-up · Unsubscribe any timeNotifications
A ping on your phone or computer when the brief is out. No email needed.
Comments
Related
- Nov 1Trojanized Claude Code Extension Hit Cursor's Marketplace, Affecting Up to 5,000 Developers
- Nov 25Anthropic Launches Skills over MCP So Servers Can Send Claude a Playbook
- Nov 25Claude Turns Artifacts Into Desktop Apps for Mac and Windows
- Nov 24Anthropic Launches Claude Ship: AI Agents Review, Fix and Approve Code
- Nov 15Anthropic Launches Claude Meetings: Claude Joins Google Meet Calls and Works Live
Today
Nov 28 Saturday- BriefNVIDIA Opens Image Model Weights: 30B Parameters, 3B Active per Token
10 stories · Nov 27
- GitHubGitHub Weekly Vol.7: 7 Projects Worth a Look This Week
Tested or read — weeklyAll →
- Quiz
- Call
Latest news
All →- Nov 27Sand.ai Launches MAGI-2: 30-Second 1080p Video With Synced Sound
- Nov 27Photonic Chips Run AI: Q.ANT Pilots in IONOS Data Centers
- Nov 27NVIDIA Opens Image Model Weights: 30B Parameters, 3B Active per Token
- Nov 27Meta Declines Joint FCA Test of Muse
- Nov 27Probe Says Novita, StreamLake Route Requests to ByteDance's Ark
- Nov 27Ant Releases Ling-3.2-air Weights: 124B Parameters Under MIT License
™