Cursor .mdc vs CLAUDE.md vs AGENTS.md

By Rogier Muller03.11.26
Cursor .mdc vs CLAUDE.md vs AGENTS.md

Repository instructions help a coding agent discover conventions before changing files. Cursor rules, Claude Code memory and Codex instructions have different loading and scoping behavior. A team using several clients should verify which files each client actually reads instead of assuming that every Markdown file is automatically active.

Put durable guidance in the instruction file

Useful guidance names the important entry points, verification commands and constraints that apply across tasks. Avoid filling these files with completed task transcripts. A future change should inherit repository knowledge, not another task’s temporary assumptions.

Client Instruction surface What to verify
Cursor .cursor/rules/*.mdc Activation mode, description and path scope
Claude Code CLAUDE.md Which memory files load for the working directory
Codex AGENTS.md Directory scope and more specific instructions

Use the current Cursor rules, Claude Code memory and Codex instructions documentation for exact behavior. An instruction describing a permission boundary does not enforce it. Configure and test the actual tool permissions and hooks separately.

Rolling this out in your team?

We train engineering teams on their own codebase in two days. Cursor setup, shared rules and review included.

Keep the task contract beside the task

For a documentation-only change, the task record might say:

Goal: correct installation examples.
Allowed paths: docs/**
Exclude: application code, infrastructure and credentials.
Verification: the repository’s docs lint and link checks.
Handoff: changed paths, commands, observed results and unresolved failures.

This is a proposed task brief, not a completed run. Fill in the real commands before starting, then save their actual outcomes with the pull request. The repository instruction file can require that handoff format without accumulating every historical result itself.

Check the rule in an ordinary change

Pick one recent agent-assisted PR and ask whether its reviewer can identify the intended scope and the evidence for the change. Add the smallest missing instruction, then repeat a similar task. Check whether the client loaded the relevant rule, whether the diff stayed within the brief, and whether the handoff names a real verification result.

For a repository with multiple clients, repeat that small task in each client before treating the instruction files as equivalent. Correct a loading or scope mismatch in the appropriate file. Do not write a fictional precedence clause that promises to override the client’s runtime behavior.

Updated 21 September 2026: corrected instruction-file versus task-log responsibilities and removed assumptions about universal policy precedence.

Train your team on Cursor

Two days on your team's own repository, onsite or remote, with a written proposal before you commit.

Book a call

Prefer to measure first? Take the free team check.