Anthropic Rebuilt the Claude API in Rust and Cut CPU Use by 70%

Anthropic Rebuilt the Claude API in Rust and Cut CPU Use by 70%

Every request to Claude now passes through Rust. Anthropic has rebuilt its Messages API — the service behind the Claude API, Claude Code and Cowork — replacing Python with Rust while keeping the service online and shipping new features throughout.

Why Python stopped scaling

Between early 2024 and fall 2026, API traffic grew roughly 1,800-fold. Each request must be validated, converted into a prompt, tokenized and screened by safety classifiers before the response streams back — work that Python handled at growing cost.

A partial fix, calling Rust parsing code from Python, saved only 8–10% of CPU and forced every token across the language boundary three times. That was not enough, so the team rewrote the whole service.

Verification was the hard part

Claude wrote the first version of the core request path in about a week. Proving the new system behaved exactly like the old one took months. The existing 700 integration tests were incomplete and tied to Python internals, and an audit found more than 100 checks that had quietly become easier to pass.

The team therefore ran live traffic through both systems, compared the outputs step by step, and used agent loops to fix every mismatch they found.

What users gain

  • About 70% less CPU per request
  • Over 80% less memory per request
  • Median time to first token down about 20% on Claude Code traffic

Public traffic moved to the Rust service in September 2026. By May 2026, Claude already wrote more than 80% of the code Anthropic merged, so the bottleneck was no longer writing code — it was trusting it. For teams planning similar rewrites, the lesson is clear: test against real traffic, not just unit tests.

© Copyright Notice
THE END
Enjoyed this article? Support the author.
Likes9 Share
Comments Be the First to Comment

Please log in to comment

    No comments yet