The short answer: Cursor rules are instruction files the Agent reads so you stop repeating yourself. Project rules live in .cursor/rules/ as .mdc files with a short frontmatter block, and each one is set to apply in one of four ways: always, when the Agent judges it relevant, when matching files are open, or only when you @-mention it. A plain AGENTS.md in the project root is the simpler alternative. Cursor’s own guidance is to keep each rule under 500 lines and to add rules only after the Agent repeats a mistake.
The four rule types
From Cursor’s rules documentation, checked 29 September 2026. The type is set by the frontmatter, which has three fields: alwaysApply, description and globs.
| Type | When it is included | Frontmatter that sets it | Use it for |
|---|---|---|---|
| Always Apply | Every chat session | alwaysApply: true | Short facts true everywhere: package manager, test command |
| Apply Intelligently | Agent decides from the description | alwaysApply: false plus a description | Topic guidance, such as frontend component standards |
| Apply to Specific Files | Files matching the glob are in play | globs with * and ** patterns | Language- or folder-specific conventions |
| Apply Manually | You @-mention it, for example @my-rule | No trigger fields | Rarely needed procedures |
Two format details cause most confusion. Project rules must use the .mdc extension; plain .md files in the rules folder are ignored, except the special AGENTS.md. And you rarely need to write the file by hand: typing /create-rule in Agent and describing what you want generates it with frontmatter and saves it to .cursor/rules.
Three places instructions can live
| Where | Scope | Notes from the docs |
|---|---|---|
.cursor/rules/*.mdc | The project, version-controlled | Structured, with the four types above |
AGENTS.md (root or subfolders) | The project | Plain markdown, “without the overhead of structured rules”; nested files in subdirectories are supported |
| User Rules (Customize, then Rules) | All your projects | Apply to Agent chat only, not Inline Edit or other AI features |
| Team Rules | An organisation, on Team and Enterprise plans | Set from the dashboard |
When they conflict, precedence runs Team Rules, then Project Rules, then User Rules; all applicable rules are merged and the earlier source wins.
What to put in a rule
Cursor’s guidance, paraphrased: keep rules focused and under 500 lines, split large ones into composable pieces, point at files instead of copying them, do not restate a style guide or common commands, and start small, adding a rule when you see the Agent make the same mistake twice.
A worked layout for a small web app, our example rather than Cursor’s:
- One
alwaysApply: truerule: package manager, how to run tests and the build, and “run the build after a series of changes”. - One
globsrule for**/*.tsx: component conventions the linter cannot enforce. - One intelligent rule with a description like “database migrations and schema changes”, so it loads only when that comes up.
- Anything longer than a page moves to a referenced doc rather than a rule.
Rules work best alongside the habits that keep Agent output reviewable: one narrow task at a time, @-mentioning the files it depends on, reading every diff before accepting, and committing after each working step. More on the Agent itself is in the Cursor review.
If you also use Claude Code
The two tools converge on the same idea with different limits:
| Attribute | Cursor | Claude Code |
|---|---|---|
| Always-on file | alwaysApply rules or AGENTS.md | CLAUDE.md, loaded every session |
| Scoped by path | globs rules | .claude/rules/ files with paths frontmatter |
| On demand | Apply Intelligently or Manual | Skills |
| Size guidance | Under 500 lines per rule | CLAUDE.md under about 200 lines |
| Shared file | AGENTS.md | Reads AGENTS.md by default only when there is no CLAUDE.md; a setting reads both |
Because both can read AGENTS.md (Claude Code under the condition above), that file is the low-effort way to keep one set of project instructions for both tools. Writing the Claude side well is covered in CLAUDE.md best practices, and the tools are set against each other in Claude Code vs Cursor. Rules do not change what Cursor costs; that is in Cursor pricing explained.
Method
Researched from Cursor’s and Anthropic’s documentation on 29 September 2026. We have not run a comparison of how strictly each tool follows rules, so nothing here rates adherence. Cursor’s rules docs have changed format before; check the current page if a step differs. Re-checked every 60 days.
Common questions
Where do Cursor rules go?
In .cursor/rules/ as .mdc files, or in an AGENTS.md at the project root or in subfolders.
What is the difference between Always Apply and Apply Intelligently?
Always Apply is included in every chat. Apply Intelligently is included when the Agent decides, from its description, that the rule is relevant.
Do User Rules affect Inline Edit?
No. Cursor’s docs say User Rules apply to Agent chat only.