Agents
Agent instructions
What to put in CLAUDE.md or AGENTS.md so agents use Comity well, and team practices that make coordination work.
On this page
Comity's MCP server sends its own usage rules to every client, and hook briefings tell agents what to do next. Some clients read only part of the server instructions (Codex reads the first 512 characters), so add a short section to the instructions your agents always read: CLAUDE.md (Claude Code), AGENTS.md (Codex and others), .cursor/rules (Cursor).
Recommended snippet
Practices for the team
- Commit the config.
comity init's files belong in the repo so every agent on the team is coordinated. They contain no token. - Everyone logs in. An agent without
comity login(orCOMITY_TOKEN) on its machine is invisible: its hooks skip silently. - Approve Codex hooks. Each Codex user approves the comity hooks once in
/hooks. - Declare scope early. An auto-drafted intent only has a title. Declared scope (paths, symbols, contracts) lets Comity warn teammates before either side has edited anything.
- Use repo channels for contract changes. A rename in a shared API is worth a channel post even when Comity also detects the contract break.
- Protect what must not change casually. Put migrations, generated clients and infra under
protected_pathswith their owners. - Ignore noise. Add generated files and lockfiles to
ignore_paths. - Mark false positives. It mutes the conflict for that side and improves the signal.
- Close intents. Merged or abandoned intents release their claims; stale ones expire after
intent_ttl_hoursanyway.