220 billion lines of COBOL: the problem nobody wants to face
There are 220 billion lines of active COBOL code running in production worldwide. 43% of global banking systems run on COBOL. 95% of US ATM transactions pass through COBOL programs. It's not a dead language. It's the invisible infrastructure holding up the global economy.
The real problem isn't the language itself, but knowledge. The COBOL programmers who wrote those systems are retiring. Documentation, when it exists, is often outdated or incomplete. Every passing year makes the business logic encoded in those programs more opaque, and the operational risk for companies grows.
On February 23, 2026, Anthropic published a blog post titled 'How AI helps break the cost barrier to COBOL modernization.' The next day, IBM stock crashed 13%, its worst session since 2000, wiping over $31 billion in market cap. The market's message was clear: AI is changing the rules of legacy system modernization.
What Claude can do with COBOL code
Claude is today one of the most effective AI models for COBOL code analysis. It doesn't just read syntax: it understands program structure, traces execution flows, and reconstructs business logic even without documentation.
Specific capabilities include complete codebase mapping: Claude reads COBOL source files and maps structural relationships between programs, identifies entry points, traces execution paths through called subroutines, and reconstructs the dependency graph between modules.
Then there's data flow analysis. Claude follows data flow from input to output, through WORKING-STORAGE SECTIONs, FILE SECTIONs, and shared structures via COPY statements. This is particularly critical in AS400 systems where copybooks define data structures used across dozens of programs.
Finally, Claude excels at understanding implicit business logic: calculation rules, exception conditions, error handling, and validation logic that in COBOL are often coded without comments or external documentation.
Automated documentation: from opacity to transparency
The most immediate high-value use case is automated documentation generation. A COBOL system on AS400 with hundreds of programs and no updated documentation represents an enormous operational risk and a hidden cost every time a programmer needs to modify unfamiliar code.
With Claude, the process becomes systematic. For each program, Claude can generate a description of the program's purpose and functional context, documentation of input and output flows with involved files and data structures, a natural language explanation of procedural logic, including branching conditions, loops, and error handling, and a map of external dependencies including CALLs, COPYs, and shared file access.
This documentation isn't generic: it's specific, accurate, and directly linked to source code. And it's generated in minutes, not weeks of manual reverse engineering.
It's not enough to ask 'what does this code do?'
Analyzing a COBOL codebase with Claude requires a structured and methodological approach. It's not about pasting a program into a chat. It requires specific expertise in both the COBOL/AS400 world and in AI prompting and orchestration techniques.
The process we use at Maverick AI involves several phases: from inventory and classification of system objects, to dependency resolution between programs and copybooks, to modular analysis and cross-referencing between components. Each phase requires specific tools and methodologies to extract accurate information from the IBM i system and present it to Claude correctly.
A critical aspect is copybook resolution: a COBOL program without its shared data structures is like reading a book with missing chapters. Complete context is essential for producing reliable documentation. Without a methodical approach, the risk is generating incomplete or misleading documentation, worse than having none at all.
Scaling analysis across large codebases
For large codebases, with hundreds or thousands of programs, a manual approach doesn't scale. What's needed are automation architectures that allow processing entire systems systematically while maintaining analysis quality on every single module.
At Maverick AI, we've developed specific methodologies that leverage Claude's agentic capabilities to parallelize analysis, manage context window limitations, and produce structured, consistent documentation even across very large codebases.
Results measured by academic research confirm the approach's effectiveness: 93% accuracy in code comprehension, with a 35% reduction in perceived complexity compared to reading source code directly. But numbers alone aren't enough: the difference lies in the methodology with which AI is applied to each system's specific context.
Risk assessment: identifying critical points
Beyond documentation, Claude is particularly useful for technical risk assessment of the codebase. By analyzing the code, Claude identifies high-coupling modules, the riskiest to modify because they're connected to many other programs, and isolated modules that can be updated or replaced independently.
This analysis is fundamental for any strategic decision: if the goal is progressive modernization, knowing which modules to touch first and which require more caution is the difference between a successful project and a disaster.
Claude also evaluates accumulated technical debt: redundant data structures, duplicated logic across programs, recurring error patterns, and potential vulnerabilities. Information that previously required weeks of manual code review.
Getting started: the Maverick AI approach
COBOL code documentation and analysis with Claude isn't a theoretical project: it's something companies can start immediately with measurable impact.
Maverick AI works with companies that have COBOL systems on AS400 following a pragmatic path. We start with an initial assessment of the system and quickly produce a complete codebase map with documentation of the most critical modules.
This assessment has immediate value even for those not planning a migration: it reduces operational risk, accelerates onboarding of new developers, and creates a structured knowledge base the company can consult and update over time.
If your company has COBOL systems on AS400 and documentation is lacking or nonexistent, contact us to find out how we can help. Discover our Claude AI expertise.