Instructions
What it is. The text an agent reads at the start of every session: how to build, test and work in your repository.
Where it goes. AGENTS.md at the repository’s root (~/.agents/AGENTS.md
for your own, at user scope).
What each agent gets
Section titled “What each agent gets”| Agent | Gets |
|---|---|
Codex, Factory Droid, Copilot, Cursor, Devin, any AGENTS.md agent |
nothing written: it reads AGENTS.md where it is (shared … in place) |
| Pi, OpenCode, Kilo Code, Qwen Code | the same, when AGENTS.md is the file they choose; else a copy in the file they read |
| Claude Code | @AGENTS.md in CLAUDE.md, so it always loads it |
| Gemini CLI | AGENTS.md added to context.fileName in .gemini/settings.json |
Because Claude Code and Gemini CLI are pointed at the file, an edit to
AGENTS.md reaches every agent at once, without installing again.
As a tool
Section titled “As a tool”A tool’s instructions are text placed between its own markers in each agent’s instructions file, so they sit beside the user’s text without touching it:
<!-- mytool:harness -->Run `mytool check` before you finish.<!-- /mytool:harness -->instructions = "Run `mytool check` before you finish.\n"# or a file, copied: instructions = { file = "agent/instructions.md" }# or a source, read where it is: instructions = { from = "AGENTS.md" }Integration::new().instructions("Run `mytool check` before you finish.\n")// or Integration::new().instructions_from("AGENTS.md"){ instructions: "Run `mytool check` before you finish.\n" }{"instructions": "Run `mytool check` before you finish.\n"}Limits
Section titled “Limits”- Cursor has no instructions file at user scope (its user rules are not files).
- An agent that loads
AGENTS.mdandCLAUDE.mdboth (Copilot, Devin) reads text in both; the install warns when it could read something twice.