Which Cursor Rule Type Should You Use?
A project rule is an .mdc file with three frontmatter fields, and they decide when it loads. Use Always Apply for a few repo-wide facts, Apply to Specific Files for conventions tied to a path, Apply Intelligently for topics the agent should notice, and Apply Manually for procedures you call yourself.
--- description: Standards for React components. Use when creating or editing a component. globs: src/components//*.tsx alwaysApply: false --- - Style with Tailwind utility classes - Follow the layout in @[component template file] - [your convention] Save as .cursor/rules/[name].mdc
- 1Always Applyevery chat, keep it very short
- 2Apply to Specific Fileswhen a matching file is in context
- 3Apply Intelligentlywhen the description fits
- 4Apply Manuallyonly when you @-mention it
Try it now
- 1Open the command palette with Cmd+Shift+P (Ctrl+Shift+P), run **New Cursor Rule**, and name it after one concern, such as
react-patterns. - 2Choose Apply to Specific Files from the type dropdown, and enter a pattern such as
src/components/**/*.tsx. - 3Ask Agent to edit a matching file, then ask it to edit a non-matching one. It worked if your convention shows up only in the first.
Use it when
Whenever you have more than a couple of rules, or your repo has areas with different conventions, such as a frontend folder and an API folder. Choosing narrower types keeps those instructions out of chats where they don't matter.
Skip it when
Don't split a five-line rule file into four types for tidiness. One short Always Apply rule, or a simple AGENTS.md file, is fine for a small project. Cursor's help also advises a flat .cursor/rules/ folder over nested folders, as it's simpler to manage.
Why it works
The dropdown in the rule editor just sets alwaysApply, globs and description. With alwaysApply: true, the rule is always included, and the other two fields are ignored. With a globs value it attaches when a matching file is in context. With only a description, Agent reads the description and pulls the rule in when relevant. With none set, it loads only when you @-mention it. So a rule that seems to be ignored is usually one whose trigger never fired, rather than a model ignoring your instruction.
Example
Say you have an API folder that must use zod and a component folder that must use Tailwind. Rather than one long always-on file, you write api-validation.mdc with globs: src/api/**/*.ts and react-patterns.mdc with globs: src/components/**/*.tsx. A database migration procedure you run monthly becomes a manual rule, used with @migrations. Only one short rule stays always on, listing your test and build commands.
Going further
Globs are comma-separated and less forgiving than they look. *.ts matches only .ts files at the root, and you need **/*.ts for any directory. docs/**/*.md, docs/**/*.mdx matches both types. A glob rule also needs a matching file to be in context, so a broad question that hasn't touched that folder won't load it. When a rule isn't firing, Cursor's FAQ says to check the type first: Apply Intelligently needs a description, and Apply to Specific Files needs a pattern that matches the files involved.
Common mistakes
- Using the
.mdextension. Cursor's docs say a plain.mdfile in.cursor/rulesis ignored because it has no frontmatter. - Writing Apply Intelligently with a vague description like "code rules", which gives the agent no reason to load it.
- Setting
alwaysApply: trueand adding globs, thinking they narrow it. They're ignored. - Using
*.tsxand wondering why nothing insrc/matches.
Sources
Checked 6 November 2026. Products change often, so confirm details with the vendor.