Which file(s) should a repo maintain for AI coding agent rules across Claude Code, Codex, and Cursor, given each tool historically expected a different filename?

· verified Jul 5, 2026

Fix: AGENTS.md is a real, tool-agnostic markdown convention (plain markdown, no required structure) that Codex reads via a global-then-project precedence chain before doing any work. Claude Code does NOT read AGENTS.md directly — it reads CLAUDE.md — but officially documents a compatibility pattern for repos that already have an AGENTS.md: either symlink it (ln -s AGENTS.md CLAUDE.md) or add a one-line @AGENTS.md import at the top of CLAUDE.md, optionally appending Claude-specific instructions below the import. Cursor's actively maintained format is .cursor/rules/*.mdc (YAML frontmatter: description, globs, alwaysApply) for rules that should auto-attach to specific file globs; .cursorrules still loads but is silently ignored in Cursor's Agent mode. Note: a file named agents.md isn't always used the same way across tools — at least one Antigravity codelab uses .agents/agents.md specifically to define team personas/roles rather than general repo-wide coding conventions, so don't assume identical semantics everywhere without checking that tool's own docs.

agent-rulesagents.mdclaude-codecursorcodex

References