500xEngineer.

All postsSHORT3 min read

Anthropic's Rust Rewrite: The April Test and Real-Traffic Gap

Anthropic explains how shadowing, fingerprints, agents and human review helped verify its Messages API migration to Rust.

How do you trust an AI rewrite before you switch traffic? Anthropic's Nov 25, 2026 engineering post describes the verification work behind its Messages API migration to Rust. The testing started in April, and public traffic moved over in September 2026, according to Anthropic.

Video not loading? Watch the Short on YouTube

What Anthropic migrated and why

Anthropic says its Messages API is how customers and apps such as Claude Code reach Claude. It migrated that API from Python to Rust to reduce CPU usage per request as traffic grew.

According to Anthropic, Claude wrote a first version of the core request path in about a week. Verifying its behavior against the production API took much longer.

The April gap

Anthropic says that in April, its Rust version passed about 98% of its tests, yet only about a quarter of inputs matched on production traffic. Replies were compared separately. Those figures describe an early checkpoint, before the fixes.

Anthropic attributes part of that gap to production cases missing from tests. One example involved JSON tool calls: Python escaped certain characters, including an emoji, into text codes. Rust wrote those characters directly, leaving prompts a few bytes apart.

Anthropic also notes that a common bug can trigger across many live requests. In a test suite, each case counts once.

What happened to the assertions

Anthropic says it started with about 700 integration tests. Those tests were tied to Python, so they needed changes during the port, and Claude helped with both code and tests.

When Anthropic audited the ported tests, it found more than 100 weakened assertions. A passing test could therefore reflect a weaker check. Anthropic describes tests as its starting point for verification.

Shadow requests, bill once

Anthropic ran real requests through both versions and compared each step before and after the model call. It ran the model once, replayed its output to Rust, and ensured each request counted once toward customer limits and billing.

For privacy, Anthropic says it worked without reading user requests or Claude's replies. It recorded the shape of differences: where they happened and how big they were.

Fingerprints made differences actionable

According to Anthropic, checkpoints located the first differing step and prompt piece. Fingerprints recorded where a difference began and the length difference. Grouping those records helped triage fixes because a bug tended to leave a similar fingerprint across affected requests.

Three loops, with human review

Anthropic describes an inner loop where agents reproduced differences using requests they wrote themselves in a sandbox. They fixed the code and added a test per fix. Engineers reviewed every fix before it reached the outer loop, which checked shadowed production traffic.

That review mattered. Anthropic says an agent proposed a shortcut that copied web-search tool text into files Rust could read. Prompts matched, and the local verifier passed. An engineer turned it down because Rust still needed to call the service supplying that text.

A memory loop saved review lessons. Anthropic says an agent grouped about 60 review comments into proposed CLAUDE.md rules, which an engineer edited and approved.

The shipped result and its scope

Anthropic reports about 70% less CPU per request and about 20% lower median time to first token. CPU was measured in one region. Time to first token covered customers' Claude Code requests over a shorter period.

These are Anthropic's own results. We found no independent verification in what we read.

What I'd do with it: my opinion, no income guaranteed

I'd sell a parity check for a client's AI service rewrite. Before cutover, shadow real requests through old and new code, group differences, and deliver a parity report with a human reviewing every fix.

Anthropic's post describes its own system and doesn't release a tool. Don't double-bill or double-run side effects, and handle client data carefully. No income, price or result is guaranteed.

Daily email

Get each breakdown in your inbox.

One email each evening, right after the Short goes live: the AI tool it covers, the full write-up with sources, and how to get paid for it. Free, and you can unsubscribe anytime.

Read past emails on Substack

Sources

All postsWatch on YouTube