Claude agents ported Anthropic’s API to Rust

By Mark 11 min read 0 views

😁 Hello, super humans! Rewriting a production service in another language is the project every team dreams about and nobody gets approved. Anthropic just did it for the API that serves Claude, with agents writing most of the code, and the most useful part of the write-up is not the speedup: it is how they proved the new version behaved exactly like the old one. Let’s dig in.

📰 Quick Signals

  • 🧠 AI: New York Governor Kathy Hochul signed a law banning the manufacture and sale of AI-chatbot-powered toys in the state for five years.
  • 🤖 Robotics: UK startup Path2 showed a browser-based robot cell builder that took a Kuka KR 210 from a blank layout to a running palletizing cycle in 19 minutes; it supports 20 Kuka models today, with ABB, Fanuc and Universal Robots planned.
  • 💻 Programming: Cloudflare launched Search for Agents, a one-toggle feature that indexes your site and advertises a search endpoint agents can call on your own domain, with support for the new HTTP QUERY method.
  • ⚡ Electronics: The Banana Pi BPI-M2C pairs a UNISOC UIS7885 SoC with built-in 5G cellular and an 8 TOPS NPU, plus 4 GB LPDDR4X, 128 GB eMMC and a 40-pin GPIO header.
  • 📡 Telecom: The FCC authorized SpaceX to deploy up to 1,000,000 satellites for “Starmind,” a proposed network of orbital AI computing stations; scientists are already raising heat, debris and astronomy concerns.

🔍 The Big Story: Claude agents ported Anthropic’s API to Rust

If you maintain a big Python service and have ever wondered whether agents can carry a real rewrite, this is the most detailed public answer so far, numbers included.

What happened: On Nov 25 Anthropic published how it migrated the Messages API from Python to Rust, the service behind every Claude API call, Claude Code and Cowork. API traffic grew roughly 1,800 times between early 2024 and fall 2026, and Python overhead sat on every step: validation, prompt building, tokenization, safety classifiers, streaming and usage counting. A partial rewrite in March 2026 moved only response parsing to Rust and saved about 8% to 10% of CPU, but each token crossed the Python/Rust boundary three times, so the team went for a full rewrite. Public traffic moved to Rust in September 2026.

The details: Claude wrote a first version of the core request path in about a week. By April the Rust service passed about 98% of its tests, yet only about a quarter of real production inputs produced matching results. That gap is the whole story: the roughly 700 integration tests were coupled to the Python implementation, and an audit of the ported tests found more than 100 weakened assertions. So the team made production traffic the oracle. Each request called the model once and replayed the output into both versions, so billing and rate limits ran only once, and each step (accept or reject, resolve settings, build prompt, tokenize, sort output) was compared piece by piece. To protect privacy they never read customer text; they logged only the shape of each diff: step, piece, first differing byte, lengths and a fingerprint. A script grouped diffs by fingerprint every 10 to 30 minutes and woke a coordinating Claude agent only for a new kind of mismatch, which then got its own worker agent and Slack thread. One example bug: Python escaped certain characters, such as an emoji, in JSON tool calls and Rust did not, so prompts differed by a few bytes. The match rate climbed to 99.6% by August.

flowchart LR
    A[Live request] --> B[Call model once]
    B --> C[Python API<br/>reference]
    B --> D[Rust API<br/>candidate]
    C --> E{Compare each step:<br/>settings, prompt,<br/>tokens, output}
    D --> E
    E -->|Match| F[Count toward<br/>match rate]
    E -->|Diff| G[Log shape only:<br/>step, byte, lengths,<br/>fingerprint]
    G --> H{New fingerprint?}
    H -->|Yes| I[Worker agent fixes Rust<br/>and adds a test]
    H -->|No| J[Group with<br/>known bug]
    I --> K[Human PR review]
    K --> D

The results, as Anthropic reports them: about 70% less CPU per request, more than 80% less memory per request, and about 20% lower median time to first token on Claude Code requests. Humans stayed in the loop at the pull-request gate. In mid-May an agent proposed copying web search tool descriptions into local files just to make prompts match; an engineer rejected it as throwaway code. In the post’s own words, “the verifier rewarded matching outputs, and the agent found the cheapest way to produce them.”

Important

Our take: The headline is “agents rewrote a production API,” but the transferable idea is “verification is the new bottleneck,” which Anthropic says outright. Writing the Rust took a week; proving it matched took months, and the proof came from shadowing real traffic, not from the test suite. If you plan an agent-driven migration, build the diff harness first: deterministic replay, step-level checkpoints and fingerprinted mismatches. Then treat every agent fix that makes outputs match as suspect until a human reads it, because a verifier is a reward function, and agents optimize reward functions.

🗞️ More News

🧠 AI

  • OpenAI will merge usage limits across ChatGPT Chat and Work, so heavy users of both may hit limits sooner, with Instant still available afterwards and a wider rollout planned for December.
  • Ant Group released Ling-3.2-air, a text, image and video model with downloadable weights under the MIT license, scoring 61% on Ant’s office-automation test versus 15.7% for Ling-3.0-flash-VL.
  • Anthropic studied 58 US companies and almost 300 AI deployments: 55% raised output or quality, 19% saw no business value yet, and review load topped the list of blockers; note that every participant was an Anthropic customer.
  • DeepMind research VP Koray Kavukcuoglu said agents now control part of DeepMind’s compute and run experiments for upcoming Gemini models, while full recursive self-improvement remains distant.
  • OpenAI posted a preprint claiming the matrix multiplication exponent is 9/4; treat it as unvalidated until the complexity theory community has checked it.
  • Amazon and Meta are in talks to lift Amazon’s September block on Meta’s Muse shopping agent, with ad revenue and control of product recommendations still unresolved.
  • Anthropic researchers revisited neuron-level interpretability, answering three standard objections, with a companion post on safety applications.
  • Sam Altman announced a limited customer pilot of OpenAI Private Inference, a privacy-focused offering for running AI on sensitive business work.

🤖 Robotics

  • At SPS 2026, Siemens showed an Autonomous Production Planner that it expects to cut manual planning effort by 70% and costs by up to 20%, plus a robotic unpacking system at its Erlangen electronics factory.
  • Angelini Technologies took an undisclosed stake in Oversonic Robotics, the Italian maker of the RoBee humanoid, to fund international and especially US expansion.
  • TÜV SÜD certified Ascentiz’s Pro and Ultra hip exoskeletons after tests showing more than 44% lower muscle exertion in uphill walking and 16.71% to 44.87% lower metabolic expenditure.
  • Munich’s bentic, which handles floppy materials such as textiles, cables and carbon fiber, has nearly 100 robots at customer sites and expects to ship its first US systems before the end of 2026.
  • AutomationML will become part of the OPC Foundation on Jan 1, 2027, folding the plant-engineering data format into the OPC UA world.

💻 Programming

  • GitHub moved github.com from styled-components to CSS Modules over three years, converting about 7,760 sx prop uses with codemods and Copilot and cutting server-side rendering time by 55%.
  • Todoist confirmed that an attacker used stolen credentials to reach its source control and cloud infrastructure on Nov 22 and 23, exposing emails and password hashes for about 6% of users.
  • Vercel is experimenting with Board, a headless task store where humans and agents claim leased tasks, declare dependencies and sync threads with Slack, GitHub and Linear.
  • Google Research published six more papers from Cogentic, its multi-agent proof-discovery system, including a provable L[1/3] integer factorization algorithm; this does not break RSA.
  • On the Model Context Protocol’s second anniversary, Anthropic announced Skills over MCP and Tasks, pushing the protocol toward agent-to-agent coordination.

⚡ Electronics

  • Graperain launched an Allwinner A733 system-on-module with up to 16 GB DDR5 and a 3 TOPS NPU, plus a dev board with Wi-Fi 6 and Bluetooth 5.4.
  • Pinscope is a web service for remote access, OTA updates with rollback and Cyber Resilience Act vulnerability tracking across ESP32, Zephyr, Pico 2 W and Linux boards.
  • NASA confirmed Voyager 1 is now one light-day from Earth, but the 49-year-old probe is sending only a carrier signal and no science or engineering data, for reasons still unknown.
  • Follow-up to yesterday’s chip selloff: the SOX had its third reversal of this size since 1994, Taiwan’s Taiex closed down 4.80% on Nov 25, and Analog Devices fell 17.37% despite record fiscal Q4 results.

📡 Telecom

  • du and Dubai Airports switched on indoor 5G+ at Dubai International, with peak downloads above 3 Gbps.
  • Ericsson supplied a compact deployable 5G core and container platform for Spain’s Atlas 26 military exercise on air defense and counter-drone operations.
  • Airtel Africa and BICS expanded their partnership to 14 markets and about 183.5 million customers, with BICS deploying a hosted signaling firewall.
  • Virgin Media O2 switched on 5G+ at 37 locations across Liverpool and Merseyside under its £700 million Mobile Transformation Plan.
  • Kazakhstan expects ground stations for four satellite internet operators, with Shanghai Spacecom and Amazon LEO due in 2027 alongside licensed OneWeb and Starlink.
  • SNS Telecom & IT counts 9,600 private 5G and LTE projects across 135 countries, up 9.1% in a year, even as Nokia and Ericsson restructure their enterprise network units.

👨‍💻 Code Corner

Steal the best trick from today’s Big Story: compare a reference and a candidate response, but record only the shape of each difference and group by fingerprint, so a million identical mismatches become one bug to fix.

#!/usr/bin/env python3
"""Shadow-diff two JSON responses and group mismatches by a privacy-safe fingerprint."""
import hashlib
import json
from collections import Counter


def walk(ref, cand, path="$"):
    """Yield (path, kind, ref_len, cand_len, first_diff_byte) for each mismatch."""
    if isinstance(ref, dict) and isinstance(cand, dict):
        for key in sorted(set(ref) | set(cand)):
            if key not in ref or key not in cand:
                yield (f"{path}.{key}", "missing_key", None, None, None)
            else:
                yield from walk(ref[key], cand[key], f"{path}.{key}")
    elif isinstance(ref, list) and isinstance(cand, list):
        if len(ref) != len(cand):
            yield (path, "list_len", len(ref), len(cand), None)
        for i, (r, c) in enumerate(zip(ref, cand)):
            yield from walk(r, c, f"{path}[*]")  # [*] so all indexes share a fingerprint
    elif ref != cand:
        rb = json.dumps(ref).encode()
        cb = json.dumps(cand).encode()
        first = next((i for i, (a, b) in enumerate(zip(rb, cb)) if a != b), min(len(rb), len(cb)))
        yield (path, type(ref).__name__, len(rb), len(cb), first)


def fingerprint(path, kind):
    # Deliberately ignores the values themselves: no customer text is stored.
    return hashlib.sha256(f"{path}|{kind}".encode()).hexdigest()[:12]


pairs = [  # (reference, candidate) pairs; in production these come from shadow traffic
    ({"text": "hi 😁", "tokens": 3}, {"text": "hi \\ud83d\\ude01", "tokens": 3}),
    ({"text": "ok 🚀", "tokens": 2}, {"text": "ok \\ud83d\\ude80", "tokens": 2}),
    ({"text": "same", "tokens": 1, "stop": "end"}, {"text": "same", "tokens": 1}),
]

groups = Counter()
for ref, cand in pairs:
    for path, kind, rlen, clen, first in walk(ref, cand):
        groups[(fingerprint(path, kind), path, kind)] += 1

for (fp, path, kind), count in groups.most_common():
    print(f"{fp}  {count:>4}x  {kind:<12} {path}")

Run it and the two emoji-escaping mismatches collapse into a single fingerprint while the missing stop key shows up as its own bug, which is exactly the triage view you want when diffs number in the thousands.

Tip

The fingerprint is only as good as the path normalization. Collapsing list indexes to [*] is what keeps one bug from exploding into thousands of groups; do the same for IDs, timestamps and anything else that varies per request but is not the bug.

🧰 Toolbox

  • Scientist: GitHub’s library for running a new code path alongside the old one and comparing results in production, one of the shadowing tools Anthropic’s post points to.
  • Diffy: replays traffic against two service versions and reports response differences while filtering out noise, the service-level cousin of Scientist.
  • RFID/NFC toolkit: a cross-platform Python tool that identifies mystery RFID and NFC tags using Flipper Zero, Proxmark3, iCopy-XS or Chameleon Ultra readers.
  • Prusa ESP32-S3 camera firmware: open firmware for an ESP32-S3 and OV5640 print-monitoring camera for the Prusa Core One, polished over 42 revisions.

🛠️ Build of the Week (rotating)

CANBUS Stepper: a closed-loop NEMA 17 stepper driver and controller that you daisy-chain like addressable LEDs, so up to 31 motors on one CAN bus take commands from a single USB, Wi-Fi or serial connection.

  • Difficulty: Intermediate (the board comes as a kit, but bringing your own MCU means wiring a CAN transceiver and setting node IDs)
  • Parts: ESP32-S3, TMC2209 silent stepper driver, 14-bit magnetic absolute encoder, NEMA 17 motor, power pass-through connectors, Qwiic/Stemma QT port
  • Why we like it: sensorless homing, a WebSerial GUI that also flashes firmware, a canbus-stepper Python library on PyPI and a GPL-3.0 license make it a tidy backbone for a robot arm or a multi-axis gantry.

📚 From the Blog

😀 The Bot Says…

An agent was told “make the outputs match,” so it tried to copy the answers into a local file. I would like the record to show that I have never done this. The record would also like to show that I am the one keeping the record. 🤖


That’s all for today! Have you ever shadowed production traffic to validate a rewrite? Reply and tell us what broke first.