AGENTS.md vs CLAUDE.md vs Cursor rules: what goes where
AGENTS.md, CLAUDE.md, Cursor rules and copilot-instructions.md explained: which tool reads which file, and how to keep one source of truth for your team.

If your team uses more than one AI coding tool, you've probably noticed the files multiplying. An AGENTS.md here, a CLAUDE.md there, a .cursor/rules folder, and a .github/copilot-instructions.md that someone added last spring. They all say slightly different things, and nobody is sure which one each tool actually reads.
This isn't talked about clearly enough. From my perspective, it's one of the easiest wins in an AI rollout: get the instruction files right once, and every agent on the team starts from the same picture of your codebase.
Today, we'll walk through what each file is, which tool reads it, and the simple setup I recommend so you maintain one source of truth instead of four.
The Short Answer
Put your shared project instructions in AGENTS.md. Then add thin, tool-specific files only where a tool doesn't read AGENTS.md on its own, or where you need something that only that tool supports.
- AGENTS.md is the cross-tool file. Codex, Cursor, GitHub Copilot's coding agent and many others read it.
- CLAUDE.md is what Claude Code reads. It does not read AGENTS.md by itself, but one line fixes that.
- Cursor rules live in
.cursor/rules/and are for Cursor-specific, file-scoped guidance. - copilot-instructions.md is Copilot's repository-wide instructions file.
Let's look at each one.
AGENTS.md: The Shared File
AGENTS.md describes itself as a simple, open format for guiding coding agents, a "README for agents." It's plain Markdown with no required fields. The project is now stewarded by the Agentic AI Foundation under the Linux Foundation, and the list of tools that support it is long: Codex, Cursor, GitHub Copilot's coding agent, Gemini CLI, Jules, Windsurf, Zed, Junie and more.
What belongs in it is the stuff you'd tell a new teammate on their first day:
- what the project is and how it's laid out
- how to build, test and lint
- code style and conventions
- security rules ("never commit secrets", "don't touch the payments module without a review")
- how you want commits and pull requests written
In a monorepo, you can put an AGENTS.md in each package. Agents read the nearest file in the directory tree, so the closest one to the file being edited wins.
Write AGENTS.md for the agent the way you'd write onboarding notes for a new engineer. Specific, short, and true today.
CLAUDE.md: What Claude Code Reads
Here's the detail that trips teams up. According to Anthropic's documentation, Claude Code reads CLAUDE.md (or .claude/CLAUDE.md), not AGENTS.md.
You don't need to copy your instructions into a second file. The documented approach is a CLAUDE.md that imports AGENTS.md, plus anything that only applies to Claude Code:
@AGENTS.md
## Claude Code
Use plan mode for changes under src/billing/.
A symlink from CLAUDE.md to AGENTS.md also works, but the docs note it needs Administrator privileges or Developer Mode on Windows, so the import is the safer choice for a mixed team.
A few other Claude Code details worth knowing:
- Personal preferences go in
CLAUDE.local.md, which should be in.gitignore. That keeps "I like verbose explanations" out of the team file. - Path-scoped rules can go in
.claude/rules/. A rule with apathslist in its frontmatter only loads when Claude works on matching files, which is handy for something like "all API endpoints need input validation." - Organization-wide instructions can be deployed as a managed
CLAUDE.mdby IT, and users can't exclude them.
Cursor Rules: Scoped Guidance for Cursor
Cursor reads AGENTS.md at the project root and in subdirectories, and combines nested files with their parents. So for most teams, Cursor is already covered by your shared file.
Where Cursor's own rules earn their place is scoping. Project rules live in .cursor/rules/ as .mdc files (a plain .md file in that folder is ignored), and each rule can be set to:
- Always Apply, included in every session
- Apply Intelligently, chosen by the agent from the rule's description
- Apply to Specific Files, matched by a glob like
src/**/*.tsx - Apply Manually, only when someone @-mentions it
On Team and Enterprise plans, admins can also set Team Rules from the dashboard and enforce them so members can't switch them off. That's a good place for the handful of rules you never want ignored.
copilot-instructions.md: GitHub Copilot
GitHub Copilot supports a few kinds of repository instructions:
.github/copilot-instructions.mdapplies to all requests made in the context of the repository..github/instructions/NAME.instructions.mdfiles are path-specific, using anapplyToglob. On GitHub.com these are supported for the cloud agent and Copilot code review.AGENTS.mdfiles are used by AI agents, and the nearest one in the directory tree takes precedence.
One detail I like: Copilot code review reads instructions from the head branch of the pull request. So a change to your review rules is tested on the very PR that introduces it.
Which Tool Reads What
Here's the whole picture in one table. Tools change quickly, so check each vendor's docs (linked above) before you rely on a detail.
| File | Read by | Use it for |
|---|---|---|
AGENTS.md |
Codex, Cursor, Copilot agents, Gemini CLI, and many others | Shared project instructions: the single source of truth |
CLAUDE.md |
Claude Code | One line, @AGENTS.md, plus Claude-only notes |
.claude/rules/*.md |
Claude Code | Rules that apply only to certain paths |
.cursor/rules/*.mdc |
Cursor | Glob-scoped or manually invoked Cursor rules |
.github/copilot-instructions.md |
GitHub Copilot | Repository-wide Copilot guidance |
.github/instructions/*.instructions.md |
Copilot cloud agent and code review | Path-specific Copilot guidance |
The Setup I Recommend
Keep it boring. Boring is what scales across a team.
- Write one AGENTS.md at the root, with nested ones only where a package genuinely works differently.
- Add a two-line CLAUDE.md that imports AGENTS.md, so Claude Code users get the same instructions.
- Only add Cursor or Copilot files for things the shared file can't do, like glob-scoped rules or review-specific guidance. If a line would make sense for every tool, it belongs in AGENTS.md.
- Keep personal preferences out of the repo.
CLAUDE.local.md, Cursor User Rules and personal Copilot instructions exist for exactly this. - Review instruction files like code. They change how every agent behaves in your repository, so changes to them should go through a pull request like anything else.
If a rule would make sense for every tool, it belongs in AGENTS.md. Everything else is the exception.
A quick way to check your setup: ask each tool, in a fresh session, "What are the testing conventions in this repository?" If the answers don't match, your files have drifted.
If you're not sure how ready your team is beyond the instruction files, the free readiness assessment scores five areas of AI adoption in about three minutes.
Common Mistakes
- Copying the same content into every file. It drifts within weeks. Import or reference instead.
- Writing a novel. Every line is loaded into the agent's context, and the important rules get buried. Lead with what the agent can't figure out from the code.
- Stale commands. If
npm testbecamepnpm test:unitthree months ago, the agent will keep running the wrong thing. - Secrets or internal URLs in the file. These files are committed. Treat them as visible to anyone with repository access.
Conclusion
The instruction files are small, but they shape every change an agent makes in your codebase. One shared AGENTS.md, a thin CLAUDE.md that imports it, and tool-specific rules only where you truly need them. That's it.
So, whether you're setting this up for the first time or cleaning up a repository with four competing files, start with the shared file and make the others point to it.
I hope you found this helpful. If you'd like a head start, there's a ready-to-edit AGENTS.md template that works across Claude Code, Copilot and Cursor in the AI-Assisted Development Kit.
Write it once. Point everything at it.