ML.ai

Understand it first. Then move it forward in small steps

explore maps what the old code does today, architect plans the path, and general carries out each stage as its own diff you can review.

Who uses ML.ai for legacy work

Teams that inherited code nobody fully understands and still have to change it safely.

  • Teams inheriting an old system

    Undocumented code where the original reasons were never written down.

  • Teams planning an upgrade or a split

    An old framework to move off, or a monolith to take apart one piece at a time.

  • Reviewers who want small diffs

    Each stage is its own change, so no migration lands as one unreviewable commit.

A migration is only safe if you know what the old code does

Rewriting is the easy part. These four things keep a modernization from breaking what nobody wrote down.

Nobody remembers why it works this way

Old code carries behavior nobody wrote down. Reading how it actually works comes before any change, so nothing is assumed.

Map the system before touching it

explore reads across the legacy code, read-only, so the plan starts from what the code does today and not from what someone hopes it does.

Small stages beat one mega-diff

The migration is broken into ordered stages, each its own diff, so you review a few files at a time instead of a rewrite.

Every finished stage stands on its own

Because each stage lands behind its own approval, a completed stage is a real working state. Pausing before the next one is not a rollback risk.

One big migration versus stages you can verify

By hand

Nobody remembers why the old code does what it does, so a change either guesses at intent or a rewrite lands as one giant diff nobody can review.

With ML.ai

explore maps the real behavior, architect plans the path, and general carries it out as separate stages, each verifiable before the next one starts.

Which agent actually does this

explore · Search · Read · Write

Maps what the code does today

Read-only search across the legacy system, so nothing is assumed about behavior nobody currently understands.

architect · Read · Plan · Write

Plans the migration path

Turns that understanding into an ordered plan: the load-bearing files, the real trade-offs and a path from old to new.

general · Read · Plan · Write diff

Carries out one stage at a time

Executes each planned step as its own reviewable diff, behind the same Allow, Always or Deny gate as any other change.

How a migration goes from old code to verified stages

Understand first, plan second, edit last. Each stage is kept separate from the ones with write access, so a migration never lands as one mega-change.

1Map the current behavior firstexplore reads the legacy code and reports how it behaves today, read-only, so nothing is assumed about a system nobody currently understands.
2Plan the migration patharchitect turns that understanding into a concrete plan: which files are load-bearing, what the trade-offs are, and an ordered path from old to new.
3Execute one stage as a diffgeneral carries out the first step as its own diff, held behind the same Allow, Always or Deny gate, so a migration never lands as one unreviewable commit.
4Verify, then move to the next stageBecause each stage is its own diff, you can confirm one part works before the next starts, instead of discovering a problem after everything moved at once.

Common legacy-migration problems and fixes

Where modernizing old code usually goes wrong, and how ML.ai closes each gap.

Behavior nobody wrote down

The old loader does something subtle that no document mentions, and a rewrite quietly drops it.

How ML.ai handles it

explore reads what the code actually does today and reports it, so the plan covers behavior that was never documented.

The rewrite nobody can review

One branch that replaces the whole thing, thousands of changed lines, and a review that amounts to trust.

How ML.ai handles it

The work is staged. Each stage is its own diff behind its own approval, small enough to read.

A problem found after everything moved

Everything changes at once, and the first sign something is wrong is a production incident.

How ML.ai handles it

Each stage works on its own, so you verify it before the next one starts and can pause at any point.

Where this stops

The real edges of modernizing with an agent, stated plainly instead of left for you to discover.

01
01

No single-click “modernize everything”

Each stage is its own approval, by design. That is what keeps a migration reviewable.

02
02

It only knows what is in the repo

explore reads code. Knowledge that never made it into code still needs a person to supply it.

03
03

Big systems need real planning

On a large system the planning stage takes real back-and-forth before it is worth carrying out.

Apply edits to 4 files?

The definition and every caller, in one diff.

route.tsuserService.tsuseUser.ts+1 −1
20export async function GET(_, ctx) {
21- const user = await getUserById(ctx.id)
21+ const user = await findUserById(ctx.id)
22 return Response.json(user)
AllowAlwaysDeny

Refactoring

ML.ai finds every reference before it edits the definition, then lands the change and each caller together in one diff.

Plan · session store migration

  1. 1Update middleware to read both formats
  2. 2Add the server store behind a flag
  3. 3Swap the store
  4. 4Remove direct cookie reads in the auth flow

Open question: hard cutover or dual write

Hand to generalRevise

Planning

architect returns the key files, trade-offs and a plan without editing anything. planSubAgent saves that plan to a file.

FAQs

Does it try to rewrite the legacy system all at once?

No. The shape is explore, then plan, then carry out in reviewable stages, specifically so a migration lands as a sequence of diffs you verify one at a time.

What if nobody on the team knows why the old code was written that way?

explore reads what the code does today, which often surfaces the real behavior even without the original context. Anything that lived only as tribal knowledge still needs a person to supply it.

Can I stop partway through and keep what is done so far?

Yes. Each stage lands as its own diff behind its own approval, so a completed stage is a working state on its own and pausing before the next one is not a rollback risk.

Which agent edits the code?

Only general. explore and architect cannot edit or write, so the understanding and the plan are produced by agents with no write surface.

Can it plan a migration without carrying it out?

Yes. Stop after architect returns the plan and nothing is edited. To keep the plan, use planSubAgent, which writes it to a file you can review later.

Try ML.ai today, or talk to us about what is next

Install the editor agent on your own machine, or book a call to talk through your team’s workloads