INDEPENDENT CLAUDE LEARNING · NO AFFILIATION WITH ANTHROPIC PBC

Guide · Context & Memory

CLAUDE.md, AGENTS.md or Cursor rules — which does what?

Claude has no memory between sessions except what you put back into the context — and the window is a budget you spend, not a bucket you fill. More in the Context & Memory track.

Every coding agent now reads its own standing-instructions file, and the files are not interchangeable: Claude Code reads CLAUDE.md, Codex reads AGENTS.md, Cursor reads Cursor rules, Copilot reads its own instructions file. The content overlaps almost completely. The loading behaviour does not, and that is where the surprises live.

How does each agent load its instructions file?

CLAUDE.md is additive by directory walk: Claude Code walks up from your working directory and concatenates every CLAUDE.md it finds, nearest file last. AGENTS.md follows the same walk in Codex, but the ecosystem treats it as a single root file in practice. Cursor rules are scoped by glob — a rule fires only when the files you touch match its pattern, which makes them precise and easy to forget. Copilot instructions load once per repository with no directory nesting at all. Same idea, four different answers to "which rules are active right now".

Which file takes precedence?

Nothing arbitrates between them, because nothing knows the others exist. If you keep a CLAUDE.md and an AGENTS.md with different rules, each agent is obeying correctly and you have two products. That is not a merge conflict you can see — it shows up weeks later as two halves of a codebase written to different conventions.

Can you use one file for all of them?

Partly. Symlinking AGENTS.md to CLAUDE.md works and is common, because the content genuinely is the same: commands, conventions, prohibitions, definition of done. What does not survive symlinking is anything agent-specific — Cursor's glob scoping has no equivalent in CLAUDE.md, and Copilot ignores the directory walk entirely. The workable pattern is one source of truth plus a thin generated layer, not four hand-maintained files.

What actually differs between them?

Loading, scoping and precedence — nothing else worth the effort of maintaining separate content. If you find yourself writing a rule for one agent that would be wrong for another, that is usually a sign the rule belongs in code rather than in an instructions file.

Which one should you write first?

The one your primary agent reads, in full, and then generate the rest. Writing four thin files is worse than writing one good one: an instructions file earns its place by being trusted, and a file that contradicts its sibling in the next directory is worse than no file at all.

Where this fits

Standing configuration sits in the Context & Memory part of the track. The recurring judgement is which layer a rule belongs to, and how many tools have to agree on it. Start from what belongs in a CLAUDE.md file, continue with Context, Memory & Config, or browse all guides.

Related in this track

Keep going

Independent practitioner notes from ClaudeMaster.ai. This is not official documentation and is not affiliated with Anthropic PBC. Verify anything version-specific against the vendor’s own docs.

Independence & disclaimer · Your data · Privacy policy · Contact · ©2026 ClaudeMaster.ai