Topic 1 of 4 · 4 min read
Instruction file formats across coding agents
Goal: Map which instruction files each coding agent on a team will read for a repository and find the agent that sees none of the rules.
Every coding agent looks for its own instruction file, so a rule you wrote for one agent is invisible to another until you check which file each one reads.
Check yourself · 1 of 3
A repository has only a CLAUDE.md file. Which statement is safest?
Why it matters
A team rarely uses one agent. One engineer runs Claude Code in a terminal, another uses Cursor, a third uses Copilot in VS Code, and CI runs Codex or Gemini CLI. If the build rules live only in CLAUDE.md, three of those four agents never see them. They will still produce confident code, using the wrong test command and the wrong style.
The common files
AGENTS.md: an open format, read by Codex, Copilot, Cursor, Gemini CLI and many others. It is the closest thing to a shared standard.CLAUDE.md: the file Claude Code loads. Current Claude Code docs also describe readingAGENTS.md, with conditions, so check how your version behaves.GEMINI.md: Gemini CLI's default context file. Its name is configurable, so it can be told to readAGENTS.mdtoo..github/copilot-instructions.md: Copilot's repository-wide file, plus path-specific files under.github/instructions/.- IDE rule files: Cursor rules under
.cursor/rules/, and similar folders in other editors.
How to map it
- List every agent your team actually runs, including CI and the editor.
- For each one, open its docs and write down the file names and folders it loads, and in what order.
- Build a table: rows are agents, columns are the instruction files in your repository.
- Mark each cell: reads it, ignores it, or reads it only in some modes.
- Look for a row with no filled cell. That agent works with no rules at all.
Then test it. Ask each agent, "Which instruction files did you load, and what is the test command?" An agent that cannot name your command is not seeing the file.
Before and after
Before: the repository has CLAUDE.md with "run pnpm test, never edit generated/". A Cursor user asks for a change, and the agent edits generated/api.ts and runs npm test.
After: the same rules sit in AGENTS.md, which Cursor reads, and CLAUDE.md points to it. Both agents behave the same way. The table now shows one source and no empty rows.
What goes wrong
- Assuming a standard means universal support. Tools add
AGENTS.mdat different times and with different rules for nested folders. - Trusting a file name. A file that exists is not a file that is loaded. Path-specific files often need front matter to apply.
- Forgetting CI and review bots. They are agents too, and they often run with the least context.
Examples
The empty row
A team table has four agents. Claude Code reads CLAUDE.md. Codex reads AGENTS.md. Copilot reads .github/copilot-instructions.md. Cursor is used by two engineers but the repository has no .cursor/rules/ and no AGENTS.md. Cursor is the agent that sees none of the rules. The fix is one AGENTS.md, not a fourth copy.
Proving a file loads
Ask each agent in a fresh session: "List the instruction files you loaded and quote the test command." Gemini CLI answers correctly. Copilot quotes a command from an older file. That points to a stale .github/copilot-instructions.md to update.
Key points
- Each coding agent reads its own instruction files, so a rule in one file is invisible to agents that read others.
- AGENTS.md is the closest shared format, but support and loading rules differ by tool and version.
- Build a table of agents against instruction files, and look for any agent whose row is empty.
- Verify loading by asking the agent which files it read and what your test command is.
- CI jobs, review bots and editors count as agents and need the rules too.
Common mistakes
- Writing rules only in the file of the agent you use yourself.
- Assuming every agent reads
AGENTS.mdwithout checking its docs. - Checking that a file exists instead of checking that the agent loaded it.
- Leaving CI agents and review bots off the map.
Check yourself · 2 of 3
What is an AGENTS.md file in a repository?
Check yourself · 3 of 3
How do you confirm an agent actually loaded your instruction file?
Practice items, not counted towards your mastery.
Start here
- AGENTS.md (opens in a new tab)DocsFree
The open instruction-file format and the list of agents that read it.
- Agent Skills open format (opens in a new tab)StandardFree
The open SKILL.md format and which agents support it.
- How Claude remembers your project (Claude Code docs) (opens in a new tab)DocsFree
How Claude Code loads CLAUDE.md and AGENTS.md, imports and symlinks.
More for this topic
- Custom instructions (VS Code docs) (opens in a new tab)DocsFree
Which instruction files VS Code agent mode loads.