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, or make AGENTS.md the single source and import it from CLAUDE.md.

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.

Skills are the command layer on top of these files. To make yours load when they should, see how to write a SKILL.md that actually triggers.

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

FAQ

Why does Cursor ignore my rules file?

Cursor reads project rules from .cursor/rules/*.mdc. A plain .md file in that folder is ignored.

How long should CLAUDE.md be?

Aim for under about 200 lines per CLAUDE.md. Very long files, such as a 600-line CLAUDE.md, hurt adherence. Put always-on essentials in the top file and move stack detail into scoped rules.

How do I scope rules to certain files?

In Cursor use globs, alwaysApply or a description in the .mdc frontmatter. In Claude Code use paths: frontmatter in .claude/rules. For AGENTS.md, the closest AGENTS.md in the directory tree applies.

How do I keep Cursor rules, CLAUDE.md and AGENTS.md in sync?

Keep one master rule set with metadata (always-on or scoped, plus globs) and generate each tool's native file from it, instead of hand-editing three copies that drift apart.

Kit updates, every 2 weeks

One short email every two weeks covering tool format changes (Cursor, Claude Code, Codex, Windsurf, Copilot), new rules and kit updates. No spam.

We store only your email, with our email provider Resend. See the privacy policy.