Blog · guide
AGENTS.md: what it is, which tools read it, and a template
The shared instruction file for coding agents: who reads it, how it works alongside CLAUDE.md, and a real one with annotations.
AGENTS.md is a plain Markdown file in a repository that tells coding agents how to work there: how to build and test, which conventions to follow, and which rules a newcomer would need. The project calls it “a README for agents.” It has no schema and no required fields. Any agent that supports the format reads it as project instructions, so one file can serve several tools.
This guide covers what the format is, which tools read it (each checked against that tool’s own docs), how it relates to CLAUDE.md and other tool-specific files, a starter template, and the AGENTS.md from our own repository, annotated.
Last verified: October 12, 2026.
What is AGENTS.md?
AGENTS.md is an open format. According to the Linux Foundation’s announcement, OpenAI released it in August 2025, and on December 9, 2025, it became one of the founding projects of the Agentic AI Foundation, alongside Anthropic’s Model Context Protocol and Block’s goose. The agents.md site now describes it as stewarded by that foundation and used by more than 60,000 open-source projects.
The reasoning behind a separate file is simple. A README is written for people: a quick start, a project description, how to contribute. Agents need more operational detail, like exact commands, test steps and conventions, which would clutter a README.
A few properties of the format, from the agents.md FAQ:
- It’s plain Markdown. Use whatever headings you like. Nothing is required.
- Nested files are allowed. In a monorepo, each package can have its own AGENTS.md. Agents read the nearest file in the directory tree, so the closest one wins.
- The chat wins over the file. An explicit instruction in the conversation overrides what AGENTS.md says.
Which coding agents read AGENTS.md?
The agents.md site lists more than twenty tools. We checked the widely used ones against their own documentation. “By default” means no configuration is needed.
| Tool | Reads AGENTS.md? | How |
|---|---|---|
| OpenAI Codex | Yes, by default | A global file in ~/.codex, then one file per directory from the project root down to the working directory. AGENTS.override.md beats AGENTS.md in the same directory. The combined size is capped at 32 KiB by default |
| Claude Code | Yes, from v2.1.277, when there’s no CLAUDE.md | If a CLAUDE.md, .claude/CLAUDE.md or CLAUDE.local.md exists in the working directory or above, Claude reads those instead. A setting can load both |
| Cursor | Yes, by default | Root and nested subdirectories. More specific files take precedence. Cursor also reads CLAUDE.md |
| GitHub Copilot | Yes, on most agent surfaces | Cloud agent, code review and Copilot CLI read AGENTS.md, CLAUDE.md or GEMINI.md. Copilot Chat in VS Code reads AGENTS.md. The nearest AGENTS.md takes precedence |
| Devin Desktop (formerly Windsurf) | Yes, by default | A root AGENTS.md is an always-on rule. One in a subdirectory applies when the agent reads or edits files in that directory |
| Gemini CLI | With configuration | The default file is GEMINI.md. Add AGENTS.md to context.fileName in settings.json |
| opencode | Yes, by default | Reads AGENTS.md, and falls back to CLAUDE.md only when there’s no AGENTS.md |
Look at the last row next to the Claude Code row. When a repository has both an AGENTS.md and a CLAUDE.md, opencode reads AGENTS.md and Claude Code reads CLAUDE.md. Two tools, opposite defaults, and each one sees a different file. That’s the strongest argument for having one source of truth and making every other file point at it.
AGENTS.md vs CLAUDE.md and other tool-specific files
Tool-specific files haven’t gone away, because they offer features a plain Markdown file can’t:
| Tool | Its own instruction files | What they add |
|---|---|---|
| Claude Code | CLAUDE.md, CLAUDE.local.md, .claude/rules/*.md |
@path imports, paths scoping, personal and managed-policy scopes |
| Cursor | .cursor/rules/*.mdc |
Four activation modes via alwaysApply, globs and description |
| GitHub Copilot | .github/copilot-instructions.md, .github/instructions/*.instructions.md |
applyTo scoping, and excludeAgent to hide a file from code review or the cloud agent |
| Devin Desktop | .devin/rules/*.md (legacy .windsurf/rules/) |
Four activation modes via a trigger field |
| Gemini CLI | GEMINI.md |
The default context file |
The pattern that works is to put everything shared in AGENTS.md and keep tool-specific files thin.
- Claude Code. Add a CLAUDE.md whose first line is
@AGENTS.md, then any Claude-only instructions below it. Claude reads the imported file first. A symlink (ln -s AGENTS.md CLAUDE.md) also works, but Claude Code’s docs point out two catches: Claude’s edit tools won’t write through a symlink, and on Windows a committed symlink can check out as a one-line text file. - Gemini CLI. Set
context.fileNameto includeAGENTS.md. - Codex, Cursor, Copilot, Devin Desktop, opencode. Nothing to do.
Two mistakes to avoid. Don’t copy AGENTS.md into CLAUDE.md, because copies drift, so import instead. And
in Claude Code, a CLAUDE.local.md for private notes counts as a CLAUDE.md, so adding one stops Claude
from reading AGENTS.md unless you set Project instructions to claude-md-and-agents-md.
What should go in AGENTS.md? A starter template
Start small and add a line each time an agent gets something wrong that a newcomer would also have got wrong. This skeleton covers what most repositories need:
# AGENTS.md
## Project
One paragraph: what this repository is and who uses it.
Source of truth for product decisions: docs/decisions.md
## Commands
- Install: `bundle install`
- Test: `bundle exec rake test`
- Lint: `bundle exec rubocop`
- Before finishing a task, run the tests and the linter and fix what fails
## Layout
- app/ holds the web app; lib/ holds code shared with workers
- db/schema.rb is generated. Never edit it by hand
## Conventions
- Only the ones that differ from this stack's usual defaults
## Rules, with reasons
- Never call the payments API from a controller, because retries must go through the job queue
- Keep public copy in content/, because marketing edits it without touching code
## Pull requests
- Title format, commit style, what reviewers check first
Keep it short. Codex stops reading at 32 KiB of combined instructions by default, and Claude Code’s docs recommend under 200 lines per file because longer files reduce adherence. Leave out what an agent can read from the code, such as directory tours and dependency lists. They go stale, and every line costs context in every session.
Our AGENTS.md, annotated
The DawnLoop repository has an AGENTS.md of about 90 lines and no CLAUDE.md. Its most important section is “Claim Discipline.” Here it is, unedited:
## Claim Discipline
This project is pre-code. The fastest way to damage it is to write checks the architecture can't cash,
so every capability claim carries a status marker and agents must preserve them:
- **[shipped]** — exists and works. Currently: nothing.
- **[planned]** — designed, buildable with current technology, not yet built.
- **[research bet]** — may not work. Must be gated behind an eval before it reaches a customer.
**Never write a [planned] or [research bet] capability in the present tense in user-facing copy.**
"DawnLoop consolidates every night" is a claim about software that does not exist. "DawnLoop will" or
"DawnLoop is designed to" is honest. This applies to the landing page, the README, and anything external.
Here’s why it works, and where it stops working.
- It opens with the stakes. “The fastest way to damage it is to write checks the architecture can’t cash.” An agent that knows why a rule exists can apply it to cases the rule doesn’t list, like a page title, a meta description or an image caption.
- It defines a closed vocabulary. Three markers with exact meanings, plus the current state (“Currently: nothing”). An agent can check any sentence against them, and so can a reviewer.
- It shows a wrong sentence and a right one. “Consolidates every night” next to “is designed to” teaches the rule faster than a paragraph of explanation would.
- It says where the rule applies. User-facing copy: the landing page, the README, anything external. Internal planning documents can keep using the markers directly.
- It can’t enforce anything. Every tool in the table above treats AGENTS.md as context. So our
content pipeline adds a second gate: each page carries a
claims_reviewedflag that a person sets after checking every capability sentence, and the build refuses to publish a page without it. The page you’re reading was drafted by an agent working under this rule, and it still had to pass that review before it was published.
The “Key Concepts” section uses another pattern worth copying. Several entries end by naming an older framing that was dropped, the reason it was dropped, and an instruction not to bring it back. Agents read commit history and old documents too. A line that says “this was removed on purpose” stops them from restoring it.
For a walkthrough of the Claude Code side, including how this repository’s file loads, see Claude Code memory. The equivalents for other tools are in Cursor rules and memories and GitHub Copilot instructions and memory, and our comparison of what each assistant remembers puts them side by side.
What we’re building (in development)
An AGENTS.md is long-term memory that a person writes and maintains by hand, and it’s the right place for rules a team has agreed on. DawnLoop, which is in development, is designed to add the part a file can’t do: build beliefs from what actually happened in a codebase, attach the evidence, and retire beliefs that later outcomes contradict. Our guide to long-term memory for AI agents covers where each approach fits.