Software teams operate under conflicting pressures: accelerate delivery while stewarding increasingly complex, aging codebases. Leadership often equates delivery velocity with quality, so when development slows, it signals underlying erosion—mounting technical debt, cognitive overload, and perilous upgrade cycles. The emergence of AI in developer tools raises a critical question: does it genuinely advance code modernization, or does it merely speed up risky transformations?

The answer requires understanding where AI excels and where it fails. This is not a choice between human and machine capability, but rather designing systems where each performs its strongest function and can be relied upon to do so consistently.

The Code Modernization Bottleneck

Enterprises typically carry years or decades of technical debt embedded in their systems. Legacy code may remain functional but resists change due to outdated dependencies, fragile interfaces, and reliance on obsolete platforms such as Java 6 or early Spring Boot versions. These constraints severely restrict the organization's capacity to adapt.

Software naturally accumulates complexity over time. Teams make expedient tradeoffs to meet deadlines. Organizations expand, business requirements shift, and supporting tools become stale. Some debt originates internally, but much is imposed from outside—open-source projects release updates frequently, vendors discontinue APIs, and organizations find themselves running outdated frameworks riddled with CVEs.

The industry has shifted its mental model. Rather than treating software as a discrete project built once and archived, contemporary systems are modular and interdependent. Keeping them operational demands treating them as living products: continuously maintained, regularly patched, and perpetually evolving.

Consequently, developers allocate roughly half their time to maintenance work—handling upgrades, managing deprecations, fixing bugs, and applying security patches across multiple codebases with inconsistent tooling. Many necessary changes never materialize; they languish in backlogs, get deprioritized, or remain partially done, creating a growing surface of vulnerability and inconsistency.

The underlying problem is not insufficient developer commitment. Rather, the architectures built do not accommodate frequent, safe, and scalable transformation.

What AI Can (and Can't) Do for Modernization

AI integration now spans nearly every phase of software development. More than 90% of developers employ tools such as GitHub Copilot, Amazon Q, or comparable AI assistants. These tools provide genuine value—they streamline boilerplate generation, offer intelligent autocomplete, enhance documentation, and simplify navigation through unfamiliar frameworks.

However, AI by itself proves insufficient for modernization at scale. Language models operate probabilistically. They lack intrinsic awareness of your build infrastructure, dependency topology, or code formatting conventions. They cannot reliably determine which modifications are safe across hundreds of repositories or anticipate how those modifications might cascade into downstream systems.

In regulated sectors or systems handling critical operations, even minor errors introduced by AI carry disproportionate risk. This reality means human developers must still examine, test, and authorize every modification. The outcome is a slower workflow and constrained confidence in automation—a pattern that cannot scale to enterprise codebases.

The Missing Ingredient: Determinism

AI excels when collaborating on new feature development. For large-scale code modernization, however, accuracy supersedes inventiveness.

OpenRewrite addresses this gap. The open-source refactoring framework enables safe, scalable, and automated code transformation. It parses source code using a compiler-grade parser, generating a Lossless Semantic Tree (LST)—a structured representation preserving complete code fidelity, encompassing syntax, semantics, type information, and formatting.

OpenRewrite's foundation rests on recipes: deterministic programs encoding search and transformation instructions. These recipes undergo testing, receive version control, and apply uniformly whether across a single application or thousands of repositories. They adhere to explicit rules, guaranteeing accurate and reproducible code transformation.

Using OpenRewrite means you're not gambling on post-transformation compilation. Instead, you deploy a framework with deep code comprehension that applies modifications in structurally and semantically sound ways.

Modern AI coding agents, including Claude Code, have substantially reduced the effort required to develop custom recipes. Tasks previously demanding hours now take minutes to prototype.

Grounding AI in Your Codebase's Data

AI systems lack built-in visibility into your codebase. They cannot perceive your dependency graph, build system, or design patterns. They generate output based on statistical probability rather than structural understanding. Reliable AI-driven modernization demands more than a well-crafted prompt—it requires structured access to compiler-accurate representations of your own code.

When Moderne launched Moddy, a multi-repository AI agent, the objective diverged from replicating existing assistants like Copilot or Amazon Q. Rather, Moddy was designed to harness the distinctive semantic richness embedded in each organization's codebase, enabling it to synthesize and reason across entire systems.

Moddy orchestrates modernization across multiple repositories. Beginning with a directive—such as "Upgrade all Spring services to version 3" or "Locate deprecated crypto usages"—it examines recipe outputs across your systems, pinpoints where transformation is required, and executes safe modifications via deterministic recipes.

Moddy derives its effectiveness from deep integration with actual codebase structure through OpenRewrite, where recipes function as tools for extracting structured insights and executing precise transformations. This grounding proves essential. Language models are inherently probabilistic, and while they advance rapidly, this characteristic persists.

As LLMs become commoditized, genuine competitive advantage shifts from the models themselves to the data and systems supplying them. Their utility is bounded by the context provided. Without access to structured code data, AI operates blindly—severed from the complete architecture of the system.

How to Use AI for Modernization the Right Way

Leadership faces relentless pitches for AI products and mounting internal pressure to adopt cutting-edge coding assistants. But if the genuine objective is strengthening software quality and boosting engineering velocity, what genuinely delivers results?

The answer depends on the specific modernization challenge:

  • Deploy generative AI for platform transitions and greenfield code creation. It proves particularly valuable when reverse-engineering legacy systems, architecting novel components, or translating code across programming languages (for instance, COBOL to Java or Perl to Python).
  • Apply deterministic refactoring automation such as OpenRewrite (and systems constructed upon it) to modernize operational systems. These tools excel at tasks including deprecated API removal, framework upgrades, or vulnerable library remediation, with emphasis on safe, repeatable transformation at scale.

Across all scenarios, consider these principles:

  • Empower developers to direct large-scale transformation. Leverage deterministic tools and validated recipes to establish confidence in automation. When developers observe precisely what changes and the reasoning behind those changes—whether affecting one repository or thousands—they develop the assurance to greenlight and execute transformations at scale.
  • Capitalize on your most critical asset: structured code data. Precise, lossless code representations unlock everything downstream—discoverability, automation, and secure modernization. Treat structured code data as foundational infrastructure.
  • Integrate AI with deterministic execution. Enable AI to assist with exploration, pattern recognition, synthesis, and coordination, but employ rules-based recipes for precise searching, code data collection, and verifiable, auditable modifications.
  • Establish modernization as continuous practice. Avoid treating it as a singular initiative. Embed it within your development lifecycle so your systems mature safely and incrementally.

To make AI a genuine partner in modernization, furnish it with appropriate tools, access to structured data, and clear constraints—enabling the creation of safer, more maintainable, and more resilient code regardless of scale.

Source: The New Stack