Cursor rules: project rules, user rules and .mdc files explained
Updated Oct 26, 2026 · Sources listed at the end
Cursor rules are persistent instructions for Cursor’s agent. Because models do not remember anything between completions, rules supply reusable context every time. Project rules live in .cursor/rules as .mdc files and are version-controlled with your code.1
The four kinds of rules
| Type | Where | Scope |
|---|---|---|
| Project rules | .cursor/rules/*.mdc | Your codebase, in version control |
| User rules | Cursor settings | Your Cursor environment |
| Team rules | Dashboard | Team-wide (Team and Enterprise plans) |
| AGENTS.md | Repo root | Simple Markdown alternative to .cursor/rules |
Source: Cursor docs.1
How a project rule applies
Each rule’s frontmatter (description, globs, alwaysApply) sets one of four behaviours:1
- Always Apply: every chat session.
- Apply Intelligently: when the agent decides it is relevant from the description.
- Apply to Specific Files: when a file matches the pattern.
- Apply Manually: when you @-mention it, e.g.
@my-rule.
Project rules must use the .mdc extension. A plain .md file in .cursor/rules is ignored because it has no frontmatter.1
Footnotes
Tools mentioned
- Cursor: free plan, paid from $8/mo