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

KindWhere it livesApplies to
Project rules.mdc files in .cursor/rules in your repositoryThat project; commit them to share with your team
User RulesCursor's Customize → Rules"All projects" for you
Team RulesThe Cursor dashboard, on Team and Enterprise plansYour 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:

Cursor's 2.1 release also started including rules from the .cursor/rules folder in your home folder.

What to put in rules

What to keep out of rules

Rules that always apply load into every chat, so every line costs context. Keep these out:

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:

Try Memlo

Memlo is invitation only for now. Join the waitlist and we'll email you when your invitation is ready.

Join the waitlist