Every coding agent wants a file of standing instructions in your repository. Codex, Cursor, Gemini CLI and GitHub Copilot's coding agent read AGENTS.md. Claude Code reads CLAUDE.md. Teams that use more than one tool end up with two files that slowly drift apart, and an agent that follows the stale one.
What each file is
AGENTS.md is an open format: a README written for agents. It is stewarded by the Agentic AI Foundation under the Linux Foundation, and agents.md lists more than twenty tools that read it. In a monorepo you can put one in each package, and the file closest to the code being edited wins.
CLAUDE.md is Claude Code's own instructions file. It can live in the repository, in your home folder for personal preferences, or as a CLAUDE.local.md that you keep out of version control.
What Claude Code reads
As of October 2026, Claude Code's documentation says:
- Only an `AGENTS.md`: Claude Code reads it.
- Both files: it reads only
CLAUDE.md, unlessCLAUDE.mdimports the other. - An `AGENTS.md` and a `CLAUDE.local.md`: the local file counts as a
CLAUDE.md, so yourAGENTS.mdsilently stops loading.
Older versions read CLAUDE.md only, which is why many guides still say Claude Code ignores AGENTS.md. This changes quickly, so check your tool's documentation rather than a blog post, this one included.
One file, two names
Write the instructions once, in AGENTS.md, because more tools read it. Then make CLAUDE.md a single line that imports it:
@AGENTS.mdClaude Code expands the import, and every other tool reads AGENTS.md directly. Add any Claude-specific notes below the import. A symbolic link also works, but the import needs no extra setup on Windows.
What belongs inside
The file is loaded into every session, so every line costs attention. Claude Code's documentation suggests staying under 200 lines, because long files make each instruction less likely to be followed. Include what an agent cannot work out from the code:
- Commands: how to install, build, run one test and run them all.
- Conventions that differ from the defaults: the test runner, where new modules go, how errors are reported.
- Fences: files and folders the agent must not touch, such as migrations, generated code and other teams' packages.
- The finish line: what done means, for example "tests and type check pass, and the diff contains only the files the task named".
Leave out what the code already says, long explanations and anything that changes every week.
Instructions are not enforcement
An instructions file is advice. An agent can read "never edit the tests" and still edit them when a test is in its way. Anything that must never happen needs a check that does not depend on the agent: a hook, a CI rule, or a look at git diff --name-only before you merge.
Our AI coding guidelines cover the team rules that belong in this file. Chapter 4 of the free book Checked, Not Trusted shows how to fence an agent's job and prove it stayed inside.