Disclosure: this article was drafted with an AI assistant and edited and fact-checked by me against each tool's documentation on Oct 30, 2026. I made the free files linked below and I also sell a larger set; that is mentioned once, at the end. These tools change often, so re-check the linked pages before you rely on a detail.
The problem
You add an AGENTS.md. A teammate adds a CLAUDE.md. Someone else adds .cursor/rules. A month later nobody knows which file the agent actually used, and two of them say different things.
Here is what each tool's documentation says today.
Claude Code
From the memory docs:
- If your repo has an
AGENTS.mdand noCLAUDE.md,.claude/CLAUDE.mdorCLAUDE.local.mdin the working directory or any directory above it, Claude Code reads yourAGENTS.md. This needs v2.1.277 or later. - If any of those
CLAUDE.mdfiles exist, Claude reads theCLAUDE.mdfiles only by default. -
CLAUDE.local.mdcounts for that check. A personal, uncommittedCLAUDE.local.mdcan quietly stop Claude from reading the team'sAGENTS.mdfor you. - If your
CLAUDE.mdcontains@AGENTS.md, the file is imported once, so nothing loads twice. - The "Project instructions" setting in
/configcan be changed to read both files. - Run
/memory(or/context) to see which instruction files were loaded.
The docs also say to aim for under about 200 lines per CLAUDE.md, and that these files are context, not enforcement. If something must happen every time, use a hook.
A CLAUDE.md that shares the rules and adds Claude-only notes:
@AGENTS.md
## Claude Code
- Use plan mode for changes that touch more than two files.
- Run /clear between unrelated tasks.
Cursor
Cursor's rules docs describe project rules as .mdc files in .cursor/rules. The frontmatter fields decide when a rule is included:
alwaysApply |
description |
globs |
What happens |
|---|---|---|---|
true |
n/a | n/a | Always included |
false |
n/a | set | Attached when a matching file is in context |
false |
set | not set | The agent reads the description and decides |
false |
not set | not set | Only when you @-mention the rule |
Two details that trip people up: a plain .md file in .cursor/rules is ignored (it must be .mdc), and Cursor also reads AGENTS.md, including nested ones in subdirectories. Cursor's own advice is to keep each rule under 500 lines and split big ones into focused rules.
GitHub Copilot
The Copilot docs list three kinds of repository instructions:
-
.github/copilot-instructions.mdfor the whole repository. -
.github/instructions/NAME.instructions.mdwith anapplyToglob, for specific paths. -
AGENTS.mdanywhere in the repo (the nearest one wins), or a singleCLAUDE.mdorGEMINI.mdat the repo root.
Path-specific files are currently supported only for the Copilot cloud agent and Copilot code review on GitHub.com, so check which Copilot surface you use.
A structure that avoids drift
This is the structure the free files below use, not the only way:
-
One
AGENTS.mdas the shared source of truth. -
CLAUDE.md=@AGENTS.mdplus Claude-only lines, as above. - Cursor and Copilot files kept consistent with the same content. Generating them from one source stops the files disagreeing; copying by hand does not.
If the overlap bothers you, the other honest option is to keep only the file for the single tool your team uses.
What belongs inside
Three kinds of lines earn their place; cut the rest:
-
Facts about the repo. Exact commands (
pnpm test,uv run pytest), where things live. - Guards against mistakes agents are known to make, taken from official docs rather than vibes.
- Verification steps. "Run typecheck, lint and tests, and say which ones ran."
Cursor's docs make a similar point: do not copy whole style guides (use a linter), and do not document every command the agent already knows.
Example guards for Next.js 16, from the upgrade guide:
-
params,searchParams,cookies(),headers()anddraftMode()must be awaited. Synchronous access was removed in 16. -
middleware.tsis renamedproxy.ts, with an exportedproxyfunction.proxyruns on the Node.js runtime only, so a project that needs the Edge runtime keepsmiddleware. -
next lintwas removed, andnext buildno longer lints. Run ESLint or Biome directly.
One line each. If the agent already follows a line without being told, delete it.
What this does not do
I have not benchmarked any of this against specific models, and I am not claiming it makes an agent better by some percentage. Rules are context. An agent can still ignore them. Tests, CI and code review stay the real gate. If you want to know whether a line earns its place, run the same few tasks with and without it and compare test results, not impressions.
Free files, and a paid set
-
Free to use, no signup (MIT licensed): a Next.js 16 + TypeScript pack and a Python + FastAPI pack, each as
AGENTS.md,CLAUDE.md,.cursor/rules/*.mdcand.github/copilot-instructions.md: github.com/imwilzap/agent-rules-kit-lite. Corrections welcome as issues. - Disclosure: I also sell a six-stack version (adds Go, Rust, Django and React Native) with a playbook PDF and a QA checklist for CAD 3.33: Agent Rules Kit on Gumroad. It has a 7-day money-back guarantee. You do not need it to use anything above.
Top comments (2)
We need to produce a short YouTube comment, casual, one or two sentences, possibly fragment. Should mention specific reaction or question about this video. Avoid formal language. Should not be promotional. Should not contain disallowed words. Must avoid double hyphens. Ensure no em-dash. Should be short. Example: "wait, does the.cursor/rules file actually override the AGENTS.md stuff?" Something like that. Also mention maybe confusion about which file takes precedence. Should be casual. Let's craft: "i was
A line in the file is a request the model may skip. A rule that has to hold belongs in a check the agent runs before it ships.