Skip to main content

Agent chat

mod <agent> chat is incubating. Its commands and behavior may change between CLI releases.

A coding agent pointed at a directory of repositories makes each change by hand, one repository at a time. Across a large organization that can take hours and produce different results in each repository. Moderne's agent chat aims to fix this by giving the agent access to Moderne's recipes.

You pick an agent and an organization of repositories - then talk to it in plain language. You could say things like: "Upgrade all of these repositories to Java 25" or "Patch every vulnerable dependency across all of these repositories."

The agent runs the recipes across every repository at once, checks the results with each repository's own build, and then edits by hand only what the recipes left behind.

Agent chat needs no setup beyond the two commands in the quick start: one installs the CLI, and one clones the organization with its prebuilt LSTs and tells the agent how to use them. The rest of this page is reference for when you want to know more.

Quick start

Install the Moderne CLI with the install script:

curl https://app.moderne.io/cli | bash

Then point your agent at an organization and give it a prompt. The following example uses GitHub Copilot. You can use claude, codex, or any other supported agent in place of copilot:

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

The CLI clones every repository in the organization into the ./work directory along with its prebuilt LSTs. It then opens whatever agent you specified in that directory with your prompt already submitted. From there, you work with the agent as you normally would. If you leave off --prompt, the session starts empty and you type your first request yourself.

Requirements

You need the Moderne CLI 4.8.4 or later and a supported agent installed on your PATH.

Agent chat does not work together with the Moderne skills or local MCP server. These tools are designed to steer the agent toward working on only one repository at a time instead.

If you have them installed, remove them before you use agent chat:

mod config agent-tools uninstall

You can always reinstall them later with mod config agent-tools install.

To remove them for only one agent, see per-agent installation.

Choosing what to sync

You choose which repositories to sync to your machine by adding the --org flag to the mod <agent> chat command. You'll need to provide an organization name that exists on the Moderne tenant your CLI is connected to. The CLI will then sync every repository in that org to your local machine.

If you want to come back to the same organization later, you can leave off the --org flag. The CLI will reuse what is already synced:

mod claude chat ./work

Without a Moderne Platform organization

If your repositories are not in an organization on the Moderne Platform, pass --sync-csv in place of --org. Syncing repositories this way does not require a Moderne tenant. Instead, it takes a repos.csv or a repos-lock.csv file that lists the repositories to work on. The file can be a local path or a URL:

mod claude chat ./work --sync-csv ./repos-lock.csv \
--prompt "Upgrade all of these repositories to Java 25."

The CLI clones each repository from its cloneUrl and downloads its LST from the publishUri column. If the CSV has org columns, add --org to sync just one organization from it.

The agent needs prebuilt LSTs for every repository. We recommend that you use a repos-lock.csv with a publishUri on each row, like the one mod publish uploads to your artifact repository. See Creating and sharing a repos-lock.csv file for how to produce that file and how to configure the CLI to download from the artifact repository.

If you do not have published LSTs, --sync-csv clones the source code but does not build LSTs. Sync and build them yourself first, then start the agent on the directory:

mod git sync csv ./work ./repos.csv --with-sources
mod build ./work
mod claude chat ./work --prompt "Upgrade all of these repositories to Java 25."

Supported agents

AgentCommandLaunches
Claude Codemod claude chatclaude
OpenAI Codexmod codex chatcodex
GitHub Copilotmod copilot chatcopilot
Cursormod cursor chatcursor-agent
Kiromod kiro chatkiro-cli chat
Sourcegraph Ampmod amp chatamp
opencodemod opencode chatopencode
Visual Studio Code Chatmod vscode chatcode chat
Windsurfmod windsurf chatwindsurf

If the agent's command is not on your PATH, the CLI tells you how to install it.

What happens when you run agent chat

  1. With --org or --sync-csv, the CLI syncs the organization into the directory with sources and LSTs, just like mod git sync. If some repositories fail to sync, the agent still starts on the ones that succeeded, and the CLI reports the failures when the session ends.
  2. The CLI links an AGENTS.md file into the directory. Every supported agent reads this file at startup, so the agent knows from the first turn how to use mod on the organization. The file ships with the CLI and improves as you upgrade. An existing AGENTS.md that the CLI did not create is moved to AGENTS.md.bak.
  3. The agent starts in the organization directory and takes over your terminal. When you exit the agent, you are back at your shell. The CLI then records a telemetry row for the session.

The agent expects the LSTs to already be in the directory, either downloaded during the sync or built by you beforehand. It does not build them itself.

Options

OptionDescription
--org <ORG_NAME>Sync this organization from the Moderne Platform. Combined with --sync-csv, it picks this organization from the CSV's org columns rather than from the Moderne Platform.
--sync-csv <CSV>Sync the repositories listed in this repos.csv or repos-lock.csv (local path or URL) instead of a Moderne Platform organization. No Moderne tenant is needed.
--prompt <PROMPT>Start the session with this prompt already submitted. Not available for Windsurf.
--unattendedRun the prompt to completion and exit, approving the agent's tool use automatically. Requires --prompt. Not available for VS Code or Windsurf.

Without --org or --sync-csv, the directory must already hold a synced organization.

To run the same migration without an interactive session, add --unattended:

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

--unattended lets the agent run tools without asking you first. Use it only in a directory and environment you are comfortable letting the agent change.

Next steps