Skip to content
Replai Let’s talk
Menu
Claude Code meets the mainframe
Benchmark · COBOL estates

Claude Code meets the mainframe

We gave Claude Code a map of the whole estate and asked it the questions mainframe teams ask every day. It answered every kind of question better, change impact by far, nearly three times as fast for about half the cost, and the bigger the estate, the wider the lead.

POSTTRAN · JCL job CBTRN02C TRANSACT · VSAM file TRANREPT CBEXPORT COTRN00C COTRN01C COTRN01 · screen
JCL jobprogramfile or tablescreenrest of the estatewhat Replai traces for one field
Illustrative · real CardDemo path
+70%higher scores on change-impact questions, on private code
2.8×faster per question across both estates; 3× on private code
−47%cost per question, across both estates
−69%fewer wrong answers, across both estates
TL;DR

We measured Claude Code on two COBOL estates, one private with about 2 million lines and one public with 73,000, with and without Replai's MCP server. Each estate got 48 real maintenance questions, every question was answered twice by each setup, and a blind judge graded the answers against references built only from the source. With Replai, Claude Code scored 21% higher across both estates and 70% higher on change-impact questions in the private code. It gave 69% fewer wrong answers, answered 2.8× faster and spent 47% less per question.

The lead grows with the estate: on the large private estate each headline gain was bigger than on the small public one. The reason is the map. Replai reads the whole estate once and answers with short, cited facts, so the model spends its effort reasoning instead of searching. That is also what lets teams run cheaper models, and what lets generated changes be planned against everything a change touches.

Prologue · The problem

Every change starts with a question

COBOL still runs much of the world's banking, insurance and payments. The estates behind it were built over decades, by people who have mostly moved on, and they no longer fit in anyone's head: programs by the hundred or thousand, copybooks shared across many of them, values handed on through files, screens, queues and tables.

So before anyone changes a line, someone has to answer a question. What does this program do? Who calls it? If this field grows by one digit, what breaks? On a large estate that answer can take a senior developer hours or days, and a wrong one reaches production.

Coding agents read COBOL well. But an agent sees files, not the estate.

Prologue · The test

Does a map of the estate make Claude better?

The links that matter live where a text search doesn't connect them: a program called through a table of names, a dataset named only in a JCL step, a field moved into a commarea and read three programs later. Alone, an agent finds them the way a newcomer would, opening one file at a time.

Replai indexes the estate first: every program, copybook, job, file, table and screen, and how values move between them. Claude Code reaches that index through one MCP server. We wanted to know what that changes on real code, so we measured it on two estates of very different size.

Estate one · private
~2Mlines

A production COBOL estate: 500+ programs and copybooks, decades of changes, copybooks kept in more than one folder, single programs of 50,000+ lines. None of it is on the public internet.

COBOLCopybooksBatchIndexed files
Estate two · public
73Klines

AWS's CardDemo sample with a synthetic core-banking application: 557 files of COBOL, JCL, CICS maps, IMS and Db2 definitions and MQ messaging: the mix a modern mainframe shop runs.

CICSIMSDb2MQJCL

The map

What Replai builds before the first question is asked.

Act I · What Replai builds

A map of the whole estate

Replai reads every source in the estate once and builds one index of it: what exists, how it connects, what the data looks like and where each value travels. Every fact keeps the file and line it came from, so every answer can cite them.

Claude Code reaches the index through the Model Context Protocol. It asks in the terms developers use, and gets back short, cited facts instead of a pile of files to read.

+How the pieces connectArchitecture
YOUR ESTATE COBOL .cbl .cob Copybooks .cpy JCL .jcl .prc CICS .csd .bms Db2 EXEC SQL IMS .dbd .psb Replai built once, before the first question 1 Parse every source,every dialect 2 Resolve links betweenprograms, data 3 Index facts withfile and line ESTATE INDEX one graph of the whole estate MCP YOUR TERMINAL >_ Developerasks in plain words Claude Codereasons over cited facts promptanswer question cited facts MCP · HTTPS
Act I · What changes

Search the estate, or ask it

Without Replai, Claude Code answers an impact question by grepping, opening a file, grepping again, opening the next. With Replai it asks the estate once, gets every includer, caller, file and record length with a line citation, and opens only the lines it needs to confirm.

Two ways to answer one questionMeasured times
CLAUDE CODE ALONE grep, open, grep, open, … Claude Code answer 5.0 min CLAUDE CODE + REPLAI ask once, read what it cites Claude Code the estate map cited answer 1.7 min

Average time per question on the private estate, across all 48 questions.

Faster is easy to promise. So we graded every answer.

The results

48 questions per estate, each answered twice, graded blind.

Act II · Results

Better answers, in half the time

Each question was answered twice by Claude Code on its own and twice with Replai, then graded blind against a reference answer built from the source. Figures are averages per question.

Change impact · private estate
Claude Code+ Replai
Answer score+70%
34.3
58.4
Time per question2.6× faster
8.4 min
3.2 min
Cost per question−66%
$1.67
$0.58
Answers that were wrong85% fewer
40.6%
6.3%
Every question · both estates
Claude Code+ Replai
Time, private estate3.0× faster
5.0 min
1.7 min
Time, CardDemo estate2.6× faster
4.5 min
1.7 min
Cost, both estates−47%
$0.72
$0.38
Tokens, both estates−35%
656K
428K
Answer score, both estates+21%
54.3
65.6
Answers that were wrong, both estates69% fewer
13.5%
4.2%
Act II · Scale

The bigger the estate, the bigger the gain

On the 73,000-line public estate, Claude Code alone does respectably: the code is small enough to search, and public, so the model may well have met it before. On about 2 million private lines, searching gets slow and answers get thin. That is where the map pays most: a search costs more the bigger the estate, while a lookup in the map hardly does.

Each of these gains grew with the estate. On the large one Replai was faster and much more accurate, and the cost gap was wider.

Replai's gain over Claude Code alone, by estate sizeMeasured
Score, all questions
+15%
+28%
73K lines~2M lines
Score, change impact
+25%
+70%
73K lines~2M lines
Speed, all questions
2.6×
3.0×
73K lines~2M lines
Cost saved, all questions
36%
56%
73K lines~2M lines
Act II · Three kinds of question

Where the gain comes from

We asked sixteen questions of each kind on each estate. The examples below are real ones from the public estate.

Single program

One program, read closely: its paragraphs, inputs and outputs.

“In the batch interest program CBACT04C, how is interest computed, from which inputs, and where do the results go?”

+21%higher scores on private code, 1.6× faster
−71%fewer wrong answers on both estates
Cross-program

Many programs joined by calls, copybooks, jobs and files.

“Which programs can transfer control to the card list program COCRDLIC, by CALL, LINK or XCTL, directly or through a table?”

+20%higher scores on CardDemo; +10% on private code
4.0×faster on both estates, with 29% fewer tokens
Change impact

One field, followed through every record, program, file and table it reaches.

“CDEMO-CUST-ID in the commarea is PIC 9(09). If it grows to 9(10), which programs, records and files are affected?”

+70%higher scores on private code; +25% on CardDemo
−87%fewer wrong answers on both estates, at 2.7× the speed
Act II · Change impact

The change nobody wants to get wrong

“If this field grows, what breaks?” is the question behind every risky mainframe change. Answering it means following one field through copybooks, records, files, other programs and screens, often across hundreds of programs. On private code, Claude Code with Replai scored 70% higher, cut wrong answers by 85%, and did it in about three minutes.

Answer score34.358.4
Answers that were wrong40.6%6%
Minutes per question8.43.2
Cost per question$1.67$0.58
claude · carddemoanswer condensed

❯ CDEMO-CUST-ID in COCOM01Y is PIC 9(09). What breaks if it becomes 9(10)?

⎿ replai · 3 at risk, 21 recompile only

⎿ Read COPAUS1C.cbl, COPAUS2C.cbl, AUTHFRDS.ddl

Record lengths

CARDDEMO-COMMAREA: 160 → 161 bytes. The field

sits at bytes 35–43; CDEMO-ACCOUNT-INFO, -CARD-INFO

and -MORE-INFO after it move by 1 COCOM01Y.cpy:19

Programs that name the field (4)

COPAUS0C · COPAUS1C · COACTUPC · COACTVWC

Recompile only: 21 more programs copy the commarea

Where the value goes

COPAUS1C MOVEs it to WS-FRD-CUST-ID 9(9) and LINKs

COPAUS2C, which INSERTs it into Db2 AUTHFRDS.CUST_ID

DECIMAL(9): the tenth digit is lost COPAUS2C.cbl:142

// every claim cited to file:line

Better answers were the goal. What the map makes possible next matters as much.

What it opens up

Cheaper models, and code that knows the estate.

Act III · Cost

Less reading. Smaller models.

Most of what an agent spends on a legacy estate goes on reading: search results, whole programs, copybooks opened to check one field. Replai does that reading once, when it builds the map, and each answer arrives as a short brief with a citation on every line. In this benchmark that alone cut tokens by 35% and cost by 47%, with the same model on both sides.

It also changes which model you need. Once the map has done the cross-referencing, the model's job is to reason over a few hundred cited lines instead of searching millions, which is work smaller models do well. The index lets teams run an even cheaper model and keep the view of the whole estate.

Who does the work
Claude Code alone
searchopen & readcross-referencereason
With Replai
searchreadcross-referencereason
the model, paid on every questionReplai's index, built once
Act III · Code generation

Code that knows the estate

The same map makes generated code far more accurate. A model that edits the file in front of it gets that file right and misses the rest: the programs that copy the record, the commarea that grows by a byte, the Db2 column that silently drops a digit.

Replai's change workflow starts from the whole estate. It finds every program a change reaches, plans the edit across all of them for a person to approve, applies it in place, then compiles and tests the result.

Edit from one open file

One copybook changed. The other 26 places the change reaches are left to whoever reviews it.

Edit from the estate map

Widening CDEMO-CUST-ID in CardDemo: the copybook, 4 programs that name the field, 21 that recompile, and the Db2 column it lands in.

copybookreview (4)recompile (21)Db2 column
The point

Keep your Claude. Give it the estate.

Your developers already trust Claude Code, and the skills they built for it keep working. Replai sits underneath: one MCP server that knows every program, copybook, job and dataset. The questions that used to take an afternoon of grepping take a few minutes, with a line number on every claim, and the changes that follow are planned against the whole estate. The larger the estate, the more that matters.

Replai+Claude Code
Method: Claude Code with Replai's MCP server against Claude Code alone, the same model on both sides, the same source tree. 48 questions per estate, 2 runs each, 384 answers, blind checklist grading. Scores are the share of each reference checklist an answer covers, minus a penalty for every claim the reference rules out. Estate two contains AWS CardDemo (Apache-2.0) and a synthetic banking application. Estate one is private and not published. Claude and Claude Code are trademarks of Anthropic.