Checked against official docs on
AGENTS.md vs CLAUDE.md vs Cursor rules: who reads what
Short answer: put shared instructions in AGENTS.md. Then add only agent-specific extras: an @AGENTS.md import in CLAUDE.md, .cursor/rules/*.mdc for glob-scoped Cursor rules, and .github/copilot-instructions.md if you need Copilot Chat on GitHub.com.
| File | Claude Code | Codex | Cursor | GitHub Copilot | Antigravity |
|---|---|---|---|---|---|
| AGENTS.md | Yes (v2.1.277+), by default only when no CLAUDE.md exists | Yes: global ~/.codex/AGENTS.md plus one per directory | Yes, root and nested | Most surfaces (not Copilot Chat on GitHub.com) | Yes, any directory, always on |
| CLAUDE.md | Yes (primary) | Only if added to project_doc_fallback_filenames | Not documented | Copilot CLI and cloud agent | Not documented |
| .cursor/rules/*.mdc | /init can import them | No | Yes (.mdc with frontmatter) | No | No |
| .github/copilot-instructions.md | /init can import it | No | No | Yes | No |
| GEMINI.md | No | Only via fallback filenames | No | Copilot CLI and cloud agent | Yes |
| Scoped rules | .claude/rules/*.md (paths) | Nested AGENTS.md / AGENTS.override.md | .cursor/rules (globs) | .github/instructions/*.instructions.md (applyTo) | .agents/rules/*.md (trigger) |
Gotchas
- Claude Code skips AGENTS.md if you have a CLAUDE.md. Add
@AGENTS.mdat the top of CLAUDE.md, or set Project instructions toclaude-md-and-agents-mdin/config. A symlink also works, but it breaks on Windows clones. - Codex reads one file per directory.
AGENTS.override.mdwins overAGENTS.mdin the same folder, and the combined size is capped at 32 KiB by default (project_doc_max_bytes). - Cursor ignores plain .md files in .cursor/rules. Use
.mdcwith frontmatter, or just use AGENTS.md. - Copilot support differs by surface. Code review on GitHub.com reads AGENTS.md only; the CLI also reads CLAUDE.md and GEMINI.md.
- Antigravity rule files need a trigger. AGENTS.md and GEMINI.md need no frontmatter, but every file in
.agents/rules/must declare one.
Convert a rules file between agents →
Frequently asked questions
Yes, since v2.1.277, but by default only when there is no CLAUDE.md, .claude/CLAUDE.md or CLAUDE.local.md in your working directory or above it. Put @AGENTS.md at the top of CLAUDE.md to use both.
Sources
- Claude Code: CLAUDE.md and AGENTS.md · checked 2026-10-16
- Codex: custom instructions with AGENTS.md · checked 2026-10-16
- Cursor: rules · checked 2026-10-16
- GitHub Copilot: custom instructions support · checked 2026-10-16
- GitHub Copilot CLI: custom instructions · checked 2026-10-16
- Antigravity: rules · checked 2026-10-16