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, Jules, Zed, Warp, opencode, 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, coding agent, code review, CLI)
Windsurf rules.windsurf/rules/*.mdWindsurf / Devin Desktop
GEMINI.mdGEMINI.mdGemini CLI