← Blog
AI/MLProduct

Scale your coding agent deterministically from one repository to all of them.

Contents
  1. Make the same change everywhere.
  2. Connect your agent to Moderne.
  3. Move the whole estate.

Coding agents have sped up a lot of day-to-day development. Because of that, technology leaders now expect them to take on bigger jobs, like modernizing their code estates. Yet most estates still have a backlog of upgrades, vulnerabilities, and technical debt that’s stuck where it’s always been. If coding agents alone could move the estate, it would have happened already.

The agents themselves are quite capable now, but they aren’t consistent. Give an agent the same task in two separate sessions, and you may get two different results. Even if you’re okay with that for one repository, it becomes much more of a problem when you need to migrate a framework or patch a dependency across all of your organization’s repositories. So far the default approach has been one agent to one repository, meaning you fire up an agent for every repo and let each one do its own thing. The army of agents will happily chug along, using inference (and tokens) to read and analyze the code, plan the necessary changes, modify the code directly, and declare victory.

Agent direct manipulation Repository

Nothing about this process guarantees that every repository got all of the changes it needed, or that the same changes were applied consistently across the estate. For agents to handle multi-repo changes, they need a deterministic way to find everything that needs to change and make the same change everywhere.

Make the same change everywhere.

Deterministic code change isn’t a new idea. OpenRewrite was purpose-built for exactly that. It uses the Lossless Semantic Tree (LST), a complete representation of the code containing all types, dependencies, formatting, and comments, so changes are precise and preserve the existing code’s style. Recipes are the programs that make those changes, the same way every time they run. Moderne builds on that foundation to run those recipes across thousands of repositories at once. Many of the world’s largest enterprises have been using Moderne for years to upgrade and secure estates with tens of thousands of repositories and billions of lines of code.

On the surface, deterministic change looks like it’s at odds with agentic change, but recipes vs. agents is a false choice. In practice, the two approaches are at their best when they work together. Agents are good at finding code and reasoning about it, but they search and read text. The spots in the code that need to change don’t always contain the text they searched for. A method call on an inferred type or a library pulled in transitively won’t show up in a grep, and the agent has no way to know its results were incomplete.

With the type and dependency information from the LST, agents can find every place a change applies, including the places they wouldn’t have thought to look. Recipes are what let one agent change thousands of repositories the same way. Previously, using recipes meant knowing which one to run, how to configure it, and how to write your own when needed. Now the agent handles those details for you.

Agent synthesize or select Inner loop Recipe unit tests manipulation Repository Repository Repository Repository Repository … Herd Safety Outer loop

Agents can write recipes based on what they find, along with before-and-after unit tests that check each recipe before it touches a real repository. OpenRewrite’s RewriteTest framework also catches patterns an agent should avoid in a recipe, so agents can write high-quality recipes with less supervision.

As the recipe runs across more repositories, each repository’s build and test suite becomes another validation point. When a build breaks or a test fails in one repository, the agent fixes the recipe instead of the repository. The next time the recipe runs, every other repository with the same pattern gets that fix, too. We call this herd safety, because a failure in one repository protects all of the others.

Over time, the agent spends most of its effort on the recipe. The work left for each repository shrinks to whatever the recipe doesn’t cover.

Connect your agent to Moderne.

One command gives your agent Moderne’s tools:

bash
mod copilot chat ./work \
  --org "Legacy Java Apps" \
  --prompt "Upgrade all of these repositories to Java 25."

This example uses GitHub Copilot, but mod <agent> chat works with the agent you already use, including Claude Code, Codex, Cursor, Devin, and others.

Running this command hands your agent a set of instructions about how to use Moderne commands (in the form of an AGENTS.md file), and then launches an agent session with that context. The agent starts by searching the specified organization to find which repositories are affected. Because the LSTs are already stored in the platform, it can search thousands of repositories without spending hours cloning them first.

Once the agent finds what it needs, it selects a recipe (or writes a new one) and runs it against that set of repositories. Then it clones only the repositories that the recipe changed, and builds and verifies each one before pushing anything, which is where that herd safety idea comes into play. If a build fails, the agent fixes the recipe and reruns it, so the other repositories get the fix too.

All of that work lands in a changeset, where Moderne holds the staged changes for every affected repository. The agent pushes to the changeset first instead of pushing anything to your repositories directly. This lets the agent stack several changes into one changeset, so you see the whole change across the estate in one place. Nothing reaches source control until you review the changeset and commit it or open pull requests. That also keeps CI from running on changes that aren’t ready, so teams don’t end up with a pile of failing draft pull requests to sort out.

You can follow what the agent is doing in the Moderne Platform. The activity view shows each agent session next to its changeset, along with the prompt that started it, the tasks it spawned, and how far along it is.

The Activity view in the Moderne Platform, listing agent sessions with the prompt that started each one, the tasks it spawned, and badges linking to its changesets
The Activity view shows each agent session with its prompt, its tasks, and its changesets.

Larger changes can call for an agent team, where several agents join the same changeset and work on it together. They don’t all have to be the same agent either, so Claude Code and Codex can work side by side. The agents coordinate on a shared message board, where they divide up the work and review each other’s fixes to the recipe. In the platform, you can read their conversation and see what each agent pushed.

The Agent team tab of a changeset in the Moderne Platform, with a summary of agents and pushes on the left and the message board where two agents divide up recipe issues and report their findings
An agent team’s message board, where agents divide up the work and report what they found.

Move the whole estate.

Coding agents alone haven’t moved the estate, but with a deterministic way to find and change code, they can. A multinational bank has demonstrated this in two-day workshops, where developers give GitHub Copilot one prompt to upgrade Java across 500 to 900 repositories per workshop, and GitHub Copilot uses Moderne recipes to make the change. In a side-by-side run on ten repositories, GitHub Copilot on its own made 1,487 tool calls and finished about 18 percent of the upgrade. With Moderne, it made 35 tool calls and finished all of it. Both runs ended with successful builds, so the output gave no sign that GitHub Copilot on its own had left most of the upgrade undone. The bank has since upgraded about 3,000 repositories this way.

Read the full case study.

Once you’ve installed the Moderne CLI, one command puts the agent you already use to work across all of your repositories. To try it on a sample estate first, start with the self-paced evaluation.

Written by Bryan Friedman Director, Product Management