v1.20Grok Build CLI support →

How-to

Sync AGENTS.md, CLAUDE.md and MCP config across every AI agent

Every coding agent reads its instructions from a different file. Keep the same rules in all of them by hand and they drift within a week. Keep one source of truth and let agents-cli write each agent's file for you.

The same rule in five files

You decide the agent should never touch the default branch. Now write that rule intoCLAUDE.md, again into AGENTS.md for Codex, again into.cursorrules, again into .github/copilot-instructions.md. Add an MCP server and repeat the exercise across every agent's config format.

The files are never quite in sync. One agent has last month's rules. Another has a typo you fixed everywhere else. The state that is supposed to make agents reliable is the least reliable thing in the repo.

One source of truth

agents-cli treats AGENTS.md as canonical and generates the per-agent files from it. Edit one file; the rest are written to match.

agents · sync◆ agents-cli
$ agents sync

Config resolves in layers — project, then user, then the system defaults — so a repo can pin its own rules while your personal defaults still apply everywhere else. Same name overrides; everything else is a union.

Which file each agent reads

Each agent expects its instructions in a different place. agents-cli knows the mapping and writes the right filename for each installed agent.

AgentInstruction file
Claude CodeCLAUDE.md (symlink → AGENTS.md)
CodexAGENTS.md (native)
GeminiGEMINI.md (symlink → AGENTS.md)
Cursor.cursorrules
OpenCodeOPENCODE.md
Copilot.github/copilot-instructions.md

Edit AGENTS.md only. Editing a symlink target directly gets overwritten on the next sync.

Not just the memory file

The same layered model covers the rest of the agent surface: skills, hooks, slash commands, permission rules, and MCP servers. Write a skill once and it is available to every agent that supports skills; declare an MCP server once and it is registered for each agent that speaks MCP. A capability table decides which agent gets which resource, so an agent that does not support a feature is skipped rather than handed a file it cannot read.

Try it

curl -fsSL agents-cli.sh/install.sh | sh