The $400K Rewrite That Wasn't: How Claude Ported TypeScript to Rust for $24K

The $400K Rewrite That Wasn't: How Claude Ported TypeScript to Rust for $24K

TypeScriptRustLLMsAI Agents

Sources:GitHub repo README + author tweets + HN discussion

On October 7, 2026, Theo Browne open-sourced the ts-rust repository alongside its corresponding npm package, tsc-rs. It represents an ambitious engineering endeavor: porting Microsoft’s native TypeScript 7 compiler, type checker, and Language Server Protocol (LSP) suite—originally rewritten in Go—straight into Rust. The project faithfully mirrors upstream architectural algorithms, behaviors, CLI flags, and API surfaces, pinning its codebase directly to the 2026-09-29 snapshot of TypeScript 7.1.0-dev (revision 673a5f17d713). Given the exact same development objective, two frontier model families turned in results that differed by an entire order of magnitude in both completion time and total expense.

A $400,000 API Face Value Versus $24,000 in Actual Subscriptions

The initial migration effort relied heavily on OpenAI’s GPT-5.6 Sol and GPT 6 Astra models. Over multiple months spent running automated /goal execution loops, these models consumed the equivalent of more than $400,000 in token billing at standard API rates, churning out 1.3 million lines of Rust code. Yet they hit a hard wall, plateauing at roughly 84% compatibility without any clear path forward. Once Browne pivoted to Claude Opus 5.5, the entire migration wrapped up in just two weeks. As Browne reflected on X: “Burned ~$400k of Codex tokens to get nothing done, burned ~$20k of Opus tokens and finished it in two weeks.”

That $400,000 figure reflects nominal retail API pricing. In practice, the actual Claude bill came down to approximately $24,047 by taking advantage of high-tier subscription allowances—consuming between 925% and 983% of the weekly limits allocated to a $200 plan. In long-horizon software engineering, the ultimate bottleneck is whether a model can maintain coherent context and whether it possesses the resolve to wipe the slate clean when existing outputs prove unviable. At standard retail API rates, a comparable endeavor would exhaust a small team’s runway before reaching viability, which explains why this project was feasible only through pooled subscription tiers.

Comparison of token spend and turnaround time between both port attempts Figure: Comparison of token spend and turnaround time across the two port attempts. Source: @theo / X

Scrapping 1.3 Million Lines of Code: Knowing When to Start from Scratch

When Opus 5.5 took over, it did not attempt to patch Astra’s sprawling 1.3-million-line codebase. The model evaluated those accumulated files as fundamentally unworkable, initiated a clean crate, and rebuilt the architecture from the ground up. In just 10 hours, it produced a viable v0 implementation—surpassing in half a day what the previous model had failed to achieve across weeks of struggle.

Under the weight of several hundred thousand tokens of context, an agent’s willingness to purge junk artifacts and rebuild cleanly determines whether a long-running initiative will succeed or stall indefinitely. In prolonged code-generation workflows, continuously layering patches onto flawed primitives inevitably triggers compounding cascading failures. Wiping the board clean yields far greater velocity than nursing broken code, upending the human engineering instinct to preserve sunk costs.

181,711 Upstream Tests Form the Trust Perimeter

In the warnings section of the MIT-licensed repository—which quickly drew 572 stars and 5,963 commits—Browne left an arresting disclaimer: “I’ve never read a line of this code.” In fact, every paragraph in the README beneath the main horizontal rule was authored directly by Claude Code. The confidence required to ship a monolithic codebase without human line-by-line inspection stems entirely from automated verification: all 181,711 test cases ported from the Go implementation pass without exception.

During verification runs, diagnostic reports on TanStack Query core and Hono matched the Go compiler diagnostic for diagnostic, while language server and API responses aligned identically against upstream oracle suites. Across 120 open-source repositories tested, CLI output diverged only on a handful of well-documented edge cases. The integrity of massive LLM-generated code bases rests wholly on upstream test suites acting as an unyielding filter; traditional human line-by-line code review has been cleanly phased out of the trust chain.

ts-rust social preview card Figure: The ts-rust repository social preview card. Source: GitHub

Trailing Bun in Raw Speed, but Delivering Built-in Effect Diagnostics

Benchmarks run with hyperfine on an Apple M4 Pro chip (taking the median across five runs) established clear performance boundaries. When type-checking six open-source test projects, tsc-rs achieved a geometric mean speedup of 1.61x over tsc 7. On the 3.75-million-line VS Code codebase, tsc 6 required 54.56 seconds and tsc 7 completed in 6.84 seconds, whereas tsc-rs dropped the time to 4.20 seconds. Because initial preview builds do not yet include PGO or BOLT profile optimizations, stable releases should run even faster. Nevertheless, Bun’s standalone bun check clocked VS Code at an astonishing 1.62 seconds, maintaining its crown as the fastest engine available.

Where tsc-rs stands out is when domain-specific diagnostics come into play. Testing across the five projects composing T3 Code, running without Effect checks took tsc-rs 7.25 seconds compared to 16.10 seconds on tsc 7. With Effect diagnostic routines active (error codes 377xxx), tsc-rs finished in 11.13 seconds, whereas tsc 7 combined with @effect/tsgo required 21.07 seconds. Baking Effect diagnostics directly into the primary compiler pass completely removes the overhead of an auxiliary scan. Developers can tap into this unified diagnostic pipeline simply by running npm install -D tsc-rs.

Platform Constraints and the Compute Balance Sheet Spark Debate

As an early-stage experimental release, tsc-rs operates under strict deployment boundaries. It currently supports only statically linked Linux x64 and macOS arm64 environments, with Windows and Linux arm64 targets still pending. Documented quirks include TS6059 errors in specific monorepo layouts (warning that files fall outside rootDir) and sporadic stale outputs under tsc -b. Tellingly, four of the first five reported issues simply reproduced existing upstream TypeScript behaviors. When an automated port mirrors an upstream engine bug-for-bug, original defects naturally persist as behavioral traits.

Across Hacker News discussions, technical architecture rapidly gave way to deeper philosophical disagreements. Several commenters calculated that $400,000 could easily compensate a senior staff compiler engineer for an entire year, questioning why that capital was instead funneled into GPU compute clusters. Others stepped in to clarify that the $400,000 figure represented nominal API billing, with actual out-of-pocket costs totaling roughly $24,000. Further skepticism questioned the optics of releasing massive AI-generated code without personal review, with some dismissing the README as an overt advertisement for Claude Code. As the financial threshold of software production collapses to subscription pricing, the central debate in software engineering is rapidly migrating from how code is written to the comparative economics of compute clusters versus human labor.

Reference Links:

  • Theo Browne’s Announcement on X
  • pingdotgg/ts-rust Repository README
  • Community Discussion on the TypeScript Rewrite