Every AI coding tool has its own instruction file convention. Cursor uses .cursorrules. GitHub Copilot reads copilot-instructions.md. Claude Code looks for CLAUDE.md. OpenAI Codex and a growing number of agentic coding tools have settled on a different name: AGENTS.md. If you are using any agentic coding workflow in 2026, this is the file that determines whether the agent works correctly or keeps surprising you.
What AGENTS.md does
An AI coding agent entering your repository has no context. It does not know your team's naming conventions, which files are safe to modify, what your test runner expects, or why a particular architectural decision was made. AGENTS.md is how you give it that context before it starts.
When a tool like OpenAI Codex CLI picks up a task, it reads AGENTS.md first. The instructions in that file constrain what the agent does: where it can write, what commands it can run, how it should format output, and what it should ask before acting rather than assume. Without it, the agent guesses.
The file sits at the root of your repo. Some tools also support AGENTS.md files in subdirectories, where they override or extend the root-level instructions for that specific part of the codebase.
What to put in your AGENTS.md
Good AGENTS.md files are short and specific. The goal is not to write documentation for humans; it is to give an autonomous agent the minimum information it needs to behave correctly without supervision.
