5 Legacy Codebases AI Can Now Modernize and Let You Own
The cost of understanding old code just collapsed. Here's what that means for everything from Amiga assembly to 220 billion lines of production COBOL.
- 01AI agents can now reverse-engineer and document legacy codebases for a few dollars per thousand lines.
- 02A 1993 Amiga game in raw 68000 assembly was successfully ported to modern engines by an AI agent.
- 03AI tools are automating COBOL discovery, threatening traditional multi-year modernization consulting.
- 04US technical debt costs $2.41 trillion annually, with most federal IT spend just maintaining old systems.
- 05Human engineers are still required to validate AI outputs and ensure strict regulatory compliance.

Using AI to modernize legacy code works because AI coding agents are now good at the expensive part: reading and understanding old, undocumented systems, not just writing new ones. That shift changes the math on whether you rewrite, replace with SaaS, or finally own the system you already have.
The real barrier was never the code. It was understanding it.
For forty years, legacy modernization meant hiring consultants to reverse-engineer a system before anyone could touch it. The code was rarely the hard part. The hard part was that the person who understood it retired in 2011, the documentation was wrong or missing, and nobody wanted to be the one who broke a payroll run or an ATM network by guessing.
That's why so many companies gave up and bought a SaaS replacement instead, or paid for a multi-year rewrite and hoped. Anthropic put it plainly when describing the old approach to COBOL: "Modernizing a COBOL system once required armies of consultants spending years mapping workflows."1
What's changed is that AI agents can now do that mapping and documentation work themselves, cheaply, on code nobody currently understands. That's the actual breakthrough, and it's why the five examples below aren't a random tour of retro computing. They're proof that the discovery problem, the thing that made modernization expensive, is being automated at every scale from a hobbyist's 68000 assembly to a bank's mainframe.
1993 Amiga assembly: a 68000 game rebuilt for Godot by an AI that read the raw hardware code
In 1993, a developer in Baghdad built a game called Babylonian Twins on an Amiga 500, writing directly in 68000 assembly with no modern tooling and no surviving documentation beyond his own memory.2 Thirty-three years later, he fed that raw assembly to Claude Code and asked it to port the game to Godot.
The AI read the file formats and the hardware-level assembly cold, made its own calls about how to carry thirty-year-old logic into a modern engine, and shipped a working port to iOS and Android, with a Steam release planned.2 The developer's own words: "it went faster than I could follow."2
Compare that to the last time this game got ported. In 2010, a team spent months of nights and weekends hand-writing roughly 34,000 lines of C++ to bring the same game to iPhone.2 That's the delta. Not a small productivity bump. A different category of effort.
Can AI revive a dead multiplayer world with no surviving documentation?
Game developer Jon Radoff had 333 script files written in a custom scripting language from a 1990s multiplayer game.3 No documentation survived. No one who wrote the language was still around to ask. Most consultants would have quoted a year just to scope the job.
He gave the raw files to Claude and told it to figure out what the language did and rebuild the game.3 Six weeks later he had a live engine: 2,200 rooms, 2,000 items, 300 monsters, 60 spells, and a full combat system.3 Claude reverse-engineered an entire proprietary programming language from nothing but its output, then used that understanding to reconstruct the runtime.
Same pattern as the Amiga case, just applied to a language instead of a chip architecture. AI doesn't need a spec. It needs enough examples to infer one, and it can do that inference far faster than a human archaeologist working file by file.
40-year-old C64 games: decompiling 6502 binaries back into readable, cross-compilable source
The pattern holds for commercial software too, not just personal side projects. Researchers used Claude to reverse-engineer Rigel's Revenge, a 1987 Commodore 64 text adventure, by building a full 6502 CPU emulator and decompressing the game's custom SMART EGG text-compression engine.4
They hit a real wall along the way: a 256-byte token table that only existed at runtime, never stored anywhere retrievable in the binary.4 They found it anyway, then documented the game's internals and cross-compiled a working modern version.4 That's decompilation, format recovery, and preservation done on a 40-year-old binary with no source code and no comments, by an AI that had never seen the game before.
The lesson for anyone sitting on an old commercial binary with no build environment left: missing source code is no longer a dead end.
COBOL mainframes: the 220-billion-line core of banking, insurance, and government
This is where the stakes, and the dollar figures, get serious. COBOL still runs an estimated 95% of ATM transactions in the US and underpins core systems across banking, aviation, and government.5 GitHub puts the installed base at roughly 200 billion lines still running today.6
In February 2026, Anthropic published a framework claiming Claude Code could automate the exploration and analysis phases of COBOL modernization, the part that historically ate most of a consulting engagement's time and budget.1 The market reaction was immediate: IBM's stock dropped 13.2% in a single day, its steepest daily decline since October 2000.1 That's not a hobbyist blog post moving markets. That's Wall Street pricing in a real threat to legacy-modernization consulting revenue.
IBM pushed back, and the pushback is worth taking seriously. Rob Thomas argued that "translating code is one thing. Modernizing a platform is something else entirely," pointing out that enterprise COBOL runs inside a vertically integrated stack of z/OS, CICS, IMS, Db2, RACF, and MQ, and that the resilience enterprises actually pay for comes from that platform, not the language.7 Code translation alone doesn't capture most of what makes these systems hard.
Anthropic's own framing is more measured than the headline suggests. It positions AI as automating exploration, dependency mapping, and risk analysis, the expensive discovery work, while keeping strategic planning, regulatory judgment, and final validation with human COBOL engineers acting as safety officers.8 That's a meaningfully narrower claim than "AI replaces the mainframe team," and it's the honest one.
Why won't companies modernize the aging internal system nobody wants to touch?
Most companies don't run COBOL. They run something almost as unloved: a VB6 order system, a Delphi inventory tool, a .NET Framework app three versions behind, an AngularJS front end nobody's touched since 2017. It works, technically, which is exactly the problem. Half of IT professionals cite "the system still works" as the top reason modernization keeps getting delayed, even as the costs pile up.9
And the costs are real. US technical debt is estimated to cost the economy $2.41 trillion a year, over 10% of GDP, with $1.52 trillion of that tied specifically to accumulated technical debt per CISQ's 2022 analysis.9 Federal agencies alone spend over $100 billion a year on IT, and 80% of that just keeps existing legacy systems running rather than improving anything.9 Sixty-two percent of US organizations still rely on legacy software in daily operations, and 92% of leaders admit to carrying some form of technical debt right now.9
GitHub documents a practical three-step framework a Microsoft engineer used to modernize COBOL systems without ever learning COBOL herself: reverse-engineer legacy files into markdown documentation, enrich the code's rigid structure so AI agents can parse it, then orchestrate specialized agents for call-chain mapping, test generation, and conversion.6 The same playbook applies to a VB6 app or an ERP customization just as well as it does to a mainframe. GitHub's own cost estimate for AI-assisted analysis lands around $2 to $5 per 1,000 lines, a fraction of a consulting day rate.6
This is where Build vs Buy gets interesting again. If understanding your own legacy system now costs a few dollars per thousand lines instead of a six-figure discovery engagement, the case for renting a SaaS replacement to escape your own codebase weakens. You already paid for that software once. Owning it, instead of throwing it out, is now cheaper than it's been in decades, part of the same ownership renaissance reshaping how technical teams think about their stacks.
What AI still can't do
None of this means point the agent at the repo and walk away. GitHub is explicit about this: "Everyone who's currently promising you, 'hey, I can solve all your mainframe problems with just one click' is lying to you," and full end-to-end automation is likely five or more years out.6
The governance risk is specific, not vague. Research cited by Werner Heijstek found that AI-generated code often contains more security vulnerabilities and gets merged into critical systems with very little formal review, calling this "a governance problem, not a tooling problem."8 He adds a sharper point: "Senior developers become more productive. Junior developers don't magically become seniors."8 AI collapses the discovery cost. It doesn't hand a junior engineer the judgment to sign off on a bank's core ledger logic.
IBM's stack argument matters here too. Even a perfect line-by-line translation of COBOL to Java doesn't replicate the guarantees of z/OS, CICS, and RACF running underneath it.7 Modernization is still a systems problem, not just a code problem, and every one of the five examples above still needed a human checking the output against reality, whether that's a game that needs to play the same or a bank transaction that needs to actually clear.
How do you start modernizing your own legacy codebase this quarter?
You don't need a mainframe or a MUD to apply this. If you're carrying an old internal system that a SaaS vendor keeps pitching you a replacement for, the sequence is roughly the same across every example in this piece:
| Upfront Cost | Time to Value | Retains Ownership | Discovery Automated by AI | Human Validation Still Needed | |
|---|---|---|---|---|---|
| Full rewrite (traditional)teams with years and budget to spare | High | 1-3+ years | Yes | No | Yes |
| Buy SaaS replacementteams that want to exit the codebase entirely | Medium | Months | No | No | Yes |
| RecommendedAI-assisted modernization (own it)teams that want to keep and understand their system | Low | Weeks to quarters | Yes | Yes | Yes |
- Pick one bounded module, not the whole system. The Amiga port and the MUD revival both worked because someone scoped a complete, self-contained piece rather than trying to swallow the entire codebase at once.23
- Let AI produce documentation before it touches code. GitHub's framework starts with reverse-engineering files into markdown docs specifically so a human can review the AI's understanding before any conversion happens.6
- Build the test harness before you migrate anything. The C64 decompilation project only trusted its recovered token table once it could cross-compile and verify behavior against the original.4 Do the same before you cut over anything that touches money or customer data.
- Keep a human as the safety officer, not a rubber stamp. Anthropic's own framing puts final validation and regulatory judgment on human engineers, not the agent.8 That checkpoint isn't optional, especially anywhere compliance or financial reporting touches the code.
- Treat the output as an asset, not a one-time project. The whole point of owning your software instead of renting a SaaS replacement is that you keep the thing you modernized. Document it, version it, and maintain it the way you'd maintain any capital asset, because that's what it now is.
If you're already running your own agents to do this kind of discovery work, it's worth thinking about where those agents actually run. A modernization project means feeding an AI your most sensitive, undocumented internal code, and running that inference on infrastructure you control is a meaningfully different risk profile than piping thirty years of proprietary business logic through someone else's API. It's the same logic behind why teams are moving inference workloads onto hardware they own, and the same reason a vendor that can quietly change terms on your software is a liability you don't want anywhere near your core ledger.
The barrier that kept legacy systems frozen in place for decades wasn't the age of the code. It was the cost of understanding it well enough to trust it. That cost just fell by an order of magnitude, and it's not coming back up.
Yes, in the cases documented here it can. AI agents have reverse-engineered raw 68000 assembly, a proprietary 1990s scripting language with no surviving documentation, and a 6502 binary's custom compression format, in each case by inferring structure and behavior from the code itself rather than relying on documentation.234
It can automate the discovery and analysis phases, which historically consumed most of a modernization project's time and cost, cutting timelines from years to quarters according to Anthropic.1 But IBM and independent analysts argue that translating code isn't the same as modernizing the surrounding platform, and full automation of conversion is still likely five or more years away.76
GitHub's case study puts AI-assisted COBOL analysis at roughly $2 to $5 per 1,000 lines analyzed, a fraction of traditional consulting day rates for the same discovery work.6
Mostly because the systems still work and modernization has historically been expensive and risky. Half of IT professionals cite that as the top reason for delaying modernization, even though technical debt costs the US economy an estimated $2.41 trillion a year.9
- 1IBM posts steepest daily drop since 2000 after Anthropic says AI can modernize COBOLReuters
- 2Porting my 1993 Amiga game to Godot, with an LLM reading the 68000 assemblyBabylonian Twins (developer blog)
- 3Game rebuilt using reverse-engineered language (Jon Radoff post)Facebook / Claude AI Community (Jon Radoff)
- 4Reverse Engineering a 1987 C64 Game with Claude, Part 2: What We Found InsideMedium (Marco Kotrotsos)
- 5Anthropic just dropped an AI tool for COBOL and IBM stock fell 13%Reddit r/ClaudeAI
- 6How GitHub Copilot and AI agents are saving legacy systemsGitHub Blog
- 7Lost in Translation: What the AI code debate keeps getting wrongIBM Newsroom (Rob Thomas)
- 8"With AI, teams can modernize their COBOL codebase in quarters instead of years" — LinkedIn commentaryLinkedIn (Werner Heijstek)
- 9Legacy System Statistics 2026: The State of Enterprise IT in the USLegacyleap



