News

Claude Opus 5.5 rebuilt the TypeScript compiler in Rust for about 24,000 dollars

A developer spent over 400,000 dollars of tokens on OpenAI models trying to port the TypeScript compiler to Rust and got stuck at 84 percent. Claude Opus 5.5 started from scratch, had a working version in 10 hours and passed all 181,711 ported tests in two weeks for about 24,000 dollars.

Claude Opus 5.5 rebuilt the TypeScript compiler in Rust

Rewriting a compiler is one of the classic "never do this" jobs in software. It is huge, it is full of edge cases, and every tiny difference in behavior breaks somebody's project. That is exactly why a new open source experiment is getting so much attention this week. The developer and YouTuber Theo Browne published ts-rust, also called tsc-rs: a port of Microsoft's TypeScript 7 compiler, type checker and language server from Go to Rust. The interesting part is not only that it exists. It is who wrote it. According to the project, the code was written by AI models, and the version that finally worked came from Claude Opus 5.5.

The story has a twist that made it go viral among developers. Before Claude, Browne tried the same task with OpenAI models for months. He says that attempt burned more than 400,000 dollars of API priced tokens and never got past roughly 84 percent compatibility. Claude Opus 5.5 then started from scratch, had a working first version in about 10 hours, and reached the current state in two weeks for about 24,000 dollars.

Below we look at what was actually built, what the numbers mean, what is still uncertain, and why this matters for anyone who writes software.

What ts-rust actually is

Some background first. TypeScript is the language most large JavaScript projects use today. It adds types to JavaScript, and a program called the compiler (tsc) checks those types and turns the code into plain JavaScript. For years that compiler was written in TypeScript itself. In 2025 Microsoft started rewriting it in Go to make it about ten times faster. That Go version is now TypeScript 7.

ts-rust takes this Go code and ports it to Rust. The README says it keeps Go's algorithms and behavior, offers the same command line, the same language server for editors and the same API. It is pinned to one exact upstream revision of Microsoft's repository from 29 September 2026, a TypeScript 7.1 development build, and every result is compared against Go at that revision.

You can install it from npm as tsc-rs and run it with the same options as the normal compiler. There are builds for Linux, macOS and Windows, a WebAssembly build that runs in the browser, and it even includes the diagnostics of the Effect library, so Effect projects do not need a second checker. The project is MIT licensed and was created on GitHub on 7 October 2026. Within a few days it had close to 1,000 stars.

Browne is very open about one thing: in the README he writes that he has never read a line of this code. Everything below a section he calls "The Slop Line" was written by his AI models, not by him.

The cost: 400,000 dollars versus 24,000 dollars

Token spend on the port, OpenAI models versus Claude Opus 5.5

This is the number everybody is sharing. Browne says he first used GPT-5.6 Sol and GPT 6 Astra from OpenAI. Over several months of automated goal loops, those models wrote more than 1.3 million lines of Rust. The token bill, calculated at API prices, came to over 400,000 dollars. The README headline even says the total cost was over 420,000 dollars once everything is counted.

Then he noticed that his Claude Code subscription limits were barely being used, so he tried Claude Opus 5.5. He assumed it would continue with the code the earlier models had written. It did not. Opus 5.5 started from scratch, and according to Browne it got further than Astra in a tenth of the time.

The Claude run cost about 24,047 dollars of API priced tokens over two weeks. Browne did not actually pay that amount directly: he used his Claude accounts, and the work used between 925 and 983 percent of the weekly limits of a 200 dollar plan. His own conclusion is that with what he knows now, the whole port could probably be done for around 20,000 dollars.

That is still a lot of money for a hobby project. But compare it with the human cost. Microsoft's own Go port took a team of experienced compiler engineers many months. A company paying engineers to do this by hand would spend far more than 24,000 dollars.

Compatibility: from 84 percent to all ported tests

Compatibility reached by each attempt

Speed and price only matter if the result is correct, and compilers are judged harshly. The OpenAI attempt, Browne says, never got beyond about 84 percent compatibility with the Go compiler. For a type checker, 84 percent is not "mostly done". It means one in six behaviors is wrong, and that is enough to make it useless for real work.

For the Claude version the README claims:

  • All 181,711 ported Go tests pass.
  • Type checking of TanStack Query core and Hono produces diagnostics identical to Go's.
  • On 120 open source repositories, the command line output differs from Go only in a short list of known problems, or where Go's own output changes from run to run.
  • The language server and API answers match Go on the reference test sets.

The README also calls it "100% compatibility in every real world project we have tested", while warning that this is an early release.

Speed: faster than Go, but not the fastest

Speedup over tsc 6 on six open source apps

The project includes a benchmark on six well known open source apps: VS Code, the Sentry frontend, Playwright, Excalidraw, TypeORM and the tRPC server package. Each was fully type checked on an Apple M4 Pro with the old JavaScript compiler (tsc 6), the Go compiler (tsc 7), tsc-rs and the new bun check from the Bun runtime.

The geometric mean result, compared with tsc 6:

  • tsc 7 in Go: 7.1 times faster
  • tsc-rs in Rust: 13.4 times faster
  • bun check: 20.9 times faster

So the Rust port is about 1.9 times faster than Microsoft's Go compiler on these projects. That is impressive for code no human wrote. But it is not the fastest checker in the table. Bun's checker wins on every app except tRPC. The README is honest about this and even has its own section explaining why bun check is faster.

Full type check of VS Code in seconds

The biggest example makes the gap tangible. Checking all 3.75 million lines of VS Code takes 54.56 seconds with tsc 6, 6.84 seconds with tsc 7, 3.49 seconds with tsc-rs and 1.62 seconds with bun check. For a developer who runs the checker many times a day, going from almost a minute to a few seconds is a real change in how work feels.

There is one more benchmark where tsc-rs shines: on Browne's own T3 Code project, which uses the Effect library. Because tsc-rs has the Effect diagnostics built in, it does one pass where the others need two, and it ends up 2.5 times faster than tsc 7 with the Effect plugin.

What is still unclear

It is important to be careful here. Almost every number in this article comes from the project's own README, and much of that README was written by the same AI models that wrote the code. The figures have not been independently verified. A few points are worth keeping in mind:

  • Tests are not the whole world. Passing all ported tests means the port matches Go on those tests. Real code bases will find new edge cases. The README already lists known problems, for example in some monorepos, in parallel project builds with `tsc -b`, and slowly growing memory use in long editor sessions.
  • Nobody has reviewed the code line by line. Browne says so himself. For a tool that only checks types this is less risky than for, say, a database. But it means bugs and odd design choices may be hidden in a very large code base.
  • The cost comparison is not a clean experiment. The OpenAI runs came first and lasted months, and the Claude run benefited from everything Browne learned along the way. Better prompts, a clearer goal and better test setups probably helped Opus 5.5 too. So the result says a lot about the models, but not everything.
  • Maintenance is the real test. Microsoft keeps changing TypeScript. The port is pinned to one revision. Whether AI agents can keep it in sync week after week is a different question from whether they can build it once.

A post on dev.to that discusses the project makes similar points: the result is real and remarkable, but people should not read it as proof that AI can replace a compiler team today.

Why this matters

Even with those caveats, ts-rust is a useful signal for where AI coding is heading in late 2026.

First, it shows how big the jobs have become. A year ago, the typical AI coding demo was a to do app or a single feature. Here an AI agent rebuilt a production grade compiler, type checker and language server, measured against a test suite with more than 180,000 cases. This is the kind of task that used to be quoted in engineer years.

Second, it shows how much the choice of model matters for long autonomous work. The same developer, the same goal and the same tests gave very different results with different models. Months and over 400,000 dollars on one side, two weeks and about 24,000 dollars on the other. For companies that run coding agents for days at a time, those differences decide whether a project is worth doing at all.

Third, it shows a new way of working that many developers will recognize. Browne set the goal, provided the reference implementation and the tests, chose the model, and let it run in loops. He did not write the code. His job was to define what "correct" means and to measure it. Strong tests turn out to be the most valuable asset in AI driven development, because they let a model check its own work without a human reading every line.

Finally, it raises an uncomfortable question for open source. If a well funded developer can port a large project to another language in two weeks with AI, forks and rewrites will become much cheaper. That can be great for speed and choice. It can also split communities and create big code bases that nobody fully understands.

Should you use it?

If you are curious, you can try it on a side project with `npx tsc-rs -p tsconfig.json` and compare the output with your normal compiler. The project says it should work as a drop in replacement for most apps, but also says clearly that this is an early release and that the author has no idea if it will actually work everywhere. For production builds, the safe choice for now is still Microsoft's official compiler, with tsc-rs as an interesting experiment to watch.

What is certain: a few years ago, "an AI rewrote the TypeScript compiler in another language" would have sounded like a joke. Now it is a GitHub repository with benchmarks, an npm package and a bill of about 24,000 dollars.

Sources

Source: pingdotgg/ts-rust on GitHub

Newsletter

The AI news that matters, in your inbox.