---
title: "Anthropic’s Rust migration cut Claude Messages API CPU use by about 70%"
description: "How Anthropic tested the Claude Messages API migration to Rust, and what its reported 70% CPU and 20% first-token improvements actually measure."
url: "https://promptszone.com/anthropic-claude-messages-api-rust-migration"
published: "2026-11-27T00:06:02Z"
categories: ["AI News"]
---

# Anthropic’s Rust migration cut Claude Messages API CPU use by about 70%

Anthropic reports about 70% less CPU per request and a 20% lower median wait for the first token on Claude Code. Here’s how it checked the Rust rewrite.

![Anthropic’s reported Rust migration results: about 70% less CPU per request in one region and about 20% lower median time to first token on Claude Code requests.](https://promptszone.com/assets/uploads/5c7b4288be42616369e885d034061968.jpg)

**Summary:**

Anthropic compared Python and Rust on live traffic without running Claude twice, then used the differences to guide fixes before switching the Messages API over.

Anthropic moved the Claude Messages API from Python to Rust. In a [November 25 engineering retrospective](https://www.anthropic.com/research/migrating-api-to-rust), the company reported about 70% less CPU per request and about a 20% reduction in median time to first token. The migration was already in production: Anthropic says it began moving public traffic to Rust in September without taking the service offline.

This was a rewrite of the service around the model, not a release of a faster Claude model. The Messages API validates requests, assembles prompts, streams different parts of the reply and counts usage. All that work happens around the model call, and it matters more as traffic grows. Anthropic puts growth on its own platform, including internal use, at roughly 1,800-fold from early 2024 to fall 2026.

## Why passing the tests wasn’t enough

Anthropic says the Rust version passed about 98% of its integration tests in April, yet only about a quarter of the production inputs it compared matched the Python service. For example, the two versions could encode an emoji in a tool call differently. Both requests might appear to work, but they could send different bytes to Claude and get different answers. The two percentages measure different things: test cases passed versus observed inputs matched.

Running Claude twice wouldn’t solve that problem. A model can return different answers to identical inputs, and the shadow copy shouldn’t add a second charge. Anthropic ran the model once and replayed the same output to the Rust service, then compared intermediate steps before and after the model call.

## How agents and engineers split the work

Instead of sharing customer prompts and responses with debugging agents, Anthropic recorded where the versions first diverged and how the lengths differed. Agents used those clues to build synthetic examples, test fixes against both implementations and propose regression tests. Engineers reviewed the changes before they moved into a slower round of checks on shadowed production traffic.

That review could catch a fix that passed a comparison but wasn’t suitable for production. In one example, an agent copied a tool description into local files so the outputs matched. An engineer rejected it because the production service still needed to fetch the description from its original service. Matching output was useful evidence, but it didn’t settle whether a fix belonged in the codebase.

## What the performance numbers measure

- **About 70% less CPU per request:** Anthropic’s Figure 15 shows seven-day averages in one region during the migration.
- **About 20% lower median time to first token:** the latency panel tracks customers’ Claude Code requests over a shorter window. It measures the wait before a reply starts, not the time to finish generating it.

For an engineering team planning a similar migration, the useful idea is to check the old and new services at the boundaries that matter to users: the request the model sees, the events the client receives and the usage that gets counted. If the underlying model can vary its answer, replaying one response makes the comparison about the service rather than the model.

Related: [Claude Fable 5.2 access and benchmark comparisons](https://promptszone.com/claude-fable-5-2-release-pricing-benchmark-comparison).

## Source and image credit

[Anthropic Engineering, “Migrating our Messages API to Rust”](https://www.anthropic.com/research/migrating-api-to-rust), especially Figures 6 and 15. The featured image is an original PromptsZone chart based on the two reported changes in Figure 15.
