Clif's notes on architecture, engineering, leadership
Six Ways to Modernize Legacy Systems With AI (and When to use each)
AI has changed what's possible with legacy systems, but it hasn't changed the fact that strategy has to fit the situation. Here are six approaches, from leaving the system alone to replacing it, where each one tends to work, and the one step that has to come before all of them.
If you lead technology anywhere with a few decades of history, you’ve probably heard the pitch by now. Point AI at the old code, let it translate everything into something modern, and retire the legacy platform for good. Faster, cheaper, and with no army of consultants.
Now, here are two things that are both true.
In April, Gartner predicted that more than 70 percent of mainframe exit projects started in 2026 will fail to deliver their intended benefits, because organizations are overestimating what generative AI tools can do. It also expects 75 percent of the vendors in that market to pivot or disappear by 2030.
In June, Gartner published a case study of a company that modernized an unstable, undocumented, business-critical application in five weeks using an AI coding agent.
The difference between those two outcomes usually isn’t the tool. It’s whether the strategy fit the system. AI hasn’t given us one new way to modernize. It has made several old strategies cheaper, and a couple of new ones possible. Here are the six I see most often, along with where each one seems to work best. First, though, there’s one step that comes before any of them.
Before you pick anything: understand it
Understanding the system isn’t one of the strategies. It’s what you have to do before you can choose one, and it’s the part of modernization AI is best at today.
Use AI as an archaeologist before you touch anything. Have it read the code, map dependencies, extract business rules, and write the documentation that nobody wrote twenty years ago. Thoughtworks has been recommending GenAI for understanding legacy codebases for a couple of years now, and Gartner’s own analysis says generative AI is well suited to analyzing and documenting technical debt, and much less suited to converting it automatically.
Just don’t treat the AI’s explanation as the truth. It’s a draft. Have the people who know the business review it, especially the parts about why the code does what it does. If those people are close to retirement, this is also the cheapest insurance you’ll ever buy.
Once you know what you have, you can choose what to do with it.
1. Leave it alone (on purpose)
What it is: Decide not to modernize the core. Keep it running, keep it patched, and use what you learned about it to make it easier to live with.
Works best when: The system is stable, correct, and not what’s holding the business back. A lot of mainframe code has been handling high-volume transactions reliably for decades, and “old” isn’t a business problem on its own. Gartner’s advice is to optimize existing mainframe investments rather than chase a full exit by default.
Watch out for: Using this as a polite name for doing nothing. Leaving it alone is a decision with an expiration date. Write it down, with the reason, in an Architecture Decision Record, and revisit it when the reason changes.
2. Wrap it
What it is: Leave the legacy system as the system of record, and put a modern interface in front of it. The newest version of this idea is to expose legacy capabilities as tools that AI agents can use, often through the Model Context Protocol (MCP). It’s sometimes called an intelligent façade or an agentic overlay.
Works best when: The core logic is right and the problem is access. The business wants new workflows, self-service, or AI agents on top of the old system, and it wants them this year, not after a three-year rewrite.
Watch out for: Wrapping every old transaction one-for-one. Expose business operations (“open a claim,” “check eligibility”), not the raw screens and tables behind them. Also remember that an agent with write access to a core system is a new kind of user. Give it the least access that works, and log everything it does. A wrapper buys you time. It doesn’t pay down the debt underneath.
3. Strangle it, one capability at a time
What it is: Martin Fowler’s Strangler Fig pattern, sped up by AI. Pick one business capability, build its replacement, route traffic to the new version, and retire that piece of the old system. Then do it again.
Works best when: The system has to keep running while it changes, and the business needs real new capability, not just new access. It pairs well with wrapping. The façade you built in strategy two becomes the place where you quietly switch one capability at a time from old to new.
Watch out for: Stopping halfway. A half-strangled system means you’re running both the old platform and the new one, indefinitely. Set a direction for the whole migration, even if you only fund one slice at a time.
4. Write the spec, then rebuild
What it is: Have AI describe what the legacy system does, as a specification, while deliberately ignoring how it does it. People review and correct that spec, and then the new system is built from the spec instead of from the old code. Thoughtworks calls this GenAI for forward engineering and reports that several teams have used it to speed up rewrites.
Works best when: The application is bounded, small to midsize, and poorly understood, and the old design is part of the problem. The five-week case study above fits this pattern.
Watch out for: Skipping the review. The spec is where hidden rules and edge cases come out. If nobody who knows the business reads it carefully, you’ve just automated the classic mistake Joel Spolsky warned about in Things You Should Never Do: throwing away years of bug fixes you didn’t know were there.
5. Translate it
What it is: Automated code conversion, such as COBOL to Java, line for line or close to it.
Works best when: The logic is right, the design is acceptable, and the real problem is the platform: licensing costs, hardware, or the shrinking pool of people who can support it.
Watch out for: This is the strategy behind most of the overpromising. Translated code keeps the old design, only now it’s written in a language that makes the old design look strange. You can end up with a system nobody understands in either language. If you translate, budget for heavy testing and plan to refactor afterward, because the translation is where the work starts, not where it ends.
6. Replace it
What it is: Retire the custom system and move to a commercial product or SaaS platform. I’ve led several conversions from home-grown systems to SaaS, and I’ll take a well-chosen product over a custom rewrite most days. AI doesn’t change the decision as much as it speeds up the hard parts: mapping old data to the new model, translating business rules into product configuration, and finding the customizations people forgot existed.
Works best when: What the system does is common and doesn’t set you apart from your competitors. Payroll, HR, and general ledger rarely deserve custom code.
Watch out for: The vendor in the driver’s seat. Everything in my warning signs for vendors still applies, AI or not.
The part every strategy has in common: proof
Here’s the thing. Generating new code is now the easy part. The hard part is proving that the new system does what the old one did, including the weird stuff.
Whichever strategy you pick, invest in verification before generation. Capture the legacy system’s actual behavior with characterization tests, real (masked) production data, and side-by-side runs. One promising technique on the Thoughtworks Technology Radar fits this well: writing test cases as data, so the same tests can run against both the legacy and the modern code. If you can’t prove equivalence, you’re not modernizing. You’re guessing.
Choosing a strategy
| Strategy | Works best when | Biggest risk |
|---|---|---|
| Leave it alone | Stable, correct, not the bottleneck | Doing nothing and calling it a strategy |
| Wrap it | Logic is right, access is the problem | Exposing raw transactions to agents |
| Strangle it | Must keep running while it changes | Running two systems forever |
| Spec, then rebuild | Bounded, poorly understood apps | Unreviewed specs that miss hidden rules |
| Translate it | Platform is the problem, not the logic | Old design in a new language |
| Replace it | Commodity capability | Vendor-led decisions |
In practice, most real programs use several of these at once, system by system, and all of them start with understanding what you have. Once you do, a few questions will usually point you in the right direction:
- Is the logic right? If yes, protect it (leave, wrap, or translate). If no, rebuild it.
- Is the problem the platform, the code, or access to it? Each one points to a different strategy.
- Does this system make you different? If not, look hard at replacing it.
- Who can verify the result? If the answer is “nobody,” you’re not ready to pick a strategy yet. Go back to understanding the system until somebody can.
Don’t trade one legacy system for another
I wrote in July that AI makes producing code nearly free but understanding it just as expensive as ever. Thoughtworks now has a name for the gap: cognitive debt, the growing distance between what a system does and what the people responsible for it understand.
Legacy modernization is where that debt can pile up fastest. A system that AI translated and nobody understands isn’t modern. It’s just a younger legacy system. The goal was never to get off COBOL. The goal is a system that the business can afford to change, and that’s still the simplest test of whether a modernization worked.