Quick Start
This guide walks through installing AgentMesh and setting it up in a git repository. The whole process takes about 10 minutes.
Prerequisites
- OS: macOS, Linux, or Windows
- Git repository at your project root
- At least one supported runtime present or planned:
- Claude Code (
.claude/and/orCLAUDE.md) - Codex (
.codex/and/orAGENTS.md)
- Claude Code (
AgentMesh can bootstrap from an empty repo, but the typical case is importing existing Claude or Codex configuration.
Step 1: Install AgentMesh
macOS / Linux:
curl -fsSL https://agentmesh.sh/install.sh | sh
Windows (PowerShell):
irm https://agentmesh.sh/install.ps1 | iex
Verify the installation:
agentmesh --version
The installer also prints the recommended first repo commands:
agentmesh scan
agentmesh init
agentmesh status
See Install with the official script for upgrade and uninstall options.
Step 2: Initialize AgentMesh
From your project root, run the one-time setup:
cd /path/to/your/repo
agentmesh init
init scans the repository, then:
- Detects Claude and Codex artifacts
- Imports existing entities into the canonical
.ai/model - Propagates entities to other detected runtimes
- Installs hooks into machine-local overlay files (
.claude/settings.local.json,.codex/hooks.json) - Writes
agentmesh.lock
If no runtimes are detected, init still sets up the canonical structure for when you add them later.
agentmesh scan shows the same detection output as the first phase of init, but makes no changes. Use it when you want a read-only preview — for example, before running init in a repo you did not set up yourself.
The AGENTS.md vs CLAUDE.md prompt
If both AGENTS.md and CLAUDE.md exist with different content, init asks which agent memory file to use as the starting version for initial setup:
⚠ Detected divergent project instructions:
AGENTS.md (last modified 2026-05-20T14:32:11Z, 3,452 bytes)
CLAUDE.md (last modified 2026-05-24T09:11:03Z, 3,612 bytes)
The agent memory files are different.
Choose which one AgentMesh should use for the initial setup.
AgentMesh will sync the other runtime's file from this starting version.
[1] Use AGENTS.md
[2] Use CLAUDE.md
Choice [1 or 2]:
This choice only seeds the initial setup. After setup, sync is bidirectional and later edits can come from either runtime file. For CI or scripts, pass a flag:
agentmesh init --canonical-instructions=AGENTS.md
# or
agentmesh init --canonical-instructions=CLAUDE.md -y
Codex trust prompt
If Codex is detected, init installs a hook into .codex/hooks.json. Codex requires you to review and trust new command hooks before they run. On your next Codex tool call, Codex will prompt:
Trust the new hook '/Users/you/.local/bin/agentmesh sync --trigger=codex-hook --silent'?
Approve once. Until then, sync still works via the watcher daemon, manual agentmesh sync, and optional git pre-commit hooks — but Codex's PostToolUse hook itself will not fire.
Recommended gitignore entries
Add these to your .gitignore (AgentMesh does not modify .gitignore for you):
# AgentMesh — machine-local hook files (each developer has their own binary path)
.codex/hooks.json
.claude/settings.local.json is already gitignored by Claude Code's convention.
Step 3: Verify everything works
agentmesh status # fast snapshot (under 50ms)
agentmesh doctor # deep health check
Healthy output ends with ✓ All checks passed.
Test sync manually
Edit a skill in one runtime, then check the other:
# After editing .claude/skills/security-review/SKILL.md in Claude Code:
agentmesh diff # preview what would change
agentmesh sync # force a sync pass (usually automatic via hooks)
Or edit directly and wait — the hook fires after Claude/Codex tool calls that write files.
Step 4: Commit the shared state
Commit the files teammates need:
git add AGENTS.md .ai/ agentmesh.lock
git commit -m "chore: initialize AgentMesh sync"
Do not commit .claude/settings.local.json or .codex/hooks.json — each teammate runs agentmesh init (or agentmesh install --runtime <name>) on their machine.
See Repository Setup for the full teammate workflow.
Common next steps
| Situation | What to run |
|---|---|
Added .codex/ after init (Claude-only repo) | agentmesh install --runtime codex |
| Want commit-time drift check | agentmesh install --git-pre-commit |
| Upgraded AgentMesh binary | agentmesh upgrade |
| CI pipeline | agentmesh sync --check — see CI Integration |
| Something looks wrong | agentmesh doctor |
Init flags reference
| Flag | Purpose |
|---|---|
--canonical-instructions=AGENTS.md | Non-interactive: use AGENTS.md as the starting agent memory file during init |
--canonical-instructions=CLAUDE.md | Non-interactive: use CLAUDE.md as the starting agent memory file during init |
-y, --yes | Skip confirmation prompts |
--dry-run | Show what init would do without writing |
--skip-hooks | Set up canonical state + lockfile only; add hooks later with install |
Next steps
- Repository Setup — teammate onboarding, file layout, gitignore
- CLI Reference — every command and exit code
- Configuration — optional
agentmesh.config.yaml - FAQ — troubleshooting