Claude Code Language Migration Workflow: Anthropic’s Six-Step Method for Large Codebases

Changing the primary language of a mature production codebase used to be the kind of project that teams postponed for years. The work was expensive, risky, and difficult to estimate. A migration could consume several engineering quarters while two implementations drifted apart, only to finish with incomplete behavioral parity. Anthropic’s recent internal projects suggest that this calculation is beginning to change. In July 2026, Anthropic published a practical account of how its developers used

发布于 2026年7月17日generalGEO 评分: 0
图片背景为深色,左侧有类似电路板的线条图案。图片上方有“Claude”字样,下方以不同颜色渐变呈现“Claude Code Language Migration Workflow”文字。该图片位于介绍Anthropic使用Claude Code支持大型语言迁移的文档开头,作为封面图,直观传达了文档主题,即使用Claude Code进行语言迁移的工作流程。

How Anthropic Runs Large-Scale Code Migrations with Claude Code

Introduction

Changing the primary language of a mature production codebase used to be the kind of project that teams postponed for years. The work was expensive, risky, and difficult to estimate. A migration could consume several engineering quarters while two implementations drifted apart, only to finish with incomplete behavioral parity.

Anthropic’s recent internal projects suggest that this calculation is beginning to change.

In July 2026, Anthropic published a practical account of how its developers used Claude Code, Claude Fable 5, Claude Opus 4.8, and dynamic multi-agent workflows to migrate ten code packages over roughly one month. The packages ranged from tens of thousands to hundreds of thousands of lines.

Two examples stand out:

  • Bun co-founder Jarred Sumner used Claude Code to move Bun from Zig to Rust, producing more than one million lines of code in under two weeks.
  • Anthropic Labs co-lead Mike Krieger converted a Python codebase into approximately 165,000 lines of TypeScript over a weekend.

The important lesson is not that an AI model can translate files quickly. It is that a well-designed migration system can repeatedly generate, review, test, reject, and regenerate code with relatively little human intervention.

Anthropic summarizes the idea this way: the developer’s main job is not to patch every generated mistake by hand. It is to improve the workflow that keeps producing those mistakes.

Two Code Migrations That Changed the Cost Calculation

Bun: More Than One Million Lines from Zig to Rust

Bun is an all-in-one JavaScript and TypeScript toolkit that includes a runtime, package manager, bundler, test runner, and other development tools. Its original implementation relied heavily on Zig, along with substantial C and C++ integration.

Jarred Sumner used approximately 50 dynamic Claude Code workflows over 11 days to produce the Rust migration. The merged pull request contained more than one million added lines and thousands of commits.

Before the merge, Bun’s existing continuous-integration test suite passed across its supported platforms. Anthropic later reported that 19 regressions appeared after the merge and were subsequently fixed.

这张图片是GitHub上编号为#30412的“Rewrite Bun in Rust”合并拉取请求页面,由Jarred-Brunner于5月14日合并自claude/phase-a分支,共合并6756次提交,文件变更达2188个,代码改动显示新增100927行、删除42024行。页面的测试说明要求撤回预提交改动,在spawn.test.ts中保持调试迭代计数,且标注该代码变更通过验证。图片对应文档中提及的Bun通过Claude Code完成超百万行代码从Zig向Rust迁移的内容,呈现了此次大规模代码语言迁移的具体提交详情。

The migration was not a clean-room redesign. The goal was to keep Bun’s existing architecture and behavior while replacing the implementation language. That reduced the number of simultaneous variables: the project could focus on language semantics, ownership, memory safety, and compatibility instead of rebuilding the product from scratch.

Bun’s official write-up explains why Rust was attractive. Many recurring stability problems involved lifetime management, missed cleanup paths, use-after-free conditions, and double-free risks. In safe Rust, several of these issues become compile-time failures rather than defects discovered through production crashes, fuzzing, or manual review.

Python to TypeScript in One Weekend

Mike Krieger’s project followed a different path. Rather than preserving the original file structure as closely as possible, the migration involved more architectural redesign.

The result was approximately 165,000 lines of TypeScript produced over a weekend. The process reportedly used:

  • Hundreds of agents.
  • Eight phase gates.
  • Three adversarial review rounds.
  • A parity harness that compared every command’s output with the Python implementation.

The business reason was clear. The Python-based internal tool was distributed as a single binary, but producing that binary took about eight minutes per platform and roughly 30 minutes across the full release matrix.

After the migration, compilation took around two seconds, startup became six times faster, and the team was able to retire a separate deployment pipeline.

When a Language Migration Is Worth Considering

A language migration still needs a real engineering or business justification. Faster code generation does not make every rewrite sensible.

Teams generally revisit a language choice when the environment has changed since the system was first created. Typical triggers include:

  1. A known compromise has become a recurring operational problem.
  2. A newer language or ecosystem now provides better tooling.
  3. The original ecosystem is shrinking or difficult to hire for.
  4. Security or memory-safety requirements have changed.
  5. Build, deployment, or runtime performance has become a bottleneck.
  6. Maintaining compatibility requires increasingly expensive workarounds.

Bun’s original use of Zig made sense for a solo founder building a very broad runtime before modern coding agents existed. The language offered low-level control and helped Jarred Sumner move quickly.

Years later, Bun had become a widely used production tool with a much larger maintenance surface. The cost of recurring memory-related defects had increased, while Claude Code made a mechanical port realistic enough to test.

The decision was therefore not “Zig is bad and Rust is good.” It was that Bun’s current scale, operational needs, and available tooling had changed the trade-off.

The Migration Is Faster, but It Is Not Free

AI-assisted language migrations can still be expensive.

Anthropic reported that the Bun project consumed approximately:

Usage category Reported amount
Uncached input tokens 5.9 billion
Output tokens 690 million
Estimated API-price equivalent About $165,000

The main portion of Mike Krieger’s Python-to-TypeScript migration used approximately 27 million tokens.

These figures are far below the engineering cost of a traditional multi-year migration, but they are not trivial. Teams must also account for:

  • Human supervision.
  • Compute and API spending.
  • Test infrastructure.
  • CI capacity.
  • Build machines.
  • Review and remediation after merge.
  • Opportunity cost during the migration.
  • Long-term maintenance of the target implementation.

The lower cost changes which projects are financially possible. It does not eliminate the need for a business case.

Why Large Migrations Fit AI Agents So Well

Large language migrations have several properties that work particularly well with coordinated coding agents.

The Work Can Be Parallelized

A migration often contains hundreds or thousands of files, modules, crates, or packages that can be processed independently once their dependencies are understood.

Agents can translate separate units in parallel instead of waiting for one central implementation stream. The challenge moves from typing speed to orchestration, consistency, and verification.

The Old Code Is a Detailed Specification

Many software tasks begin with incomplete requirements. A language migration has a much stronger starting point: the original implementation.

The existing source defines control flow, data structures, edge cases, error behavior, public APIs, and platform-specific handling. Agents can refer back to it whenever the migration rules are unclear.

Tests Provide an Objective Referee

Agents work best when success and failure can be checked mechanically.

A compiler, test suite, parity script, benchmark, or deterministic output comparison gives the workflow a source of truth. Instead of asking a reviewer whether the new implementation “looks right,” the system can repeatedly compare behavior against the original.

Failures Automatically Become Queue Items

Compiler errors, crashes, failed tests, and output differences naturally describe the remaining work.

The migration system does not need a person to write every ticket. Each failed check can be classified and assigned to a fixer agent.

Repeated Errors Can Be Fixed Upstream

When the same problem appears across many files, manually patching each file is the wrong response.

A better approach is to update the migration rule that caused the mistake, then regenerate only the affected units. This turns one discovered defect into a permanent improvement to the process.

图片展示了Anthropic的大型代码迁移工作流,由一位工程师在循环外进行。流程分为6个步骤,包括创建地图和规则、压力测试规则、翻译所有内容、编译、运行和匹配行为。每个步骤有明确的任务和输出,如规则作者、依赖关系映射器、漏洞库存等。还列出了实施者、审查者、修复者等角色,以及编译、运行等操作。底部还呈现了运行基础设施的相关信息。该图与文档中介绍Anthropic大型代码迁移工作流程的内容紧密相关,直观呈现了工作流各环节。

Prerequisite: Build a Reliable Judge

Before translating production code, create a validation system that can evaluate the old and new implementations on equal terms.

Without a reliable judge, the project has no trustworthy definition of completion.

A test suite written in the source language may depend on private functions, internal classes, or implementation details that will not exist in the target language. Those tests cannot always be transferred directly.

Anthropic recommends preparing the judge in three stages.

1. Categorize Existing Tests

Separate tests that express external behavior from tests that depend on internal implementation details.

External tests usually exercise command-line behavior, public APIs, files, network responses, observable output, or complete application scenarios. These are more portable across languages.

2. Rewrite Tests for Portability

Convert behavior-oriented tests into assertions that can run against both versions.

Use separate adversarial reviewers to make sure the rewritten test is not weaker than the original. A test that passes more easily may hide compatibility problems.

3. Validate the Judge Itself

Run the judge against the original implementation and confirm that it passes.

Then intentionally break the program and confirm that the judge fails. A validation system that cannot detect a known defect is not ready to supervise a migration.

Mike Krieger did not begin with a fully portable suite. His team created a parity harness covering seven real-world scenarios and treated any difference between Python and TypeScript as a bug.

The Six-Step Claude Code Migration Process

Step 1: Create the Rulebook, Dependency Map, and Gap Inventory

The first step creates the foundation that every later agent will use.

图片展示了Anthropic在大型代码迁移中第一步“创建地图和规则”的流程。分为六个环节:由规则书作者一次性做出每个决定;依赖关系映射者按顺序安排工作;漏洞库追踪控制流;规则审计员每人负责一个错误类别;怀疑者审查员每人攻击一个条目;联合审计检查库存与规则是否一致。最终输出为受信任的地图和规则。该图与上文“第一步创建基础,每个后续代理都将使用”相呼应,直观呈现了具体操作步骤。

Build the Rulebook First

The rulebook describes how the source language should map to the target language.

Its form depends on the migration strategy.

For a structure-preserving migration, the rulebook may contain:

  • Type mappings.
  • Error-handling mappings.
  • Ownership rules.
  • Naming conventions.
  • Standard-library replacements.
  • Patterns for foreign-function interfaces.
  • Rules for asynchronous operations.
  • Instructions for unsupported constructs.

For a redesign, the rulebook is closer to an architecture document. It defines the new component boundaries, interfaces, data contracts, and design decisions that implementation agents must follow.

The order matters. The rulebook should be written before the gap inventory, because the gap inventory records everything that the default rules cannot safely handle.

Map Dependencies

Parallel work is only safe when the workflow understands which units depend on each other.

A dependency map helps determine:

  • Which modules should move first.
  • Which files belong in the same batch.
  • Which interfaces must be stabilized before downstream work starts.
  • Which cycles need special treatment.
  • Where parallel agents may conflict.

Some languages expose dependency information through package manifests or module metadata. Older C, C++, and Python systems may require a deterministic analysis script to discover the graph.

Claude Code can help create and run that script, but the resulting map should be generated mechanically rather than guessed from model output alone.

Record Language and Architecture Gaps

The gap inventory captures differences that cannot be handled by direct translation.

For Zig-to-Rust work, important gaps included ownership and memory lifetime. Zig permits patterns where cleanup responsibility is communicated through convention or comments, while Rust expects ownership constraints to be expressed in the type system.

For Python-to-TypeScript work, a major gap was interface definition. Python often accepts objects based on runtime behavior, while TypeScript requires explicit contracts before the code can compile safely.

The inventory should be treated as a living artifact. New gaps will appear during translation, compilation, and parity testing.

Step 2: Stress-Test the Rules with a Disposable Mini-Migration

Do not apply a new rulebook to thousands of files immediately.

Run a small migration first and deliberately throw away the output afterward.

图片展示了Anthropic在进行代码迁移时的第二步:压力测试规则。分为三部分,左侧“Dual translators x2”表示两个翻译者,对同一文件进行翻译,但处于不同上下文;中间“Diff inspector”是差异检查者,对比翻译结果;右侧“Pilot run”为试点运行,仅在选定文件上进行。最终输出为强化规则。该图与上下文紧密相关,直观呈现了压力测试规则的具体步骤,是对文档中压力测试规则相关内容的可视化说明。

For Bun, the test involved a small set of files:

  1. One agent translated files according to the rulebook.
  2. Another agent translated comparable files as an experienced Rust engineer might.
  3. A separate agent compared the results and proposed stronger rules.
  4. Adversarial reviewers looked for behavioral or structural problems.

This exercise exposed two serious issues before the approach was applied to all 1,448 Zig files.

A structure-preserving migration makes this comparison relatively easy because two implementations of the same file can be reviewed side by side.

For a redesign, the stress test should target the architecture document instead. Adversarial agents can attack its assumptions, followed by a disposable end-to-end run that exposes missing interfaces and unrealistic sequencing.

The purpose is to improve the rulebook, not accumulate production code. Discard the generated files once the weaknesses have been captured.

Step 3: Translate the Full Codebase

After the rules survive the stress test, translation can fan out across the repository.

图片展示了Anthropic的代码迁移工作流中从编译到匹配行为的步骤。Step 4的编译阶段包括调查构建、并行修复者(无编译访问)和裁决者审查(默认未确认);Step 5的运行阶段有烟雾测试、按原因分组的修复者和两位审查者验证每个修复;Step 6的匹配行为阶段有构建守护进程、30个只读证据的修复者和规则而非判断的裁决查找。这些步骤通过不同颜色突出显示,体现了工作流的各环节及关键角色。

Anthropic describes a recurring loop with three roles:

  1. Implementers produce the translated code.
  2. Adversarial reviewers search for defects and rule violations.
  3. Fixers apply the accepted review feedback.

Implementation work can often use smaller, less expensive models. The strongest models should be reserved for reviewers, rule authors, architectural decisions, and disputes that require broader judgment.

Keep the Queue Mechanical

A batch script should decide what is complete by checking the filesystem or another deterministic state.

For example, a source file may be considered translated when the corresponding target file exists in the expected directory and has passed the required review gate.

Rebuilding the queue from disk makes the process resumable. If an agent stops, a machine restarts, or a batch fails, the orchestrator can reconstruct the remaining work without relying on fragile conversation memory.

Mark Uncertain Work Explicitly

When an implementation agent cannot complete a translation confidently, it should leave a searchable marker such as:

TODO(port): explain why this section requires manual or later handling

The exact marker can vary, but it must include a reason. This creates a structured queue for the compilation and repair stages.

Use Separate Review Contexts

The implementing agent should not be its own only reviewer.

Anthropic and Bun used adversarial review in separate context windows. The reviewer received the changed code and was instructed to assume that the implementation contained defects.

Two reviewers can examine the same batch independently. If their conclusions conflict, a third agent can adjudicate.

This separation reduces the tendency of the authoring agent to defend its own choices and makes long autonomous runs more reliable.

Correct the Generator, Not Every Output

When reviewers repeatedly find the same defect, update the rulebook and regenerate the affected batch.

Hand-patching hundreds of generated files creates inconsistency and leaves the original failure mode active. Fixing the generating rule prevents the problem from recurring in later batches.

Steps 4, 5, and 6: Compile, Run, and Match Behavior

The final three stages share the same general loop: produce objective failures, classify them, assign fixers, review the fixes, and repeat.

图片展示了Anthropic代码迁移流程中Step 3的翻译环节。左侧为“Implementers”,每个文件对应一个实现者;中间是“Reviewers x2”,假设代码有问题;右侧是“Fix agents”,应用确认的修复。图片与上下文紧密相关,上下文提到Step 3是翻译所有内容,此图直观呈现了该步骤中不同角色的分工与职责,即实现者负责文件翻译,双倍的审阅者假设代码错误,修复者应用确认的修复,与文档中对Step 3的描述相契合。

Step 4: Compile

Compilation turns language-level mistakes into a deterministic queue.

Whether compilation belongs inside each translation loop depends on cost.

Mike Krieger’s TypeScript compiler could check a unit in seconds, so it ran frequently during implementation. Bun’s Rust build took much longer, so Jarred Sumner kept Cargo outside the file-level translation loop and compiled larger batches separately.

For expensive builds, use a single orchestrator or build daemon. Fixer agents write patches, while only the daemon is allowed to rebuild. This prevents dozens of agents from launching the same expensive operation simultaneously.

Systemic compiler failures deserve special attention. Thousands of similar errors may indicate a missing dependency rule, incorrect module-boundary policy, or flawed language mapping rather than thousands of unrelated mistakes.

Step 5: Run Smoke Tests

Once the code compiles, run the smallest tests that can expose crashes and severe runtime failures.

Smoke-test results provide another mechanical source of truth. Group failures by root cause rather than assigning one agent per error message without analysis.

Useful categories may include:

  • Initialization failures.
  • Missing resources.
  • Incorrect path handling.
  • Serialization differences.
  • Memory-lifetime defects.
  • Platform-specific behavior.
  • Incorrect concurrency assumptions.
  • Foreign-function interface problems.

Adversarial reviewers should inspect proposed root-cause fixes, especially when one change affects many files.

Step 6: Match the Original Behavior

The final stage compares the new program with the original.

Run the portable test suite or parity harness against both implementations. Any unexplained difference should remain a migration defect until the team deliberately accepts it as a product change.

Fixer agents can examine:

  • The failing test.
  • The original implementation.
  • The translated implementation.
  • The migration rule that affected the code.
  • Prior related failures.

For expensive rebuilds, a build daemon can batch patches, compile once, rerun only the affected tests, and return the results to the queue.

When one failure pattern appears across many tests, move the correction upstream. Update the rulebook and regenerate the files produced under the faulty rule.

What to Do Without a Portable Test Suite

A missing test suite does not automatically make the migration impossible.

Use the original application as the reference implementation and build a behavioral parity harness around real user scenarios.

Mike Krieger’s workflow ran seven scenarios against both Python and TypeScript, compared the output, and assigned each failure to a dedicated fixer loop. Claude later designed additional end-to-end tests and ran them overnight for four consecutive nights.

The original code remains the ground truth even when the team must build a new referee around it.

Practical Lessons That Apply Across Projects

Anthropic cautions against treating its process as a universal recipe. Every codebase has different build costs, language semantics, test quality, platform constraints, and acceptable trade-offs.

Several practices were still consistent across the projects.

Focus on Patterns, Not Individual Failures

Single failures belong to fixer loops.

Human attention is more valuable when directed toward recurring defects, missing rules, poor task boundaries, weak validation, and bottlenecks in the orchestration system.

Make Review Adversarial

A reviewer should actively try to prove that the code is wrong.

This does not mean being vague or pessimistic. Findings should identify a concrete defect, violated rule, unsupported assumption, or behavioral mismatch.

Make Verification Mechanical

Compilers, tests, deterministic scripts, benchmarks, and output diffs should decide whether the work passes.

Model opinions are useful for investigation and review, but they should not replace objective checks where objective checks are possible.

Do Not Use the Largest Model Everywhere

High-volume translation is often repetitive and can be delegated to smaller models.

Use the most capable model for:

  • Creating rules.
  • Reviewing architecture.
  • Finding systemic defects.
  • Resolving reviewer disagreements.
  • Designing validation.
  • Handling difficult edge cases.

This reduces token cost without removing strong reasoning from the highest-risk decisions.

Front-Load Human Effort

The rulebook, dependency map, validation strategy, and stress test require the most deliberate human involvement.

Once those foundations are sound, much of the remaining work becomes queue processing. Weak foundations make every later stage more expensive.

Make the Workflow Resumable

The migration should recover from interruption without reconstructing its state from chat history.

Store progress in files, commits, manifests, databases, or other deterministic artifacts. “Done” should have a machine-readable meaning.

Separate Expensive Shared Operations

Compilation, integration tests, package creation, and full benchmarks may become bottlenecks.

Run these through controlled services or daemons so parallel agents do not waste resources or corrupt shared state.

Results from the Bun Rust Migration

The Rust version of Bun moved into production, although the result still contains engineering trade-offs.

Anthropic reported that roughly 4% of the Rust code remained inside unsafe blocks, mainly around short pointer operations at C and C++ boundaries. Rust did not remove every low-level concern, but it constrained more of them to explicit areas.

Reported improvements included:

Measurement Result
Memory used during 2,000 repeated builds Reduced from 6,745 MB to 609 MB
Binary size on Linux and Windows 19% smaller
Performance on selected real workloads 2%–5% faster
Detectable memory leaks Reported as fixed
Post-merge regressions reported by Anthropic 19, later fixed

These results matter more than the raw line count. A successful migration is not measured by how quickly agents generate code. It is measured by compatibility, maintainability, operational improvement, and the ability to keep developing the product afterward.

What Teams Should Evaluate Before Starting

Before launching a large AI-assisted migration, answer the following questions.

Is the Source Implementation a Stable Reference?

If the original system is changing rapidly, parity will be difficult to measure. Consider freezing selected interfaces or migrating stable modules first.

Can Success Be Measured Mechanically?

Identify the compiler checks, tests, scenarios, benchmarks, and output comparisons that define completion.

A vague goal such as “make it behave the same” is not enough.

Is the Migration Structure-Preserving or a Redesign?

A direct port is easier to compare and parallelize. A redesign may produce a better architecture, but it introduces more judgment and requires stronger design review.

What Is the Most Expensive Loop?

Estimate the cost of:

  • Model calls.
  • Compilation.
  • Test execution.
  • CI concurrency.
  • Repository storage.
  • Full integration runs.
  • Human review.

Design the orchestrator around the most expensive shared resource.

Which Actions Require Human Approval?

Define boundaries for:

  • Destructive Git commands.
  • Dependency changes.
  • Schema changes.
  • Security-sensitive code.
  • Production credentials.
  • Release operations.
  • Changes to public APIs.

The Bun workflow encountered agents interfering with one another through commands such as git stash and git reset. The orchestration rules were updated to prohibit unsafe shared-repository operations and restrict agents to controlled file-level commits.

What Is the Rollback Strategy?

A migration should remain disposable until evidence supports merging it.

Use isolated branches, reproducible builds, checkpoints, and a clear process for abandoning or regenerating work when the rules are wrong.

常见问题

What is an AI-assisted code migration?

An AI-assisted code migration uses coding agents to translate, review, compile, test, and repair a codebase under a controlled workflow. The model does not replace validation; compilers, tests, parity checks, and human-defined rules remain the authority.

Did Claude Code really rewrite Bun from Zig to Rust?

Jarred Sumner used Claude Code dynamic workflows to produce the Rust port, and the public GitHub pull request was merged in May 2026. Bun’s official account says the work ran for approximately 11 days and relied on parallel implementation, adversarial review, and the project’s existing language-independent test suite.

How many lines were changed in the Bun migration?

The merged pull request showed more than one million added lines, alongside removed and modified code. Line count alone does not measure quality, so the more important checks were compilation, cross-platform tests, behavior, memory use, binary size, and post-merge regression handling.

How much did the Bun AI migration cost?

Anthropic estimated approximately $165,000 at API pricing, based on 5.9 billion uncached input tokens and 690 million output tokens. Actual organizational cost may differ because of pricing agreements, internal infrastructure, staff time, CI usage, and remediation after merge.

What is a migration rulebook?

A migration rulebook is a machine-readable or agent-readable set of policies describing how source-language patterns map to the target implementation. It covers types, ownership, errors, interfaces, naming, unsupported cases, architecture decisions, and other rules that implementation agents must follow consistently.

Why use adversarial reviewers?

The implementing agent has context and momentum that may bias it toward accepting its own solution. An adversarial reviewer works in a separate context and is instructed to search for defects, violated rules, and behavioral differences rather than help the code get merged.

Can this method work without an existing test suite?

It is possible, but the team must build another objective referee. A parity harness can run real scenarios against both implementations and compare outputs, while new end-to-end tests can expose failures that static translation checks miss.

Is every legacy codebase now a good candidate for AI migration?

No. A migration still needs measurable benefits, a stable reference implementation, objective validation, sufficient budget, and an acceptable rollback plan. Systems with weak tests, undocumented behavior, rapidly changing requirements, or critical safety constraints may require substantial preparation before agents can help responsibly.

相关工具

  • Claude Code: Anthropic’s agentic coding tool for understanding repositories, editing files, running commands, and coordinating development work.
  • Anthropic Code Migration Kit: Official prompts, templates, and scripts for building a language-migration workflow.
  • Claude Code Modernization Plugin: An official plugin for framework upgrades and legacy modernization rather than full language ports.
  • Bun: The JavaScript and TypeScript toolkit used in Anthropic’s million-line Zig-to-Rust case study.
  • Rust: The memory-safe systems language selected for Bun’s new implementation.
  • Zig: The systems programming language used by Bun before the Rust migration.
  • TypeScript: The typed JavaScript language used in Anthropic’s Python migration example.

Related Links

Summary

Anthropic’s recent migrations show that language-porting projects can be reorganized around agent workflows rather than a single long manual rewrite. Bun’s Zig-to-Rust migration and Anthropic’s Python-to-TypeScript project both relied on parallel implementation, adversarial review, deterministic validation, and repeated regeneration.

The reusable part is the process: build a judge, define the rules, map dependencies, stress-test the approach, translate in resumable batches, compile, run, and compare behavior. When the same defect appears repeatedly, correct the rule or workflow that produced it instead of patching every output by hand.

The approach still requires meaningful budgets, strong tests, controlled permissions, and human judgment at the architectural level. It reduces the cost of migration, but it does not remove engineering responsibility.

The central lesson is simple: reliable AI migration comes from a verifiable production loop, not from asking a model to rewrite an entire codebase in one prompt.