Port a Python tool to TypeScript with hundreds of agents
Anthropic's Mike Krieger had hundreds of Claude Code agents rewrite a Python tool as 165,000 lines of TypeScript over a weekend, Anthropic reports, checked against the original.
Done with Claude Code
What they did
Mike Krieger, co-lead of Anthropic Labs, used Claude Code to rewrite an internal tool from Python into TypeScript, another programming language. First he built a test setup of seven real-world scenarios, treating any change in behavior as a bug. Hundreds of agents translated the code through eight checkpoints and three rounds of fault-finding reviews. He ran it all end to end, revised the rules, and threw away the results until the third run.
How it went
Anthropic reports the rewrite produced 165,000 lines of TypeScript over a weekend. A final check compared every command's output with the Python original. The main part used 27 million tokens, the units of text the AI processes. Building the finished program dropped from about eight minutes per platform to about two seconds, and it starts 6x faster.
Worth knowing
The main lesson is to fix the process that made the code, not the code itself. Build a checker first that runs on both old and new code and fails on deliberately broken code.
Try it yourself with Claude Code
I want to port [repo URL] from [source language] to [target language]. Don't translate anything yet. First, list which existing tests can run as external calls against both versions and which depend on internals, and propose a parity harness of [number] real-world scenarios that compare outputs. Then draft a migration rulebook, a dependency map of modules in porting order, and an inventory of features with no direct equivalent. Show me all of this and wait for approval. After that, port one module at a time, run the parity harness after each, and when you hit an edge case, add a rule to the rulebook rather than patching quietly.
Swap the highlighted [parts] for your own details.
Source: Company blog (Anthropic) · Mike Krieger
Written with AI assistance from the original post and checked against our editorial guidelines. Results are as reported by the source, not independently verified.