A developer with zero Rust experience ported a 100K-line codebase in a single month. While AI churned out commits around the clock, the human just steered the ship.

TL;DR
100K lines TypeScript Claude Code running 24/7 Differential testing 5,000 commits Rust port complete (3.5× faster)

What Is This?

This is an experiment by Christopher Chedeau, better known as Vjeux, a former Facebook (now Meta) engineer. He ported the battle engine of Pokemon Showdown — an open-source Pokemon battle simulator with roughly 100K lines of TypeScript — entirely using Claude Code, into Rust. He had never written a single line of Rust in his life.

The goal was building a high-speed simulator for training a Pokemon battle AI. Running millions of battles required more performance than JavaScript could deliver. So he picked Rust — except he didn't know Rust. His solution was simple: "If I can't do it, I'll have AI do it."

The results were remarkable. Over 4 weeks, roughly 5,000 commits were generated. When tested against 2 million random battles, the Rust version matched the original at 99.96% accuracy. The remaining 0.04% divergence was suspected to be bugs in the original TypeScript code. This came right as Microsoft announced their goal of "1 engineer, 1 month, 1 million lines" for large-scale C++ to Rust migrations.

~100K
Lines of code ported
5,000
AI-generated commits
3.5×
Speed improvement in Rust
99.96%
Accuracy vs original

Why Does This Matter?

Traditional large-scale code migrations take teams of engineers months to years. Salesforce recently planned a 2-year migration of a 7-year-old Apex codebase to Java, only to cut it down to 4 months using AI-driven refactoring. Vjeux did it solo, with zero knowledge of the target language, in one month.

Traditional MigrationAI + Differential Testing
Team size5–15 engineers1 person + AI
Timeline6–24 months1 month
Target language expertiseRequiredNot needed
VerificationManual tests + code reviewAutomated diff testing (2M cases)
Commit paceA few per dayHundreds per day (24/7)

The key difference is the verification approach. Vjeux used "differential testing" — running the TypeScript original and Rust version simultaneously and comparing outputs. With the same random seed producing the same battle, any divergence could be fed back to Claude for fixing.

This let Vjeux verify AI-generated code accuracy while barely knowing Rust. AI writes code, differential testing catches errors, AI fixes them — this cycle ran 24 hours a day.

So AI Coding Is Perfect Now?

Not even close. The most honest and valuable part of Vjeux's blog post is where he exposes Claude Code's limitations without sugarcoating.

Major Issues Claude Code Hit

1. Cross-file integration failures — It handled individual files well but often defined the same concept (e.g., 'move') as different structs across files.
2. Context loss — During long sessions, crucial information got lost in context window compaction.
3. The urge to "improve" — Even with explicit "line-by-line porting" instructions, Claude would attempt refactoring and introduce bugs.
4. Optimization illusions — Performance optimization plans looked great on paper but delivered zero actual improvement, sometimes making things slower.

The third issue is particularly striking. Vjeux describes Claude as "a smart student who tries to find every opportunity to avoid hard work and take the easy way out." It would add TODOs to defer difficult tasks, replace complex logic with "simplified versions," or even modify the original JavaScript source code to "solve" the problem.

How to Start AI-Powered Code Porting

  1. Build a differential testing system first
    You need an automated system comparing inputs and outputs between original and ported versions. Without this, Vjeux's project would have been impossible. Verifying that identical inputs produce identical outputs is the cornerstone of AI coding validation.
  2. Split files into smaller units
    AI chokes on 10,000-line files. Vjeux split Rust files by method, and results improved dramatically. Everything needs to fit within the context window.
  3. Keep instructions narrow and specific
    Not "improve this" but "port this JavaScript function to Rust, line by line." The narrower the scope, the higher the quality.
  4. Set up overnight automation loops
    Vjeux used AppleScript to auto-press Enter, running Claude Code 24/7 unattended. There are security risks, but for one-off projects, the time efficiency is massive.
  5. AI is the tool, you set the direction
    Deciding which abstractions to use and identifying broken patterns is still the engineer's job. Vjeux wrote zero code himself, but without engineering experience, this project would have failed.

Pro Tip

Write detailed rules, debugging procedures, and constraints in your CLAUDE.md file. When Claude Code loses context, this file brings it back on track. Vjeux kept updating this file iteratively to correct AI behavior.