Skip to content

AI rules file formats explained

Short answer: write AGENTS.md. Codex, Cursor and GitHub Copilot read it directly; Claude Code reads it through a one-line @AGENTS.md import in CLAUDE.md (or directly when there is no CLAUDE.md); Gemini CLI reads it with one setting. Add tool-specific files only when you need file-scoped rules.

Comparison

FileLocationRead by
AGENTS.mdAGENTS.mdCodex, Cursor, GitHub Copilot, Claude Code (when no CLAUDE.md), Jules, Zed, Warp, opencode, Devin Desktop, Aider (via config) and 20+ more
CLAUDE.mdCLAUDE.mdClaude Code
Cursor rules (.mdc).cursor/rules/*.mdcCursor
.cursorrules (legacy).cursorrulesCursor (legacy single file)
Copilot instructions.github/copilot-instructions.mdGitHub Copilot (Chat, cloud agent, code review, CLI)
Windsurf rules.windsurf/rules/*.mdWindsurf / Devin Desktop (also reads .devin/rules/)
GEMINI.mdGEMINI.mdGemini CLI