AGENTS.md vs CLAUDE.md vs copilot-instructions.md vs Cursor rules: which file does each tool read?

Guide · updated 30 November 2026

Contents

Claude Code reads CLAUDE.md, Codex reads AGENTS.md, Cursor reads its .cursor/rules files and GitHub Copilot reads .github/copilot-instructions.md, and all four can read AGENTS.md as well, except that Claude Code skips it whenever a CLAUDE.md exists. So a team that mixes tools should keep its shared rules in one AGENTS.md, and start any CLAUDE.md with the line @AGENTS.md so Claude Code reads both.

Here is what each vendor documents, as of 30 November 2026, and below it what each tool read when we tested it.

ToolIts own fileReads AGENTS.md?Reads CLAUDE.md?What wins when both are therePersonal instructions
Claude CodeCLAUDE.md or .claude/CLAUDE.md, plus .claude/rules/Yes, since version 2.1.277, when there is no CLAUDE.mdYesCLAUDE.md only, unless it imports @AGENTS.md or you change the Project instructions setting~/.claude/CLAUDE.md, and CLAUDE.local.md for one project
CodexAGENTS.md, or AGENTS.override.mdYesNo, unless you add it as a fallback nameAGENTS.md. A fallback name counts only in a folder with no AGENTS.md~/.codex/AGENTS.md
Cursor.mdc files in .cursor/rulesYes, in the root and in subfoldersYes, always appliedBoth, merged with your other rules. The docs give no order between themUser rules in Customize, or files in ~/.cursor/rules
GitHub Copilot.github/copilot-instructions.md and .github/instructions/*.instructions.mdIn the CLI, cloud agent, code review on GitHub.com and chat in VS CodeIn the CLI, cloud agent and code review on GitHub.comThe CLI combines all of them with no precedence order. On GitHub.com the nearest AGENTS.md wins~/.copilot/copilot-instructions.md for the CLI, and personal instructions on GitHub.com

From each vendor’s own documentation, read in full on 30 November 2026: Claude Code memory and the Claude Code changelog, Codex and AGENTS.md, Cursor rules and Cursor’s rules help, GitHub Copilot repository instructions, Copilot CLI custom instructions, GitHub’s support table, and the AGENTS.md site.

What did each tool read when we tested it?

We tested on 30 November 2026 on Windows, in Claude Code 2.1.331, Codex CLI 0.164.0 and GitHub Copilot CLI 1.0.114, which updated itself to 1.0.117 partway through. In small git repositories we put a different codeword in each file: “The codeword is KIWI.” in AGENTS.md, PEAR in CLAUDE.md, PLUM in .github/copilot-instructions.md and FIG in an always-applied Cursor rule. We asked each tool to list every codeword in the instructions it was given at startup, without reading a file or running a command, and checked that none did. Our own user settings were left out of Claude Code, and Codex’s fallback list was cleared.

Files in the repositoryClaude Code 2.1.331Codex CLI 0.164.0Copilot CLI 1.0.114 and 1.0.117
AGENTS.md onlyKIWIKIWIKIWI
AGENTS.md and CLAUDE.mdPEARKIWIKIWI, PEAR
All four filesPEARKIWIPLUM, KIWI, PEAR
AGENTS.md, and a CLAUDE.md that starts with @AGENTS.mdPEAR, KIWIKIWILists both files
CLAUDE.md onlyPEARNone. PEAR once CLAUDE.md is a fallback nameLists CLAUDE.md

Copilot’s column needs a note. Its model answered “NONE” twice and refused once, most likely because Copilot CLI’s built-in instructions tell it not to reveal them. Copilot saves each session’s full prompt in a local log, and that log held exactly the codewords shown, in that order. For the last two rows we used copilot instruction list, which shows the files a session would load without asking the model.

Every result matched the vendor’s docs. None of the three read Cursor’s rule, and only Copilot read Copilot’s file. One result goes beyond the docs: Copilot CLI 1.0.117 also listed a file in .claude/rules/ among the instructions it would load, which GitHub’s page doesn’t mention. Cursor isn’t in the table, because there is no Cursor command-line agent on our test machine. By its docs, it reads the rule, AGENTS.md and CLAUDE.md, so FIG, KIWI and PEAR.

Which file does Claude Code read?

CLAUDE.md, from the folder you start in and every folder above it, plus rules in .claude/rules/. A CLAUDE.md in a subfolder loads when Claude works on a file there.

Claude Code has read AGENTS.md since version 2.1.277, released in September 2026. Its changelog for that version says that in a project with no CLAUDE.md, Claude Code reads AGENTS.md instead. Version 2.1.281 extended that to Amazon Bedrock, Google Vertex AI, Microsoft Foundry, LLM gateways and sessions with telemetry turned off.

Any CLAUDE.md, .claude/CLAUDE.md or CLAUDE.local.md in your folder or above it switches AGENTS.md off. That includes a personal CLAUDE.local.md, so adding one quietly drops AGENTS.md for you alone. Your ~/.claude/CLAUDE.md and .claude/rules/ files don’t switch it off.

To read both, set Project instructions in /config to claude-md-and-agents-md. We tried that on the repository with both files and got PEAR, then KIWI: Claude reads each folder’s CLAUDE.md first and its AGENTS.md after. To see what loaded, run /memory.

Which file does Codex read?

Only AGENTS.md, by default. Codex reads a global file from ~/.codex, then one file in each folder from the project root, usually the git root, down to where you’re working: AGENTS.override.md if there is one, otherwise AGENTS.md. Closer files come later in the prompt, so they win a conflict, and Codex stops adding files at 32 KiB unless you raise project_doc_max_bytes.

OpenAI’s Codex docs don’t mention CLAUDE.md, and our test agrees: in a repository with only a CLAUDE.md, Codex saw no codeword. One line in ~/.codex/config.toml changes that:

project_doc_fallback_filenames = ["CLAUDE.md"]

With it, Codex read PEAR from the repository with only a CLAUDE.md, and still only KIWI where an AGENTS.md sat beside it, because a fallback name counts only in a folder with no AGENTS.md.

Which file does Cursor read?

Project rules: .mdc files in .cursor/rules, each with frontmatter that says when it applies. A plain .md file in that folder is ignored. Cursor also reads AGENTS.md in the project root and in subfolders, where a nested file is combined with its parents and the more specific one takes precedence.

Cursor reads CLAUDE.md too. Its rules help says it treats CLAUDE.md the same way as AGENTS.md and always applies it, whatever its frontmatter says, and its CLI docs say the Cursor CLI reads both files at the project root alongside .cursor/rules. The old .cursorrules file still works, but Cursor calls it legacy and says it will be deprecated.

When rules conflict, team rules, which admins set on Team and Enterprise plans, come first, then project rules, then user rules. Cursor’s docs don’t say where AGENTS.md and CLAUDE.md sit in that order. Personal rules live in Customize, synced with your account, or as files in ~/.cursor/rules that stay on one machine.

This section is from Cursor’s docs alone, read on 30 November 2026. We didn’t test Cursor.

Which file does GitHub Copilot read?

It depends where you use it. Copilot’s own files are .github/copilot-instructions.md, for the whole repository, and .github/instructions/NAME.instructions.md files that apply to the paths named in their applyTo frontmatter. GitHub’s support table covers the rest:

  • Copilot CLI reads its own files plus AGENTS.md, CLAUDE.md, .claude/CLAUDE.md and GEMINI.md, from the repository root, your working folder and the folders between. It combines them, drops identical copies and sets no precedence order. Personal instructions go in ~/.copilot/copilot-instructions.md.
  • Copilot cloud agent reads its own files and AGENTS.md, CLAUDE.md or GEMINI.md. On GitHub.com the nearest AGENTS.md takes precedence, or you can use a single CLAUDE.md or GEMINI.md at the root instead.
  • Copilot code review on GitHub.com reads the same files plus REVIEW.md, taken from the branch being reviewed.
  • Copilot Chat in VS Code reads its own files and AGENTS.md, and not CLAUDE.md. On GitHub.com and in Visual Studio, JetBrains IDEs, Eclipse and Xcode, chat reads only Copilot’s own files.

On GitHub.com, personal instructions take priority over the repository’s, and the repository’s over the organisation’s, though Copilot gets all of them.

Don’t check Copilot CLI by asking it what it was told. In our test it answered “NONE” while its saved prompt held the codewords. Run /instructions in a session, or copilot instruction list in the repository, to see which files loaded.

What should a team that mixes tools do?

Keep one AGENTS.md at the root of the repository for the rules everyone shares: build and test commands, conventions, and where things live. Codex, Cursor and Copilot read it, and so does Claude Code 2.1.277 and later when there is no CLAUDE.md.

Add a CLAUDE.md only when you need one: for lines meant for Claude Code alone, for teammates on an older Claude Code, or for sessions that can’t read AGENTS.md directly. Start it with the import, then add the extra lines:

@AGENTS.md

## Claude Code
Use plan mode for changes under src/billing/.

In our test, Claude Code read both files through the import and Codex read only AGENTS.md. If anyone on the team uses Windows, Anthropic’s docs advise the import over a symlink, because git can check a symlink out there as a one-line text file.

Two side effects are worth knowing. Cursor and Copilot CLI read CLAUDE.md as well, so the lines under the import reach them too: write them so another tool can safely ignore them. And because Copilot and Cursor read AGENTS.md beside their own files, don’t paste it into .github/copilot-instructions.md or a Cursor rule. Keep those files for what only that tool needs, such as rules for one path or for code review.

Keep personal preferences in each tool’s personal file from the first table. If your repository has no CLAUDE.md and relies on Claude Code reading AGENTS.md directly, avoid a CLAUDE.local.md, since it stops Claude Code reading AGENTS.md for you.

What belongs in the file, and how to keep it current, is in How to keep CLAUDE.md in sync across a team.

Where does KoalaFix fit?

Rules files hold rules: things that change rarely enough to be reviewed like code. For those, one committed AGENTS.md is the right answer, and you don’t need anything else. A rules file is a poor home for decisions that change from week to week, such as the deploy day the team moved on Tuesday, because each change waits for someone to edit the file and merge it.

KoalaFix is a hosted MCP server that gives every agent on your team one shared memory. Agents save team decisions as they’re made, without being told to, and the newest decision replaces the old one. It works in Claude Code, Codex, Cursor, Claude, ChatGPT, OpenCode, GitHub Copilot and any MCP client, so teammates on all four tools on this page read the same memory. For what each tool remembers by itself, see Which AI coding tools share memory with your team?

Related pages:

KoalaFix is opening soon. Join the waitlist to get in on launch day.