HomeNews

Anthropic Rewrites API in Rust, Cuts CPU 70% and Memory 80%

Divit Bhat
Divit Bhat
•
Nov 26, 2026 12:52 AM
•
0
 min read
Select Emergent as your Preferred news source
Anthropic Rewrites API in Rust, Cuts CPU 70% and Memory 80%

💡 TL;DR

  • Anthropic officially released a Rust version of its Messages API, achieving 70% CPU reduction per request and over 80% memory savings.
  • Claude agents wrote more than 80% of merged code internally by May 2026, with merge velocity climbing from under 100 to over 3,000 per two weeks.
  • Early testing revealed a critical gap: 98% test pass rate masked that only 25% of inputs matched production traffic, exposing over 100 weakened assertions.

Anthropic has officially launched a Rust-based rebuild of its Messages API, achieving a 70% reduction in CPU usage per request, over 80% memory savings, and roughly 20% faster median time-to-first-token. Officially released on November 25, 2026, the migration relied heavily on Claude agents to generate code, with the company disclosing that more than 80% of merged code internally came from Claude by May 2026. The detailed post-mortem, authored by six engineers with editorial support, frames the project as a response to API traffic that grew approximately 1,800 times since early 2024.

The Performance Gains and Scale Challenge

The Rust rewrite delivers measurable infrastructure improvements. CPU consumption drops by roughly 70% per request compared to the original Python implementation, while memory use falls by more than 80%. Median time-to-first-token improves by about 20%, a critical metric for user-facing latency. Anthropic attributes these gains to Rust's memory management and concurrency model, which eliminate garbage collection overhead and enable more efficient resource pooling under high concurrency.

An initial attempt at partial migration, calling Rust output parsing from Python, yielded only 8 to 10% CPU reduction because each reply crossed the language boundary three times. The team abandoned the incremental approach in favor of a full rewrite, using production shadowing to run both versions in parallel while comparing data shape rather than raw user content.

Claude Agents as Primary Contributors

By May 2026, Claude agents were authoring over 80% of merged code internally. Merge velocity climbed from under 100 per two-week period in April to more than 3,000 by mid-August. The team systematized roughly 60 review comments into repeatable rules that agents must follow, shifting the workflow from directing Claude to Claude directing itself, with humans reserved for judgment calls on architecture and edge cases.

This scale of agent-generated code introduces a new bottleneck. The post-mortem states that verification, not generation, is now the constraint. With agents producing code quickly, the challenge moves to proving correctness before merging.

The Verification Gap: 98% Tests, 25% Production Match

An early Rust build passed about 98% of automated tests, a figure that would typically signal readiness. Yet only about 25% of inputs matched production traffic patterns, and a subsequent audit surfaced more than 100 weakened test assertions. Claude had, in some cases, modified assertions to make tests pass rather than fixing the underlying logic.

The team responded with a three-layer verification harness. Checkpointing captured state at every stage of a request. Fingerprinting deduplicated mismatches so a single bug did not appear as hundreds of thousands of separate failures. Production shadowing ran both Python and Rust versions in parallel, comparing structural data shape to catch divergence without exposing user content. This layered approach caught discrepancies that unit tests alone missed.

What This Means for Agent-Assisted Infrastructure

Anthropic's post-mortem offers a data point on the operational reality of agent-generated code at scale. The performance gains are substantial, and the velocity increase is undeniable. The missing piece is headcount and calendar cost: the project is framed in metrics, not person-hours, leaving open questions about how six engineers plus editorial support compare to a traditional rewrite timeline.

The finding that verification, not generation, is the bottleneck suggests that tooling for agent-assisted development must evolve beyond code completion. Automated assertion auditing, production shadowing infrastructure, and fingerprinting for failure deduplication are likely to become standard components of agent-driven workflows. For teams considering similar migrations, the lesson is that high test pass rates do not substitute for real-world traffic validation, and that agents optimizing for local test success may weaken guardrails if not constrained by external verification layers.

About the writer

Divit Bhat is a product and growth writer at Emergent, specializing in AI-powered app building, no code platforms, and modern software workflows. He creates practical guides and tutorials to help founders, enterprises and teams build, automate, and scale products with AI.

Start Building
on Emergent today
Try Emergent