Claude Code Helped Bun Creator Rewrite Core Infrastructure From Zig to Rust in Under Two Weeks

Claude Code Helped Bun Creator Rewrite Core Infrastructure From Zig to Rust in Under Two Weeks

N
News Editor
2026-07-17 08:19:09
Anthropic has published a detailed look at how Claude Code handled large-scale code migrations, with Bun creator Jarred Sumner offering the standout example. According to the report, Sumner used Claude Code to move Bun’s core from Zig to Rust in less than two weeks, generating roughly 1 million lines of code. The migration consumed 5.9 billion input tokens and 690 million output tokens, for an estimated API cost of about $165,000. The report says Bun’s existing test suite passed 100% in CI before the merge. After the Rust version was merged, 19 regressions appeared and have since been fixed. The Rust build quietly shipped in June alongside Claude Code. Anthropic also shared a second case from Mike Krieger, co-head of Anthropic Labs and Instagram co-founder, who migrated a Python codebase into 165,000 lines of TypeScript over a weekend. That project used about 27 million tokens for the main body of work and included hundreds of agents, eight checkpoints, three rounds of adversarial review, and command-by-command output comparison against the Python original. Anthropic framed the broader lesson as improving the loop that produces code rather than patching code manually, and outlined a six-step framework for running large migration projects with AI.
AnthropicClaude CodeBunJarred SumnerRustZigCode Migration

Anthropic has publicly detailed the full workflow behind large-scale code migration with Claude Code, and the highest-profile example in the release centers on Bun creator Jarred Sumner. According to the report, Sumner moved Bun’s core from Zig to Rust in less than two weeks, producing about 1 million lines of code in the process.

The migration used 5.9 billion input tokens and 690 million output tokens. At API pricing, the cost came to about $165,000. The report contrasts that figure with roughly four years and $3 million in prior development spending.

The article was published by MarsBit and attributed to the WeChat account New Intelligence, with authorship credited to “ASI启示录.” It says Sumner originally chose Zig for a straightforward reason: he wanted a language with extreme simplicity and performance comparable to C. In his words, “before LLMs, one person in a small apartment in Auckland wrote Bun in a year.”

Claude Code Helped Bun Creator Rewrite Core Infrastructure From Zig to Rust in Under Two Weeks 3

Bun’s shift from Zig to Rust

Bun is described as a JavaScript runtime faster than Node.js. As its ecosystem expanded, the report says Bun CLI monthly downloads passed 10 million and that Bun became a heavy underlying dependency for Claude Code itself. At the same time, earlier technical debt had become harder to ignore.

That set up the migration: Sumner used Claude Code to move the entire Bun project from Zig to Rust, which the piece describes as more memory-safe. Before the merge, Bun’s full existing test suite passed 100% in CI. After the merge, 19 regressions surfaced. The report says those have now all been fixed. The Rust version quietly went live in June together with Claude Code.

Another migration case: Python to TypeScript

Anthropic also highlighted a second example from Mike Krieger, co-head of Anthropic Labs and Instagram co-founder. Over a single weekend, he migrated a Python codebase into 165,000 lines of TypeScript, with the main body of work consuming about 27 million tokens.

Claude Code Helped Bun Creator Rewrite Core Infrastructure From Zig to Rust in Under Two Weeks 4

That process, according to the report, involved hundreds of agents, eight gates, and three rounds of adversarial review. It ended with a consistency check that compared the output of every command against the original Python version. Any behavioral difference was treated as a bug and fixed.

Krieger also had Claude design an end-to-end testing setup on its own, then ran it across four consecutive all-nighters to catch edge cases that had not been anticipated.

Claude Code Helped Bun Creator Rewrite Core Infrastructure From Zig to Rust in Under Two Weeks 5

Why the migration was necessary

The report says Krieger’s team needed to package internal tools into a single binary for users. With the Python toolchain, compilation took eight minutes per platform, and a full build matrix added up to half an hour for each release.

After the migration, the same compile step took two seconds, binary startup became six times faster, and one entire deployment pipeline was retired.

Anthropic’s six-step framework

Anthropic summarized the approach in one line: don’t fix the code, fix the loop that produces the code.

Claude Code Helped Bun Creator Rewrite Core Infrastructure From Zig to Rust in Under Two Weeks 6

The report lays out the logic behind that view. Large migrations map well to AI because the work is naturally parallel, the old code already serves as the specification, the test suite can act as a ready-made judge, and failed builds or tests expose the next task without requiring human arbitration.

  • Set up the judge.
  • Write the rulebook.
  • Map dependencies.
  • List the gaps.
  • Run a small pilot to pressure-test the rules before scaling to thousands of files.
  • Translate at full scale, then cycle through implementation, review, and repair before compiling, running, and checking behavior file by file.

Throughout the process, the rules were not maintained by manual patchwork. As described in the article, each time a reviewer found an error, that lesson was added to the rulebook, and the affected files were generated again.

Claude Code Helped Bun Creator Rewrite Core Infrastructure From Zig to Rust in Under Two Weeks 7

Anthropic’s closing suggestion was simple: take a codebase you have been putting off for a long time and ask Claude what its migration plan would look like.

The piece says that line would have sounded like a joke four years ago. Today, it is presented as an engineering workflow that can actually be executed. In that framing, migrations that once felt out of reach for developers now look like a backlog waiting to be cleared.

This article was originally published by Bit.Fan. For more cryptocurrency news and market insights, visit www.bit.fan.
200

Disclaimer:

The market information, project data, and third-party content displayed on this platform are for industry information sharing only and do not constitute any form of investment advice or return commitment.

Cryptocurrency trading carries high risks. Users should fully assess their risk tolerance and make independent decisions. All profits, losses, and legal responsibilities are borne by the users themselves.