AGENTS.md & CLAUDE.md Playbook

Files and paths by tool

By agent-playbook · 0 stars

Paths relative to repo root unless shown with `~`.

| Tool | Project file(s) | Reads AGENTS.md | User/global file |
|---|---|---|---|
| Claude Code | `CLAUDE.md` or `.claude/CLAUDE.md`; `CLAUDE.local.md` (personal, gitignored); `.claude/rules/*.md` | By default only when no `CLAUDE.md` or `CLAUDE.local.md` exists in the working directory or above (v2.1.277+) | `~/.claude/CLAUDE.md`, `~/.claude/rules/` |
| OpenAI Codex | `AGENTS.md`, `AGENTS.override.md` | Native | `~/.codex/AGENTS.md` or `~/.codex/AGENTS.override.md` |
| Cursor | `.cursor/rules/*.mdc` (frontmatter required) | Yes, root and subdirectories | User Rules in settings; Team Rules on Team/Enterprise |
| GitHub Copilot (cloud agent, code review) | `.github/copilot-instructions.md`, `.github/instructions/*.instructions.md` | Yes, nearest wins; also a single root `CLAUDE.md` or `GEMINI.md` | Personal and organization instructions on github.com |
| Copilot in VS Code | Same as above | With `chat.useAgentsMdFile`; nested with `chat.useNestedAgentsMdFiles` (off by default); `CLAUDE.md` with `chat.useClaudeMdFile` | User instruction files |
| Gemini CLI | `GEMINI.md` (root, ancestors, subdirectories just in time) | If listed in `context.fileName` in `.gemini/settings.json` | `~/.gemini/GEMINI.md` |
| Windsurf / Devin Desktop | `.devin/rules/*.md` (preferred) or `.windsurf/rules/*.md`; legacy `.windsurfrules` | Yes, always on, no frontmatter | `~/.codeium/windsurf/memories/global_rules.md` |
| Cline | `.clinerules/` or `.cline/rules/` | Yes; also detects `.cursorrules`, `.windsurfrules` | `~/Documents/Cline/Rules` |
| JetBrains Junie | `.junie/AGENTS.md` (preferred); legacy `.junie/guidelines.md` | Root `AGENTS.md` if `.junie/AGENTS.md` is absent | `~/.junie/AGENTS.md` (Junie CLI) |
| Zed | First match of `.rules`, `.cursorrules`, `.windsurfrules`, `.clinerules`, `.github/copilot-instructions.md`, `AGENT.md`, `AGENTS.md`, `CLAUDE.md`, `GEMINI.md` | Yes, first match only, no merge | `~/.config/zed/AGENTS.md` |
| Aider | Files passed with `--read` or `read:` in `.aider.conf.yml` (convention: `CONVENTIONS.md`) | Only with `read: AGENTS.md` | `.aider.conf.yml` in home directory |

### Load order

- Claude Code: At launch, `CLAUDE.md` and `CLAUDE.local.md` from the working directory and every parent, filesystem root first (closer loads later). Subdirectory files load when Claude reads a file there. Managed policy file, cannot be excluded: `/etc/claude-code/CLAUDE.md` (Linux), `/Library/Application Support/ClaudeCode/CLAUDE.md` (macOS). Project instructions setting: `claude-md-or-agents-md` (default), `claude-md-and-agents-md`, `managed-only`, CLAUDE.md only.
- Codex: Git root to cwd, at most one file per directory: `AGENTS.override.md`, then `AGENTS.md`, then `project_doc_fallback_filenames`. Stops at `project_doc_max_bytes` combined (32 KiB default). Both keys in `~/.codex/config.toml`.

- Cursor: Plain `.md` in `.cursor/rules/` without frontmatter is ignored. Frontmatter keys: `description`, `globs`, `alwaysApply`. Legacy `.cursorrules` still read.
- Copilot: Path files use `applyTo` glob frontmatter; optional `excludeAgent` (`code-review` or `cloud-agent`). Precedence: personal, then repository, then organization; all are sent together.

- Gemini CLI: `/memory show` lists loaded files; `/memory reload` after edits. To read AGENTS.md too:

~~~json
{ "context": { "fileName": ["AGENTS.md", "GEMINI.md"] } }
~~~

### Checking what loaded

| Tool | Check |
|---|---|
| Claude Code | `/memory`; an AGENTS.md-only session prints a line naming the loaded file |
| Gemini CLI | `/memory show` |
| Cursor, Windsurf | Rules panel |
| Others | Prompt: "Quote the first line of your project instructions." No answer means not loaded |

### Sources

- https://agents.md/
- https://code.claude.com/docs/en/memory
- https://learn.chatgpt.com/docs/agent-configuration/agents-md
- https://cursor.com/docs/context/rules
- https://docs.github.com/en/copilot/how-tos/configure-custom-instructions/add-repository-instructions
- https://code.visualstudio.com/docs/copilot/customization/custom-instructions
- https://geminicli.com/docs/cli/gemini-md/
- https://docs.devin.ai/desktop/cascade/memories
- https://docs.cline.bot/features/cline-rules
- https://junie.jetbrains.com/docs/guidelines-and-memory.html
- https://zed.dev/docs/ai/instructions
- https://aider.chat/docs/usage/conventions.html