News

Developers Race to Build Rust Ports After Claude Code Source Leak

A 59.8 MB source map accidentally shipped in Claude Code's npm package exposed 512,000 lines of TypeScript; Rust ports hit 50k GitHub stars within hours of publication.

Jamie Taylor3 min read
Published
Listen to this article0:00 min
Share this article:
Developers Race to Build Rust Ports After Claude Code Source Leak
AI-generated illustration

The security post that triggered everything came from Chaofan Shou, a Solayer Lab intern whose discovery of a bundled source map in Anthropic's Claude Code npm package went on to accumulate 28.8 million views on X in a single day. The file he found was 59.8 megabytes. It should not have been there.

On March 31, 2026, Anthropic shipped version 2.1.88 of Claude Code with a JavaScript source map left in the package due to a missing `.npmignore` entry. Source maps invert the minification process: they reconstruct original TypeScript identifiers, internal comments, API endpoint paths, and feature flags from production bundles. Applied to this file, that meant approximately 512,000 lines of source code across roughly 1,900 files became recoverable by anyone who had downloaded the package. Anthropic confirmed it as a packaging mistake and said no customer data was involved, but the internal architecture details now publicly visible created immediate pressure on anyone running Claude Code in production or CI pipelines.

Rust repositories appeared within hours. Developer Sigrid Jin published Claw Code, a clean-room Rust and Python rewrite of the Claude Code agent harness architecture, which the GitHub community quickly called the fastest repository in history to surpass 50,000 stars, reaching that milestone in just two hours after publication. The Kuberwastaken/ClaURST project followed with a pure Rust reimplementation that stated plainly in its readme: "This repository does not hold a copy of the proprietary Claude Code TypeScript source code. This is a clean-room Rust reimplementation of Claude Code's behavior."

Both projects cited the same core rationale. A compiled Rust binary eliminates the Node.js install requirement and the npm dependency surface entirely. Tokio manages async runtimes and streams tokenized responses; Ratatui and Crossterm handle interactive terminal UIs with proper TTY support; clap, reqwest, and serde cover CLI argument parsing, HTTP, and JSON deserialization. That stack produces a single statically linked binary distributable across Linux, macOS, and Windows, no multi-hundred-megabyte Node runtime required.

Understanding what the source map actually exposed matters for auditing current installations. Beyond raw TypeScript structure, a leaked source map surfaces internal endpoint paths, configuration keys, feature flag names, and developer comments never meant for public consumption. If you installed Claude Code before Anthropic issued a remediated package, inspect the installed directory for `.js.map` files and check any downloaded tarball with `tar -tzf` for map entries. Pin to a verified-clean version and review your lockfile. The documented risk in this incident is not leaked credentials but exposed integration points that clarify how the CLI negotiates with upstream APIs.

Evaluating the community Rust ports requires the same discipline you apply to any binary published in the wake of a high-profile event. The 50,000-star milestone and 28.8 million X views create social pressure to adopt quickly; resist it. Build from source. Confirm that a port carries no derived TypeScript and that its license is clearly stated and compatible with your use case. Look for reproducible builds, public CI artifacts, and checksum attestation. A repo offering binary-only releases with no CI pipeline is not a supply-chain improvement; it is a different supply-chain risk wearing a friendlier face.

The incident landed at a moment when the argument for Rust-native developer tooling was already gaining ground. If Homebrew and major Linux distributions adopt community Rust clients from this wave, the missing `.npmignore` entry in Claude Code 2.1.88 may be remembered as the packaging mistake that accelerated a structural shift away from npm-distributed developer agents toward statically linked, auditable alternatives.

Know something we missed? Have a correction or additional information?

Submit a Tip

Never miss a story.
Get Rust Programming updates weekly.

The top stories delivered to your inbox.

Free forever · Unsubscribe anytime

Discussion

More Rust Programming News