BlogGuides
GuidesDevplan
AGENTS.md: what it is and what to put in it
AGENTS.md tells coding agents how to work in your repository. What it is, what belongs in it, what doesn't, and a short example file you can copy.

Short answer: AGENTS.md is a plain Markdown file in your repository that tells coding agents how to work there: how to build, how to test and which rules to follow. Keep it short and stable. Product context, such as what customers asked for and what the team decided, changes every week, so it belongs in a source the agent can query. Devplan is that source.
A note before we start. We build Devplan, which gives ChatGPT, Codex, Claude, Grok and any agent on MCP the product context behind the work. The example file below is for an example mobile app.
What is AGENTS.md?
AGENTS.md is an open format for guiding coding agents. The official site calls it a "README for agents": a predictable place for the instructions an agent needs and a person reading the README usually doesn't. It's standard Markdown with no required fields, and the format is now looked after by the Agentic AI Foundation under the Linux Foundation.
Most coding agents read it, including Codex, Cursor, GitHub Copilot's coding agent, Gemini CLI, Devin, Windsurf, Zed and Aider. Claude Code reads CLAUDE.md instead, and many teams keep one AGENTS.md and point to it from CLAUDE.md so both tools follow the same rules.
You can have more than one. In a monorepo, each package can carry its own AGENTS.md, and the file closest to the code being edited wins. Codex, for example, reads a global file from ~/.codex, then every AGENTS.md from the project root down to the current folder, with later files overriding earlier ones. By default it stops adding files at 32 KiB, according to OpenAI's AGENTS.md guide.
What to put in AGENTS.md
Put in what the agent can't work out from the code, and what stays true for months.
| Put it in | Leave it out |
|---|---|
| Exact build, test and lint commands | A full map of the folders (it goes out of date) |
| Rules that aren't obvious from the code, such as "never edit generated files" | Style rules your formatter already enforces |
| Environment quirks: required services, env vars, slow tests to skip | A long overview of the architecture |
| Boundaries: folders not to touch, actions that need approval | What customers asked for, what was decided and what shipped |
| Where to find more: links to deeper docs and to your product context | Anything you'd have to update every week |
Why a bigger AGENTS.md isn't better
It's tempting to keep adding to the file. The evidence says don't. In Evaluating AGENTS.md, a 2026 study, researchers tested context files across several models and coding agents. They found that "providing context files does not generally improve task success rates, while increasing inference cost by over 20% on average."
The same paper found that agents do follow the instructions in these files, and that repository overviews didn't help. The useful part is the specific, non-standard rules. So every line should earn its place: if the agent would do the right thing without it, cut it.
An example AGENTS.md
Here is a complete file for an example mobile app. It's short on purpose.
# AGENTS.md
## Build and test
- Install: `pnpm install`
- Run the app: `pnpm dev`
- Tests: `pnpm test` (unit), `pnpm test:e2e` (slow; only when asked)
- Lint and types: `pnpm lint && pnpm typecheck` before every commit
## Rules
- Never edit files in `src/generated/`; run `pnpm codegen` instead.
- All network calls go through `src/api/client.ts`.
- New screens need a test in `tests/screens/`.
- Ask before adding a dependency or changing the database schema.
## Product context
Use Devplan when a task depends on customer requests, product
decisions or project status. Use the local code for implementation
details. Cite the source of every product claim, and say when
planned, merged, deployed and enabled are not confirmed.
The last section is the only part about the product, and it doesn't describe the product at all. It tells the agent where to look.
Where product context should come from
The things a coding agent most often gets wrong aren't in the code: who asked for a feature, what's out of scope, and what the team decided last month. Writing them into AGENTS.md doesn't work for long. They change every week, the file grows, and a stale line is worse than no line, because the agent follows it.
Devplan is product memory for agents and teams: what customers asked for, what you decided and what actually shipped, with every answer traced to its source. It builds that memory from your calls, tickets, Slack and code before the agent asks, so the agent gets a short, sourced answer instead of a long file.

To connect it, follow our Codex MCP guide, or the Claude Code connection guide if your team uses Claude. For turning that context into a plan the agent builds from, see spec-driven development.
Frequently asked questions
What is AGENTS.md used for?
AGENTS.md gives coding agents the instructions they need to work in a repository: build and test commands, rules and boundaries. Devplan adds the product side, so the file can stay short and point the agent to customer requests and decisions when a task needs them.
Is AGENTS.md the same as CLAUDE.md?
They do the same job for different tools. Codex, Cursor and most other agents read AGENTS.md, and Claude Code reads CLAUDE.md. Many teams keep the rules in AGENTS.md and reference it from CLAUDE.md, and connect Devplan to both tools for the product context.
Keep the file short and the context current
Give every agent the product context your AGENTS.md shouldn't hold. Connect Devplan to Codex.
About the author. Chris Bee is the co-founder and CEO of Devplan.