On November 25, 2026 Anthropic published how it migrated its Messages API, the API behind Claude, Claude Code and Cowork, to Rust. It is a detailed public account of a large backend rewrite, so this series uses it as the anchor. Part 1 covers why teams pick Rust for a backend and what Anthropic got. Part 2 is how we build and migrate one. Every figure comes from the sources at the bottom.
TL;DR
- Rust has no garbage collector, its ownership model guarantees memory safety, and many concurrency errors become compile-time errors.
- Anthropic's Rust Messages API uses about 70% less CPU per request, and median time to first token fell about 20%.
- Its first, smaller step, moving only output parsing to Rust, saved just 8–10% CPU. The full rewrite is what paid.
- Memory-safety bugs were about 70% of Microsoft's CVEs (2019). In Android their share fell from 76% to 24% as Google moved to memory-safe languages.
- The costs are real: slow compiles, a learning curve and, on our reading of Stack Overflow's 2025 usage figures, fewer Rust developers to hire.
What Anthropic did, and why
Anthropic built the Messages API in Python in 2023. From early 2024 to fall 2026 its traffic grew about 1,800 times. In March 2026 the team tried the gentle route: keep Python and let Rust parse the model's output. CPU fell only 8–10%, because each token crossed the Python–Rust boundary three times. So they went further. In the new design Python hands the request over and Rust does everything around the model. Public traffic moved in September 2026.
Anthropic says Claude wrote the first core request path in about a week, and more than 80% of the merged code by May 2026. The hard part was proving the new API behaved exactly like the old one. In their words: "Verification, not generation, had become the bottleneck." Part 2 covers how they checked it.
- CPU per request
- ~70% lessRust vs the Python API
- Median time to first token
- ~20% lowerwhat users feel as speed
- Memory per request
- >80% lessper Anthropic's charts, Aug to Oct 2026
- Traffic growth
- ~1,800xearly 2024 to fall 2026
From Anthropic's post of Nov 25, 2026.
Why teams pick Rust for a backend
- No garbage collector: rust-lang.org calls Rust "blazingly fast and memory-efficient: with no runtime or garbage collector". No collector means no collector pauses.
- Memory safety anyway: the Rust Book says ownership "enables Rust to make memory safety guarantees without needing a garbage collector".
- Concurrency bugs at compile time: "many concurrency errors are compile-time errors in Rust rather than runtime errors". A server runs many requests at once, which is where those bugs hide.
- Abstractions that cost nothing: in the Book's benchmark, a hand-written loop ran at 19,620,300 ns per iteration and the iterator version at 19,234,900 — the high-level version was no slower.
- One tool: Cargo handles dependencies, builds and packages from crates.io.
Memory safety is a security number
In 2019 Microsoft's security team said about 70% of the vulnerabilities it assigns a CVE each year are memory-safety issues. In 2024 Google reported that memory-safety bugs fell from 76% of Android vulnerabilities in 2019 to 24% in 2024, a drop it ties to the shift to memory-safe languages. US agencies push the same way: CISA's 2023 "The Case for Memory Safe Roadmaps" and a 2025 CISA and NSA guide to memory-safe languages.
To be fair, Go, Java, Python and Node.js already manage memory for you with a garbage collector or runtime. Rust's pitch against them is safety without that runtime cost. Against C and C++, it is safety itself.
Other teams running Rust in production
- Discord (2020): Go forced a garbage collection at least every 2 minutes, which caused latency spikes. The Rust version "had no latency spikes", and "Latency, CPU, and memory were all better in the Rust version." Fair context: that was Go in 2020. Go's guide says today's collector is "not fully stop-the-world and does most of its work concurrently".
- Cloudflare Pingora (2022): a Rust proxy serving more than 1 trillion requests a day, with about 70% less CPU and 67% less memory than Cloudflare's old service at the same load. For one major customer, connection reuse rose from 87.1% to 99.92%: 160x fewer new connections.
- AWS Firecracker (built in Rust from the start): the microVM manager boots in under 125 ms, adds under 5 MiB per VM and starts up to 150 microVMs per second per host.
Rust vs Go, Node.js, Python and Java
| Language | What the docs say | Our take for backends |
|---|---|---|
| Rust | No runtime or garbage collector; many concurrency errors caught at compile time | Hot paths, high-traffic and latency-sensitive services |
| Go | Garbage collector that does most of its work concurrently | Fine for most network services; profile before switching |
| Node.js | One event loop plus a pool of k Workers; don't block the loop | Good for I/O-heavy APIs; move CPU-heavy pieces out |
| Python | The GIL runs one thread's bytecode at a time; since 3.13 it can be disabled with a free-threaded build | Good for most product APIs; hot loops are where Rust helps |
| Java | Not compared here: no Java source in this post | Mature for large services; no figures compared here |
The honest downsides
- Slow builds: in Rust's 2025 compiler survey (more than 3,700 responses), about 45% of former Rust users cite long compile times, 55% wait over 10 seconds for a rebuild, and average satisfaction is 6 out of 10.
- A learning curve: at Google, more than two thirds of developers felt confident contributing within two months. A third felt as productive within two months, over half within four. Slow builds were the top challenge; on the upside, 85% were confident their Rust code is correct.
- A smaller talent pool: Stack Overflow's 2025 survey ranks Rust most admired at 72%, but only 14.8% of respondents use it, against 57.9% for Python, 66% for JavaScript and 16.4% for Go. Our inference: fewer experienced Rust developers, so plan for training.
So Rust earns its place when a backend is hot: high traffic, CPU-bound, latency-sensitive or security-critical. Part 2 covers how we build one, how we'd migrate yours, and when we'd tell you not to.
The whole series
- Part 1: Why Rust, and what Anthropic's migration shows (this post)
- Part 2: How we build and migrate a backend in Rust
