Migration & Modernization
Reimagining mainframe applications with AWS Transform and Claude Code
Your mainframe applications encode decades of critical business logic in COBOL and PL/I. That logic processes millions of transactions daily, and it is a valuable asset. But the business demands around that logic are changing faster than the legacy applications can adapt. A bank launching new digital products needs event-driven processing across every channel, not nightly batch reconciliation. An automaker connecting vehicle telemetry to dealer service systems needs cloud-native APIs, not mainframe terminal screens, and batch job streams. A state benefits agency processing SNAP and Medicaid eligibility needs a real-time API, not batch processes that leave citizens waiting days for determination. The original engineers who understand these systems are retiring, creating critical knowledge gaps that complicate maintenance and hinder updates to legacy applications. Meanwhile, legacy application maintenance costs keep rising annually, straining budgets while business demands capabilities at a rapid pace. These imperatives go beyond moving code off the mainframe. Organizations must preserve critical business rules while rearchitecting how those rules are delivered: as modern, cloud-native services that teams can extend, scale, and maintain independently; a complete business transformation of the legacy applications adopting the Reimagine approach.
AWS Transform for mainframe handles the hard part: reverse-engineering your COBOL, PL/I, and JCL codebase to extract structured business rules, documentation, data lineage, and data dictionary. For the forward engineering phase, where those extracted rules become modern microservices, you use an agentic coding tool. The AWS Transform Reimagine User Guide demonstrates this workflow with Kiro. For customers who have already adopted Claude Code as their agentic coding tool of choice, the same strategy can be applied to reimagine their mainframe applications. This post walks through the reimagine workflow using Claude Code.
The Reimagine approach
AWS Transform for mainframe supports two distinct modernization patterns. Refactor performs automated, deterministic COBOL-to-Java conversion, preserving the original monolithic architecture. Reimagine takes a different approach: it reverse-engineers your mainframe application to extract business rules and domain structure, then you forward-engineer entirely new cloud-native microservices from those extractions. Reimagine provides customers with the flexibility to introduce functionality and solve architecture challenges, while also providing the freedom to target any technology stack based on their enterprise standards and preferences. Customers can implement the reimagine pattern to modernize COBOL to Java, Python, .NET, and more.
The Reimagine workflow has three phases (figure 1: three phase diagram)
Figure 1: three phase reimagine diagram
Phase 1 runs inside AWS Transform. Its agents analyze your COBOL programs, PL/I programs, JCL jobs, copybooks, and data stores. They produce structured documentation, extract business rules with acceptance criteria, decompose the monolith into business domains, and map data lineage and data dictionary across the system.
Phase 2 happens outside AWS Transform, in your agentic coding tool. You download the AWS Transform artifacts, configure your tool with project context and methodology steering, and generate specifications. Critically, Human-in-the-Loop validation is essential at this stage: application experts must review and validate the AI-generated specifications before proceeding to code generation. Once the specifications are validated, you then generate code.
Phase 3 combines automated testing with human verification: code review, test execution, integration testing, and user acceptance testing. In this phase, the data migration, deployment, and AWS resources creation scripts are run. Only after this human-in-the-loop verification should the application be considered ready for production deployment.
Getting started
To reimagine your mainframe application with AWS Transform and Claude Code:
Prerequisites:
- An AWS Transform Reimagine job completed with artifacts in Amazon S3 (see the AWS Transform Forward Engineering Tutorial for the full setup)
- Claude Code installed (available as CLI, desktop app, web app, or IDE extension)
Steps:
- Download AWS Transform artifacts from Amazon S3 to your project Workspace
- Create your CLAUDE.md with @imports referencing product context, technology stack, project structure, and methodology files
- Set up skills for spec generation and code generation
- Generate specifications from the AWS Transform artifacts
- Review and validate specifications with a software architect or application SME
- Generate code and tests from the validated specifications
- Perform code review, testing, and human validation before deployment
AWS Transform and Claude Code together
Mainframe reimagination spans two fundamentally different problems: understanding what the legacy system does and building the modern system that replaces it. Solving each one takes a fundamentally different kind of AI approach.
AWS Transform brings enterprise-scale reverse engineering. Mainframe codebases are massive, often millions of lines of COBOL, PL/I, and JCL accumulated over decades. The specialized agents in AWS Transform call deterministic purpose-built tools, combined with AI to scan this entire codebase, extract structured business rules, map data lineage and data dictionary, and decompose the monolith into business domains. This is not a task that you can solve by pointing a general-purpose AI Agent at a repository. The analysis and reverse engineering from AWS Transform produces reliable, repeatable foundations: dependency graphs, rule extractions with testable acceptance criteria, and domain decompositions grounded in actual code structure.
Claude Code brings powerful forward engineering. Once AWS Transform has produced those structured artifacts, Claude Code turns them into modern microservices, targeting a wide range of technology stacks, programming languages, and framework. It reads the extracted business rules, follows methodology steering to generate specifications, and produces code in the same terminal session. Its agentic architecture lets it work across multiple files, run builds and tests inline, and iterates errors without manual intervention. Project memory/persistent context file (CLAUDE.md) and Skills files make the workflow repeatable and consistent across teams.
Together, they cover the full modernization journey. AWS Transform provides the enterprise scale business rule foundation that forward engineering depends on to generate accurate modern code. Claude Code provides the flexible, agentic generation that turns those foundations into working software. The combination means that each tool operates where it is strongest, with structured artifacts as the handoff point between them.
What AWS Transform produces
After an AWS Transform job completes, your S3 bucket contains a structured set of artifacts:
s3://your-bucket/transform-output/your-job-id/
The most important artifacts for forward engineering are the per-file business rule extractions. AWS Transform analyzes each COBOL program and JCL job, then outputs structured rules in this format:
How Claude Code drives forward engineering
Claude Code provides two complementary mechanisms for steering the forward engineering workflow. Understanding these is the key to getting consistent, repeatable results.
CLAUDE.md provides persistent project context. This is Claude Code’s main instruction file, loaded automatically at the start of every session. Use @imports to reference additional context files, so Claude Code always has access to your product context, technology standards, project structure, and methodology guidance. For file-type-specific standards (Java coding standards, React guidelines), use .claude/rules/ with path-based frontmatter so the right rules load automatically for each file type. If you are familiar with Kiro, CLAUDE.md and @imports are analogous to Kiro’s steering files in .kiro/steering/, which similarly provide persistent project-level context.
Skills package repeatable workflows. Skills are reusable, parameterized prompts that you invoke with a slash command. Instead of pasting a long prompt every time you want to generate specifications or code, you define the workflow once as a skill and run it with a single command. Skills accept arguments, so the same skill works across different business functions or services. For the Reimagine workflow, skills are the natural way to package both the spec generation and code generation steps.
For example, a Business Rule Extraction (BRE) analysis skill file at ‘.claude/skills/bre-analysis.md’ might look like:
You then invoke it with ‘/bre-analysis CustomerAccountManagement’. The same pattern applies for the DDD analysis, spec generation, and code generation skills. Together, CLAUDE.md provides the “always-on” context and skills provide the “on-demand” actions.
Generating modernization requirements
Generating the modernization requirements for the target application is the first forward engineering step. The goal is to analyze the AWS Transform artifacts, apply structured methodologies, and produce three living requirement documents that will drive code generation. Generating the modernization requirements for the target application is the first forward engineering step. The goal is to analyze the AWS Transform artifacts, apply structured methodologies, and produce the microservice specification documents that will drive code generation. You set up a workspace with the downloaded AWS Transform artifacts, the steering files that define your product context, your technology stack, and the workflow that encapsulate the spec generation process. With Claude Code, you can implement those steering files using either dedicated skills (reusable slash commands) or by organizing your methodology guidance within CLAUDE.md files and the .claude/rules/ directory. The spec generation skills instruct Claude Code to:
- Analyze the business logic extraction following the BRE (Business Rule Extraction) analysis methodology, navigating AWS Transform’s output structure from entry points through program flows to data sources.
- Apply Domain-Driven Design to model bounded contexts, aggregates, entities, and domain events from the BRE analysis. This defines the service boundaries for your target architecture.
- Generate microservice specifications from the DDD model: requirements with acceptance criteria in the Given/When/Then format, technical design with API contracts and entity models, and implementation tasks ordered by dependency.
Invoke each skill with a single command:/bre-analysis CustomerAccountManagement/ddd-analysis CustomerAccountManagement/spec-generation CustomerAccountManagement Claude Code reads the AWS Transform artifacts, follows the methodology steering, and produces structured specifications. These are living documents you can refine as your understanding of the project evolves. Before proceeding to code generation, a software architect or application SME must review, validate, and adapt the generated specifications. This human-in-the-loop checkpoint is critical. The specifications define what will be built, and errors here propagate into the generated code.
Generating code and tests
With validated specifications in hand, code generation uses its own workspace with steering focused on technical standards and implementation patterns. The spec generation workspace focused on analysis and methodology; the code generation workspace focuses on turning validated specs into compilable, deployable services. A code generation skill instructs Claude Code to work through the validated tasks in dependency order, generating Spring Boot microservices, unit tests, and AWS CDK infrastructure as code. Like the spec generation skills, you invoke each code generation step with a single slash command. The code generation skills instruct Claude Code to:
1/ Database Generation: Generate database artifacts such as schemas, indexes, and migration scripts from the microservice spec’s domain model.
2/ Microservice Code Generation: Generate microservice code from the specification, which may include backend REST controllers, service layer methods, repositories, micro frontend components, client-side validation, or batch steps modernized into event-driven architecture patterns. Each business rule is tagged with its source rule ID for traceability, with test cases mapped to acceptance criteria.
3/ IaC Generation: Generate infrastructure as code such as compute resources, container definitions, messaging resources, and CI/CD pipeline configuration from the microservice spec.
Invoke each skill with a single command:/database-generation CustomerAccountManagement/microservice-code-generation CustomerAccountManagement/iac-generation CustomerAccountManagementClaude Code works through the task list, generating code across multiple files while following the technology standards defined in your steering files and .claude/rules/. After generating a service, Claude Code can run the build, spot any errors, and correct them before moving on. You can also automate build checking with Claude Code hooks. A hook can be configured to trigger after every file write, running the Maven compile and feeding errors back to Claude Code. This allows compilation issues to be caught and corrected immediately. You can execute tasks one at a time for close review, or request Claude Code to work through a batch. The flexibility to move between fine-grained and batch execution lets you balance oversight with velocity.
Conclusion
This post walked through a complete mainframe reimagination workflow using AWS Transform and Claude Code together. Successful modernization requires a solution that can reverse engineer deterministically, produce validated and traceable specs, and allow those specs to flow into any AI-powered coding assistant for the forward engineering. The reimagine pattern lets customers target a wide range of technology stacks and architecture patterns and introduces the opportunity to redefine the business processes supported by the legacy applications. We hear from many customers who tell us that their legacy applications have not kept pace with the dynamics of their business environment today. Reimagine allows us to critically inspect the underlying business logic, maintain what must be maintained, and modify the rules that have fallen out of sync with the needs of the business. If you are planning a mainframe modernization and want to use Claude Code for forward engineering, follow the workflow in this post to configure Claude Code and generate your first specifications.