Skip to content
AI Workshop

AI Legacy Code Modernization 2026: COBOL, Mainframes and What Claude Code, Codex and Mistral Can Really Do

For decades, legacy modernization was the project everyone postponed: too expensive, too risky, and the people who understood the code had retired. In 2026 that changed, at least on paper. Anthropic's COBOL post wiped about 13% off IBM's share price in a single day, OpenAI now claims near-saturated scores on COBOL migration, and AWS, Google and Mistral all sell AI modernization agents. At the same time, Gartner warns that most mainframe exits will fail. We put the numbers into charts: what AI really does well, where it still breaks, and how to plan a modernization project in 2027.

−13%
IBM's share price on 23 February 2026, the day Anthropic published its COBOL modernization post: the worst day since October 2000
86.6%
COBOL migration tasks with preserved behaviour for OpenAI's newest model at low effort, up from 5.4% (OpenAI, October 2026, private test set)
~80%
Share of the more than $100B US federal IT budget spent running existing systems rather than building new ones (GAO, 2025)
70%+
Mainframe exit projects started in 2026 that Gartner expects to miss their intended benefits, because GenAI is overestimated

Why legacy code is suddenly an AI topic

The scale of the problem has not changed. Estimates of COBOL still in production range from 220 billion lines (the widely cited Reuters figure) to 775–850 billion (a 2022 Micro Focus survey), and COBOL is said to process around 95% of US ATM transactions. The US government alone spends roughly 80% of an IT budget of more than $100 billion a year on operating and maintaining existing systems, according to the GAO's July 2025 report. CIOs surveyed by McKinsey estimate technical debt at 20–40% of the value of their entire technology estate.

What changed is the tooling. Coding agents such as Claude Code and OpenAI's Codex can now read a whole repository, follow call chains across thousands of programs and copybooks, and write documentation and tests at a speed no consulting team can match. That attacks the most expensive part of modernization: understanding what the old system actually does.

Where the US Federal IT Budget Goes (% of more than $100B a year)

Source: US Government Accountability Office, GAO-25-107795 (July 2025). Approximate split; the 2016 GAO report put operations and maintenance at about 75% for FY2015.

Anthropic, IBM and the 13% day

On 23 February 2026, Anthropic published a post arguing that Claude Code can automate the exploration and analysis phases of COBOL modernization: mapping dependencies, documenting workflows nobody remembers, and surfacing risks before code is touched. Modernization, it said, could take quarters instead of years. Investors read it as a threat to mainframe lock-in: IBM fell about 13% that day, its worst session since October 2000, and roughly 27% over February.

IBM's answer was that decades of integration between mainframe hardware and software cannot be replicated by moving code, and its mainframe revenue had just reached a 20-year high. Both sides have a point. Anthropic's post contained no customer numbers, and the documented Claude Code projects so far, such as an AWS Transform plus Claude Code workflow and a Thoughtworks project turning assembler, COBOL and DB2 screens into React, Spring Boot and Postgres for a financial-services client, describe the method rather than measured savings.

The bottleneck was never typing new code; it was knowing what the old code does. That is exactly where coding agents are strongest today: reading, explaining, mapping and testing. Translation is the easier half of the job, and proving that the new system behaves like the old one is the hardest.

OpenAI's COBOL benchmark: from 5% to 98%

In October 2026 OpenAI published the most aggressive numbers yet. On an internal benchmark that asks the model to migrate COBOL programs to C++, Java, Kotlin, Python or Rust while preserving behaviour, its newest Codex model reached 86.6% at low reasoning effort, against 5.4% for its predecessor, at 61% of the older model's API cost. At high effort it reached 97.9%, which OpenAI itself calls close to saturation.

OpenAI COBOL Migration Benchmark: Tasks with Preserved Behaviour (%)

Source: OpenAI, as reported by BleepingComputer (20 October 2026). COBOL to C++, Java, Kotlin, Python or Rust. Private test set, not independently verified; model naming differs between reports.

A second OpenAI benchmark asks models to build a SQLite-compatible database engine in 20 programming languages. The jump is largest exactly in the legacy languages: COBOL from 10.9% to 72.1%, Fortran from 21.4% to 83.5%, Visual Basic from 27.5% to 89.4%. The caveat matters: both test sets are private, so nobody outside OpenAI can check them. Treat them as a direction, not a guarantee; we explain why in our article on AI coding benchmarks.

MultiLangBench: Previous vs New OpenAI Model by Language (%)

Source: OpenAI, as reported by BleepingComputer (20 October 2026). Task: build a SQLite-compatible engine; average across 20 languages. Vendor-reported, private test set.

AWS, Google, Microsoft, IBM and Mistral

Anthropic and OpenAI supply the models; the cloud providers and integrators package them into modernization pipelines. The main offers in 2026:

VendorOfferReported numbers (vendor claims)
AWSAWS Transform for mainframe; can hand off to Claude Code for forward engineering4.5B lines analysed and 1.6M hours saved in year one (all Transform services); 250,000-line mainframe apps in about 6 weeks
OpenAICodex with a five-phase COBOL cookbook: discovery, rule extraction, artifacts, implementation, parity tests86.6% / 97.9% on its COBOL migration benchmark
AnthropicClaude Code COBOL playbook for exploration, documentation and risk analysisNo published customer numbers
Google CloudMainframe Modernization Agents with MCP context, Mainframe Assessment ToolBusiness-rule extraction, no headline savings
GitHub / MicrosoftCopilot modernization agentsCapgemini: business-rule extraction about 40% faster
IBMwatsonx Code Assistant for Z (COBOL to Java on Z)Analysis of superfluous code: 8 hours to 30 minutes
MistralVibe CLI agents for a European energy company, Fortran 77 to C++40,000 of 300,000 lines in the first sprint, 100+ agents, numerical equality as the acceptance test

The largest named projects come from enterprises themselves: Toyota North America reportedly moved more than 40 million lines of COBOL to Java with AWS Transform, and Morgan Stanley's in-house DevGen.AI has processed more than 17 million lines of COBOL, Natural and Perl, saving over a million developer hours. Mistral's project is notable for Europe: an on-premise-capable model and a hard, numerical definition of success.

How much time does AI actually save?

The best-documented results come from large migrations outside the mainframe. Airbnb moved about 3,500 test files in 6 weeks instead of an estimated 1.5 years, 97% automatically. Amazon says AI-assisted Java upgrades across some 30,000 applications saved 4,500 developer-years. Google's engineers report about 50% less time on large code migrations, with LLMs generating 74% of the code changes. On mainframes, AWS reports 70% less effort for a 135,000-line application at Grupo Tress and 75% less testing time at BMW.

Reported Effort or Time Reduction in AI-Assisted Migrations (%)

Sources: IBM (watsonx Code Assistant for Z), InfoQ on Airbnb (March 2025), AWS (BMW, Grupo Tress), Google arXiv 2504.09691 (2025), GitHub blog on Capgemini. Airbnb: 6 weeks vs 78 weeks estimated. All self-reported by the company or vendor; scopes differ and are not comparable one to one.

Note what these numbers measure: individual phases (analysis, tests, rule extraction) or well-bounded migrations with good test suites. None of them is a complete core-banking replacement. That is the difference between a 70% saving on a phase and a successful project.

Gartner's warning: why 70% of mainframe exits will fail

In June 2026 Gartner predicted that more than 70% of mainframe exit projects started in 2026 will fail to deliver their intended benefits because companies overestimate generative AI, and that 75% of mainframe-exit vendors will pivot or shut down by 2030. Its view: GenAI is good at describing technical debt but has significant limitations in automated conversion. Futurum puts it more bluntly: proving behavioural equivalence is where regulated industries hit the wall.

The reasons are familiar to anyone who has run such a project. AWS says testing usually takes more than half of a modernization project. Data migration, batch windows, interfaces to dozens of other systems, regulatory sign-off and the operational knowledge of the remaining experts do not get faster just because code translation does. And translated code that "looks right" is the most dangerous kind; see our analysis of security and quality of AI-generated code.

The market: modernization spend keeps growing

Analyst estimates diverge depending on the definition, but all point up. MarketsandMarkets sizes the mainframe modernization market at $8.4 billion in 2025, growing to $13.3 billion by 2030 (9.7% a year), and the broader application modernization services market at $22.7 billion, rising to $51.5 billion by 2031 (14.6% a year). Mordor Intelligence expects legacy modernization overall to reach $66 billion by 2031.

Modernization Market Forecasts (USD billions)

Source: MarketsandMarkets (mainframe modernization 2025–2030, CAGR 9.7%; application modernization services 2025–2031, CAGR 14.6%). Different scopes; do not add the two series.

A practical roadmap for 2027

  • Start with understanding, not translation. Let a coding agent build the dependency map, the inventory of business rules and plain-language documentation of the critical programs. This is low-risk, delivers value even if you never migrate, and is where Claude Code is strongest.
  • Build the safety net first. Generate characterization tests from production inputs and outputs before any code changes. Without a parity test suite, AI translation only moves the risk.
  • Migrate in slices. Pick a bounded module with clear interfaces, translate it with the agent, run old and new in parallel and compare outputs, as Mistral did with numerical equality checks.
  • Keep humans on the critical path. Pair your remaining COBOL experts with the agent: they review rules and edge cases, the agent does the volume. Their knowledge is the scarcest input.
  • Decide model and data location deliberately. Legacy code often contains business secrets and personal data. Use enterprise contracts with no training on your data, consider EU hosting or an on-premise model, and log what the agent reads and writes.
  • Measure per phase. Track hours for analysis, tests and translation against a baseline, so the business case rests on your own numbers, not vendor slides.

What this means for companies in Croatia and the DACH region

Banks, insurers, public administration and large industrial companies in Croatia, Austria and Germany run the same mix of COBOL, PL/I, RPG, old Java and Visual Basic as their US peers, and face the same shortage of people who understand it. The good news is that the first step does not require a mainframe exit: AI-generated documentation and tests of a legacy system reduce key-person risk and make every later decision cheaper. For regulated institutions, DORA's ICT risk requirements are an additional reason to know exactly what the old code does. For a broader view of how coding agents change development teams, see our guide to AI coding agents.

The bottom line

AI has made the most expensive part of legacy modernization, understanding the old system, dramatically cheaper, and benchmark scores for COBOL translation jumped from near zero to near saturation within a year. But a migration is more than translation: tests, data, interfaces and operations decide whether it succeeds, which is why Gartner still expects most mainframe exits to disappoint. Companies that start with AI-driven analysis and parity tests, migrate in small verified slices and keep their experts involved will capture the savings; those who expect an agent to rewrite the core system in one go will join the 70%.

Sitting on legacy code nobody wants to touch?

We help you use Claude Code and other coding agents to document legacy systems, generate parity tests and plan a modernization in verified steps, with a clear view of risk, cost and data protection.

Talk to an AI consultant

Boris Agatić

Founder of AI Workshop and Claude Certified Architect. Over 10 years of building software, guiding companies from the first strategy call to production AI agents.

LinkedIn (opens in a new tab)