Migrate a codebase with agents without big-bang risk
Big-bang migrations fail with or without AI. Agents can speed migrations only when the migration is already designed as slices with evidence and rollback.
Big-bang migrations fail with or without AI. Agents can speed migrations only when the migration is already designed as slices with evidence and rollback.
The common agent-shaped trap is “migrate the whole service to X” and then waking up to an unreviewable diff that mixes behavior changes, refactors, and deletion. The fix is a strangler plan that forces parity before cleanup.
Pick a migration shape agents can survive

When this fits vs when it does not
Pick strangler slices when any of these are true:
- The system has multiple consumers, or unclear contracts.
- You need dual-run or traffic splitting to prove behavior.
- The old path is tied into ops and incident response.
Big-bang is only sane when the surface is small enough that you can prove equivalence in a week. If you cannot prove equivalence, you are betting production on confidence, not evidence.
Build a slice map with a parity gate

Parity Gate
For each slice, write down five things before the agent touches code:
- Slice boundary: the seam you are moving (one endpoint, one package boundary, one consumer).
- Owner: one person who can answer “is this still correct” during review.
- Parity evidence: characterization tests, golden files, or dual-run metrics. Name the command or dashboard.
- Rollback: feature flag, config switch, or safe revert plan. Do not invent rollback during an incident.
- Deletion ticket: a separate follow-up issue to remove the old path once parity holds.
Agent constraints that keep migrations reviewable:
- Lock the agent to the slice paths. Do not allow “while we’re here” refactors.
- Ship one slice per PR. Multiple seams in one diff are how parity gets hand-waved.
- Keep the “new path” and “old path” readable side by side until deletion time.
Three migration failure modes agents amplify

Failure modes to catch early
- Overlapping slices. Two people migrate the same seam differently. Fix: one slice board with owners and explicit “in progress” locks.
- Delete old too early. Cleanup lands in the same PR as the first new-path implementation. Fix: require parity evidence in the PR before any deletion.
- No evidence. Unit tests are green, but the contract drifted. Fix: invest in characterization tests or dual-run metrics for the seam.
A weekly loop that finishes slices
- Plan (Mon): pick one slice that can ship behind a flag. Assign one owner.
- Implement (Tue to Wed): agent works only inside slice paths. Reviewer focuses on parity evidence.
- Ship (Thu): release with the flag default off, then ramp. Watch error budget signals.
- Cleanup (Fri): open or advance the separate deletion ticket only after parity holds in prod.
Bottom line
If you want agents to help a migration, design the migration so humans can review it. Slice ownership, parity evidence, and rollback turn agents into accelerators instead of chaos generators.
Related: Protect monorepo package boundaries from agents and Add observability with agents without noise spam.
Share