In Plain Words

Open a repository that ships an AGENTS.md and it usually reads like the notes a senior engineer gives a new hire: install with this command, run tests like that, never edit the generated folder. The reader is the agent. The spec site draws the line between the two audiences: README.md is for humans (quick starts, project descriptions, contribution guidelines), while AGENTS.md carries the "build steps, tests, and conventions that might clutter a README or aren't relevant to human contributors."

A coding agent such as Codex, Claude Code or GitHub Copilot's agent is a model running in a loop that reads files, runs commands and edits code. The harness around that model decides what enters its context window, the fixed amount of text the model can see at once. AGENTS.md is a file the harness loads there when a session starts, so the agent begins with the project's rules instead of inferring them from the code.

It has no required fields. Asked about them, the spec's FAQ answers: "No. AGENTS.md is just standard Markdown. Use any headings you like." What makes it a format is the fixed filename and the agreement among tools about where to look for it.

How It Works

  1. You commit an AGENTS.md at the repository root. In a monorepo you can add more, one inside each package that needs its own rules.
  2. When a session starts, the agent reads the file into its instructions. Per the spec, agents "automatically read the nearest file in the directory tree".
  3. If two files disagree, "the closest AGENTS.md to the edited file wins; explicit user chat prompts override everything."
  4. Commands in the file get run. Per the FAQ, the agent "will attempt to execute relevant programmatic checks and fix failures before finishing the task" if you list them.

This is the sample from the spec site, complete:

# AGENTS.md
## Setup commands
- Install deps: `pnpm install`
- Start dev server: `pnpm dev`
- Run tests: `pnpm test`
## Code style
- TypeScript strict mode
- Single quotes, no semicolons
- Use functional patterns where possible

The spec stops at "closest wins". Each agent implements loading its own way, so when an agent seems to ignore AGENTS.md, the file is often fine and the tool reading it follows different rules.

AgentWhat it loadsRule that trips people up
CodexOne file per directory from the project root (usually the Git root) down to the current directory, concatenated root first, so deeper files override earlier onesAGENTS.override.md beats AGENTS.md in the same directory; the total is capped by project_doc_max_bytes (32 KiB by default)
Claude Code (v2.1.277 and later)Every AGENTS.md and .claude/AGENTS.md from the working directory upward at session start, plus a subdirectory's file when it reads a file there and that subdirectory has no CLAUDE.md of its ownOnly when no CLAUDE.md, .claude/CLAUDE.md or CLAUDE.local.md exists in the working directory or above; ignores AGENTS.override.md. Before v2.1.281, sessions on Amazon Bedrock or with telemetry disabled read CLAUDE.md only
GitHub CopilotAGENTS.md files stored anywhere in the repositoryThe nearest one in the directory tree takes precedence; a single root CLAUDE.md or GEMINI.md is accepted instead
Gemini CLI, AiderAGENTS.md after one line of config, per the spec's FAQGemini CLI: "fileName": "AGENTS.md" under "context" in .gemini/settings.json. Aider: read: AGENTS.md in .aider.conf.yml

Claude Code's rule catches anyone who adds a personal CLAUDE.local.md to a project that relies on AGENTS.md: that file counts as a CLAUDE.md, so Claude Code stops reading the shared one. Setting Project instructions to claude-md-and-agents-md in /config loads both. In a repository that keeps both files on purpose, Claude Code's docs show an import at the top of CLAUDE.md:

@AGENTS.md

## Claude Code

Use plan mode for changes under `src/billing/`.

A symlink is the other documented bridge: ln -s AGENTS.md CLAUDE.md. We ran it in a fresh repository on git 2.54: it prints nothing, and git commits the link with mode 120000. Claude Code's docs recommend the import instead for anyone on Windows, where Git checks a committed symlink out as a plain text file unless core.symlinks is enabled, leaving a one-line CLAUDE.md in place of the instructions.

Why It Matters

Before AGENTS.md, each agent had its own file: .cursorrules or .cursor/rules/ for Cursor, .github/copilot-instructions.md for Copilot, CLAUDE.md for Claude Code. A team using two agents needed two files saying the same thing. The spec's authors chose "a name and format that could work for anyone", and the Linux Foundation's December 2025 announcement listed Amp, Codex, Cursor, Devin, Factory, Gemini CLI, GitHub Copilot, Jules and VS Code among the tools that had adopted it.

Whether the file helps depends on what is in it, and the two published evaluations agree once you read what each measured. Vercel's January 2026 evals put an 8KB compressed framework docs index into AGENTS.md and reached a 100% pass rate, against 53% with no docs and 79% for a skill with explicit instructions to use it. In 56% of eval cases the skill was never invoked. A paper by Gloaguen et al., first posted in February 2026, tested context files on real repository issues and found they "do not generally improve task success rates" while raising inference cost by over 20%. Agents followed the instructions; the repository overviews just did not help.

So the file earns its place with what an agent cannot infer and must not miss: the exact test and lint commands, conventions that differ from the ecosystem default, docs for APIs newer than the model. The architecture tour can go. The paper's authors call context files useful for "specifying non-standard coding practices", and every line is paid for in every session, from the same context budget that MCP tool definitions and skills compete for.

AGENTS.md is also guidance rather than a guardrail. Claude Code's docs say instruction files are treated "as context, not enforced configuration"; blocking an action takes a PreToolUse hook. A subagent that starts without project instructions starts without AGENTS.md too.

Origin

OpenAI released AGENTS.md in August 2025, and the agentsmd/agents.md repository was created on 19 August 2025. The spec site credits a collaboration that included OpenAI Codex, Amp, Jules from Google, Cursor and Factory. On 9 December 2025 the Linux Foundation formed the Agentic AI Foundation with AGENTS.md, Anthropic's Model Context Protocol and Block's goose as founding projects, and that foundation now stewards the format.

Common Confusions

TermWhat it isHow it differs from AGENTS.md
CLAUDE.mdClaude Code's own instruction file, with @path importsBy default Claude Code reads one or the other, not both. Copilot accepts a root CLAUDE.md as an alternative to AGENTS.md
Agent Skills (SKILL.md)A folder per task with a SKILL.md, in an open format Anthropic startedLoaded on demand: only the name and description at startup, the full instructions when a task matches. AGENTS.md is in context from the start
README.mdProject documentation for human contributorsAGENTS.md holds the agent-only detail so the README can stay "concise and focused on human contributors"
AGENT.mdAn older singular spellingNot the spec's name. The FAQ's migration is mv AGENT.md AGENTS.md && ln -s AGENTS.md AGENT.md
AGENTS.override.mdA Codex file that takes priority over AGENTS.md in the same directoryCodex-only. Claude Code does not read it
.cursorrules, copilot-instructions.mdRule files tied to one tool eachAGENTS.md was designed so one file works across agents