---
id: 18649
lang: en
title: "Anthropic Ported the Claude API from Python to Rust and Cut CPU Load by 70%"
published_at: "2026-11-29 18:30:15"
source_name: "X: @zhangwei379009"
source_url: "https://x.com/zhangwei379009/status/2126182082305249440"
canonical_url: "https://news.hamidun.com/en/news/18649"
categories: ["llm", "business"]
publisher: "AI News by Jemal Hamidun (news.hamidun.com)"
---

# Anthropic Ported the Claude API from Python to Rust and Cut CPU Load by 70%

> **Краткая суть (BLUF):** Anthropic rewrote the service that handles every Claude conversation from Python to Rust, and each request now uses about 70% less CPU time. Claude wrote the first working request path in about a week, and most of the effort went to verification: a copy of live traffic ran through both the old and new code, and each stage was compared.  The time to first token dropped by about 20%, and there was no downtime. For budgeting, plan for verification, not generation.

Anthropic replaced the service that receives every request to Claude. It was previously written in Python and now runs on Rust. According to the company, processing one request takes about 70% less CPU time, and the median time to first token, meaning the pause between sending a question and the first words of the reply appearing, dropped by about 20%. The service was not taken offline. For developers, the more interesting point is not the choice of language but where the effort went: the code was written quickly, and most of the work came down to proving that it behaves like the previous version.

## What exactly was done

The service sits in front of all conversations with the model, so any savings are multiplied across a huge stream of requests. If each request consumes 70% less CPU, then at the same load fewer servers are needed, or the same fleet can handle more traffic.

Claude itself wrote the first working request-handling path in the new service, and it took about a week. For a rewrite of this scale, that is a short timeline: usually just studying the behavior of the old system and reproducing it in another language stretches over months.

An important caveat: the figures come from Anthropic's own statement. The message contains no measurement methodology, no breakdown by request type, and no independent verification, so these are the vendor's numbers, not an external benchmark.

## How they checked that the new code didn't break existing behavior

The hardest part was confirming that the Rust version responds the same way as the Python version in all the situations that occur in real life, not just in tests. The team used a "shadow traffic" approach: live requests were still served by the old code, while copies were run in parallel through the new code. Results were compared at every stage of processing, not just at the output. Any discrepancy was treated as a signal of a bug, and agents that edited the new code were tasked with investigating these discrepancies.

Imagine moving a store's cash register to new software. Instead of switching off the old system in one day, you spend weeks running all the real receipts through both and checking the totals, discounts, and taxes line by line. Wherever the result diverges, you look for the cause. That is essentially what Anthropic did, only automated and on a live stream of requests.

The practical takeaway: in AI-assisted rewrites, the bottleneck is not code generation but verification. The model produces a working draft in days, but proving that it is equivalent to the old service is a separate, large job.

## What to take into your own projects

First, if you plan a migration involving AI agents, build the comparison infrastructure before you ask for code. Duplicating traffic, comparing results stage by stage, and automatically analyzing discrepancies give more confidence than dozens of manual reviews.

Second, when estimating a project, assume that most of the time and money will go to verification. A week for the first working path is the start of the work, not the end. A budget based only on how fast code gets written will be underestimated.

Third, the method has limits. Shadow traffic works well where requests can be safely duplicated. If a service sends emails, charges money, or writes to a database, the copied request must not perform those actions a second time, so the scheme has to be built more carefully. In addition, the comparison only catches discrepancies that show up on real traffic: rare scenarios may go unnoticed.

Finally, the 70% CPU saving should not be carried over to every project. The gain came from a heavily loaded service where a significant share of time goes to the overhead of the language and runtime. If your bottleneck is the network, a database, or external APIs, the improvement will be more modest.

But the scheme works: the model writes quickly, automated comparison keeps it in check, agents fix the differences they find, and people manage the process and decide when to switch traffic over.

---
- **Первоисточник:** [X: @zhangwei379009](https://x.com/zhangwei379009/status/2126182082305249440)
- **Каноническая ссылка:** https://news.hamidun.com/en/news/18649
- **Экосистема автора:** [Бесплатный интенсив по вайбкодингу — предзапись в Нике](https://t.me/vibecodeguidebot?start=agent_intensive_news_md) · [Nomad AI](https://nomadnet.ai) · [Telegram @jemal_hamidun](https://t.me/jemal_hamidun)
