What are Cursor rules, and how do you use them?
Last updated
Cursor rules are instructions Cursor's agent reads as context: your coding conventions, how to build and test, where things live. Project rules are .mdc files in your repository's .cursor/rules folder, and each one says when it applies: always, when the agent judges it relevant, when matching files are involved, or only when you @-mention it. Cursor also has User Rules for all your projects, Team Rules on Team and Enterprise plans, and reads AGENTS.md. Since Cursor removed Memories in version 2.1, rules are the main way to give its agent lasting instructions.
The kinds of rules
| Kind | Where it lives | Applies to |
|---|---|---|
| Project rules | .mdc files in .cursor/rules in your repository | That project; commit them to share with your team |
| User Rules | Cursor's Customize → Rules | "All projects" for you |
| Team Rules | The Cursor dashboard, on Team and Enterprise plans | Your whole organization |
| AGENTS.md | "The project root and subdirectories" | That project, in plain Markdown |
When they overlap, Cursor's documentation gives the order: "Team Rules → Project Rules → User Rules."
Project rules: .mdc files in .cursor/rules
"Project rules live in .cursor/rules as .mdc files." The extension matters: "Project rules must use the .mdc extension. A plain .md file in .cursor/rules is ignored." For plain Markdown, Cursor points you to AGENTS.md instead.
Each project rule has one of four ways to apply:
- Always Apply: "Apply to every chat session."
- Apply Intelligently: "When Agent decides it's relevant based on description."
- Apply to Specific Files: "When file matches a specified pattern."
- Apply Manually: "When @-mentioned in chat."
Cursor's 2.1 release also started including rules from the .cursor/rules folder in your home folder.
What to put in rules
- How to build, test and run the project.
- Code style and naming rules.
- Where the main parts of the code live.
- Rules for one part of the code, scoped with a file pattern so they load only when they matter.
What to keep out of rules
Rules that always apply load into every chat, so every line costs context. Keep these out:
- Long histories of decisions and why they were made.
- Notes that change every week.
- Anything secret: passwords, keys and tokens.
For the long tail, scope rules to files, keep a short memory bank, or use a memory server the agent searches when it needs something.
Cursor rules, CLAUDE.md and AGENTS.md
Each coding agent has its own instruction file: Claude Code reads CLAUDE.md, Codex reads AGENTS.md, and Cursor reads its rules and AGENTS.md. If you use several agents, AGENTS.md is the file they share most widely. See What is AGENTS.md? and What is CLAUDE.md?.
A memory server is the other way to share knowledge across agents. Memlo is one for Claude Code, Codex, claude.ai, ChatGPT and other MCP clients. Its sign-in doesn't work from Cursor yet; see Cursor memory.
Frequently asked questions
Where are Cursor rules stored?
Project rules are .mdc files in .cursor/rules in your repository. User Rules are in Cursor's settings under Customize → Rules. Team Rules are in the Cursor dashboard. Cursor also reads rules from the .cursor/rules folder in your home folder and AGENTS.md files in your project.
Why is my Cursor rule ignored?
Check the extension first: "A plain .md file in .cursor/rules is ignored." Project rules must end in .mdc. Then check how the rule applies: a rule set to apply to specific files loads only when a matching file is involved, and a manual rule only when you @-mention it.
Does Cursor read AGENTS.md?
Yes. Cursor's documentation says it "supports AGENTS.md in the project root and subdirectories."
Are Cursor rules the same as memory?
No. Rules are instructions you write. Cursor's Memories, which the agent wrote itself, were removed in version 2.1. See Cursor memory.
Sources
Checked on October 31, 2026:
- Rules, Cursor documentation
- Cursor 2.1 changelog, November 21, 2025
- Are my memories gone?, Cursor forum
Try Memlo
Memlo is invitation only for now. Join the waitlist and we'll email you when your invitation is ready.
Join the waitlist