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 14, 20254mWatch on YouTube ↗

CHAPTERS

  1. Demo setup: Using Claude Code on an AWS COBOL credit-card system

    The video sets the context for a modernization walkthrough using Claude Code on the AWS Mainframe Modernization demo repository. The target is a medium-sized credit card management system with ~100 artifacts across COBOL programs, copybooks, and JCL.

  2. Why discovery matters: Modernizing undocumented, business-critical COBOL

    The first phase focuses on discovery and documentation because the sample codebase has little to no documentation—common in legacy systems where regulatory and business rules live only in code. The video highlights organizational challenges such as lost domain knowledge and difficulty hiring COBOL expertise.

  3. Creating a COBOL documentation subagent with isolated context

    Claude Code is configured with a specialized subagent to act as a COBOL documentation expert and translator. The subagent can run in parallel with isolated context to avoid cluttering the main working thread.

  4. Architecture analysis with thinking mode and file-by-file tracking

    With thinking mode enabled, Claude Code analyzes the codebase architecture and builds a to-do list to ensure complete coverage. It enumerates all 94 files and tracks progress so nothing is processed twice or missed.

  5. Deep program understanding: Extracting workflows from CBACT04C (interest calculation)

    The documentation goes beyond comments by reconstructing full business workflows from the code. Using the interest calculation program (CBACT04C) as an example, Claude describes the end-to-end logic—from reading balances through rate lookup and rule application to record updates.

  6. Building navigational indices: catalog.text and relationships.text

    Claude produces two plain-text memory/index files to make the codebase easier to understand and traverse. One translates cryptic legacy names into human-readable labels, and the other captures dependencies in a simple, machine-friendly format.

  7. System-level visualization: Mermaid diagrams of daily batch processing

    Using the extracted relationships, Claude generates Mermaid diagrams that map the daily batch workflow. The diagrams show data flow across steps such as transaction input, posting, interest calculation, and customer statement generation.

  8. Autonomous documentation at scale: 100+ pages in an hour

    The demo emphasizes throughput and scalability: Claude Code runs continuously for about an hour to draft over 100 pages of documentation. It also notes the tool can operate autonomously for much longer runs, scaling to larger enterprise codebases.

  9. Phase two kickoff: Planning a targeted migration to Java

    After documentation, the workflow moves to migration and verification by porting a core feature to Java. Planning mode is used to force up-front strategy and avoid premature edits while the approach is defined.

  10. Identifying tricky COBOL patterns before translation

    Claude analyzes the COBOL program and calls out complexity that must be preserved during migration. Examples include line-break processing and coordination across multiple files, highlighting that a faithful port requires more than syntax changes.

  11. Five-phase migration plan: Structure, models, I/O, logic, and dual test harness

    Claude proposes a five-step migration plan to ensure maintainability and behavioral fidelity. The plan covers project scaffolding, copybook-to-Java data model translation, I/O compatibility with original formats, careful logic conversion, and side-by-side testing using both COBOL and Java runtimes.

  12. Producing maintainable Java: Idiomatic design, logging, and error handling

    The generated Java output is positioned as production-friendly, not a mechanical translation. Claude creates proper classes, applies appropriate patterns, and adds error handling and logging so a modern team can maintain the result.

  13. Verification for bit-for-bit fidelity: Comparing outputs and intermediates

    The final step validates correctness by running multiple test data files through both the original COBOL and the new Java implementation. Verification checks not only final outputs but also intermediate computations, file writes, and transformations, achieving perfect equivalence.

  14. Closing message: Scalable modernization with new levels of confidence

    The video concludes by noting the demo’s smaller size compared to real enterprise systems, while asserting the approach scales. Claude Code is framed as enabling modernization with confidence and efficiency that was not feasible a year prior.

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