AI News | 3 min read

Anthropic Rewrote Claude's Messages API in Rust, Cutting CPU Usage 70% and Memory 80%

Anthropic migrated its Messages API from Python to Rust using Claude agents — cutting CPU usage 70%, memory 80%, and median time-to-first-token by 20%. Over 80% of the code was written by Claude.

Hector Herrera
Hector Herrera
A newsroom related to an AI safety company Rewrote an AI assistant's Messages API
Why this matters Anthropic migrated its Messages API from Python to Rust using Claude agents — cutting CPU usage 70%, memory 80%, and median time-to-first-token by 20%. Over 80% of the code was written by Claude.

Anthropic has rewritten the core Python service that routes every Claude conversation into Rust — and the performance numbers are striking: 70% less CPU per request, 80%+ less memory, and about 20% faster time-to-first-token. The company also disclosed that more than 80% of the internally merged code was written by Claude itself.

What Happened

Anthropic migrated its Messages API — the layer that sits between every developer's API call and Claude's inference stack — from Python to Rust, a systems programming language known for speed, low memory overhead, and memory safety guarantees. According to TechRepublic's report, the team that did it had no prior Rust experience before the project began.

That last detail matters. Anthropic used Claude agents to write the bulk of the migration code — with over 80% of internally merged commits already coming from Claude by mid-2026, the company says.

The Numbers

The performance improvements reported by Anthropic:

  • CPU usage per request: down ~70%
  • Memory usage per request: down more than 80%
  • Median time-to-first-token (TTFT): down ~20%

Time-to-first-token is the latency between sending a request and receiving the first character of a response — a critical metric for applications where users are waiting in real time, like chat interfaces and coding assistants.

Why Python Was the Starting Point

Python dominates AI and ML infrastructure because it's the language most researchers and ML engineers know. Anthropic's original API layer almost certainly started as Python for speed of development. As Claude usage scaled — Anthropic has not disclosed exact API call volumes, but the company's valuation crossed $61 billion earlier in 2026 — the inefficiencies of an interpreted language under high concurrency become expensive, both in latency and in cloud compute costs.

Rust's compiled, zero-overhead model eliminates entire categories of runtime cost. It doesn't have a garbage collector, so memory management is deterministic. For a hot path that runs on every single API call, that profile is worth the rewrite cost.

The Meta-Story: Claude Wrote Most of It

The more significant disclosure may be the AI-generated code figure. Anthropic says that by mid-2026, more than 80% of the code being merged internally had been written by Claude. The Rust migration is a concrete example of that at scale.

The team had no prior Rust experience. That means Claude was not just autocompleting familiar patterns — it was generating non-trivial systems code in a language the developers were learning alongside the model's output. The fact that the migration shipped and produced the performance gains it did suggests the output was production-quality, not just plausible-looking code.

This is a proof-of-concept for AI-assisted migration projects — the kind enterprises have been asking about for years. Rewriting a performance-critical service in a faster language used to require specialized engineers and months of institutional knowledge transfer. If a small team with no Rust background can do it with AI assistance, the barrier drops significantly.

What It Means for Developers

For developers building on the Claude API, the 20% reduction in median TTFT is a direct UX improvement — no code changes required. Faster first tokens mean snappier interfaces.

The CPU and memory reductions matter differently: they affect Anthropic's infrastructure costs, which over time can influence pricing. More efficient compute per request gives Anthropic more headroom to lower prices or absorb increased usage without raising them.

What to Watch

Whether Anthropic publishes a technical post-mortem on the migration would be worth tracking — the specifics of how Claude agents were structured, reviewed, and tested would be valuable signal for teams planning similar projects. The 80%-AI-generated-code figure is also likely to draw scrutiny about how that code was validated before it hit production on a service handling every Claude API call in the world.

Sources: TechRepublic

Key Takeaways

  • ✓ CPU usage per request:
  • ✓ Memory usage per request:
  • ✓ Median time-to-first-token (TTFT):
  • ✓ This is a proof-of-concept for AI-assisted migration projects

Did this help you understand AI better?

Your feedback helps us write more useful content.

Hector Herrera

Written by

Hector Herrera

Hector Herrera is an AI systems architect in Houston and founder of Hex AI Systems. He designs and runs AI systems in production and writes daily about how AI is reshaping business, government and everyday life. 20+ years building for the web. Houston, TX.

More from Hector →

Get tomorrow's AI briefing

Join readers who start their day with NexChron. Free, daily, no spam.

More from NexChron