Home › Articles

Cursor rules vs CLAUDE.md vs AGENTS.md: which file does what

Updated 2026-10-16

In short: each tool reads its own file. Cursor reads .cursor/rules/*.mdc, Claude Code reads CLAUDE.md plus .claude/rules, and Codex (and others) read AGENTS.md. Write the rules once and generate all three.

CursorClaude CodeCodex / AGENTS.md
Location.cursor/rules/*.mdcCLAUDE.md, .claude/rules/*.mdAGENTS.md (nested files allowed)
Scopingglobs, alwaysApply, or description-basedpaths: frontmatter in .claude/rulesThe closest AGENTS.md in the directory tree
Size guidanceUnder 500 lines per ruleUnder ~200 lines per CLAUDE.md32 KiB default cap
CommandsManual @rules.claude/skills/*/SKILL.md.agents/skills/*/SKILL.md

The common mistake

People put a plain .md in .cursor/rules, which Cursor ignores, or a 600-line CLAUDE.md, which hurts adherence. A second mistake is keeping three hand-edited copies that drift apart.

A setup that works

  1. Keep one master rule set with metadata: always-on or scoped, plus globs.
  2. Generate each tool's native file from it.
  3. Put always-on essentials in the top file and move stack detail into scoped rules.
  4. Verify with each tool's context view, for example Claude Code's /context.

Every kit is built this way. The free sampler shows the output for all five tools.