Skip to content
AnthropicAnthropic

Claude Code modernizes a legacy COBOL codebase

Watch how Claude Code helps modernize a mainframe codebase. Starting with code from an AWS Mainframe Modernization demo environment, Claude Code analyzes business logic, dependencies, and data flows, then helps refactor it into Java while preserving functionality. Claude Code handles the complex, multi-step work—generating documentation, developing migration plans, writing test suites, and iteratively validating the new code—directly from your terminal.

Nov 13, 20254mWatch on YouTube ↗

At a glance

WHAT IT’S REALLY ABOUT

Using Claude Code to document and migrate legacy COBOL safely

  1. The demo uses an AWS Mainframe Modernization sample repo (credit card system) to show how Claude Code can generate comprehensive documentation for an undocumented COBOL/JCL codebase.
  2. Claude Code creates a structured discovery workflow: parallel subagents, a tracked per-file to-do list, and generated reference indices that translate program names and map dependencies.
  3. From the indexed understanding, Claude produces architecture artifacts like Mermaid diagrams that visualize end-to-end daily batch processing and data flow across programs.
  4. For migration, Claude switches to planning mode to design a multi-phase COBOL-to-Java strategy that includes data model translation, file-format-compatible I/O, and behavior-preserving logic conversion.
  5. Verification is performed via a dual test harness (GNU COBOL vs Java 17) that compares outputs and intermediate artifacts to ensure perfect fidelity to legacy behavior.

IDEAS WORTH REMEMBERING

5 ideas

Start modernization with exhaustive discovery, not code changes.

The transcript emphasizes that legacy business logic and regulatory rules often live only in code, so Claude Code first inventories and documents all files to reduce hidden-risk before migration.

Parallel subagents help scale analysis without contaminating the main thread.

A dedicated “COBOL documentation expert and translator” subagent works in an isolated context, letting multiple analyses run concurrently while keeping the primary session focused.

Track progress at the file level to avoid gaps and duplication.

Claude creates a to-do list across all 94 files and marks completion, a practical control to ensure nothing is missed in a medium-to-large legacy repository.

Documentation should capture business workflows, not just comments.

For the interest calculation program (CBACT04C), Claude extracts the end-to-end workflow—rate lookup, fallback rules, record updates—turning opaque code into maintainable domain knowledge.

Create lightweight indices to make legacy systems navigable.

The demo’s `catalog.txt` (name translation) and `relationships.txt` (pipe-delimited dependencies) become reusable navigation aids and enable automated diagramming and impact analysis.

WORDS WORTH SAVING

5 quotes

Our sample COBOL codebase has almost no documentation.

Unknown

This is of course common with legacy codebases where critical business logic and regulatory requirements are embedded within undocumented code.

Unknown

Claude Code created a to-do list of all ninety-four files and tracked its progress to ensure no files were processed twice and nothing was missed.

Unknown

In this demo, Claude Code ran continuously for an hour to draft over a hundred pages of documentation.

Unknown

The result was perfect bit for bit fidelity. Every calculation, business rule, and edge case was preserved.

Unknown

Legacy COBOL modernization workflowSubagents and isolated context windowsAutomated architecture discovery and documentationName translation and dependency indexing (catalog/relationships)Mermaid diagrams for batch workflow visualizationCOBOL-to-Java migration planningDual-harness verification and bit-for-bit fidelity

High quality AI-generated summary created from speaker-labeled transcript.

Get more out of YouTube videos.

High quality summaries for YouTube videos. Accurate transcripts to search & find moments. Powered by ChatGPT & Claude AI.

Add to Chrome