Home › Articles

Cursor rules not applying? alwaysApply, globs and description

Updated 2026-10-25

In short: a Cursor project rule is a .mdc file in .cursor/rules, and three frontmatter fields decide when it loads. alwaysApply: true means every chat. globs means "when a matching file is in context". A description alone means "when the agent decides it's relevant". None of them means "only when I @-mention it". Most "my rule is ignored" problems are a wrong extension, a missing description or a glob that doesn't match.

The four rule types, and the frontmatter behind each

In the editor you pick a rule type from a dropdown. Under the hood, the Cursor docs say the dropdown just sets alwaysApply, globs and description, and these combinations decide what happens:

Rule typealwaysApplydescriptionglobsWhen it loads
Always ApplytrueignoredignoredEvery chat session
Apply to Specific Filesfalsenot neededsetAuto-attached when a matching file is in context
Apply IntelligentlyfalsesetomittedThe agent reads the description and pulls the rule in when relevant
Apply ManuallyfalseomittedomittedOnly when you @-mention it in chat, e.g. @my-rule

Two consequences people miss. First, alwaysApply: true wins outright: the docs say globs and description are ignored, so adding a glob to an always rule doesn't narrow it. Second, an Apply Intelligently rule with no description has nothing for the agent to match against, so it behaves like a manual rule.

Working examples you can copy

These follow the shapes in the docs. Save each as its own file under .cursor/rules/.

Always on (.cursor/rules/core.mdc). Keep this one short, because it lands in every chat:

---
alwaysApply: true
---

- Run `npm run lint` and `npm test` before saying a task is done.
- Never edit files in `dist/` or `build/`; they are generated.
- Ask before adding a new dependency.

Scoped to files (.cursor/rules/react-components.mdc):

---
globs: src/components/**/*.tsx
alwaysApply: false
---

- Use named exports, not default exports.
- Keep components under 200 lines; extract subcomponents into the same folder.

Picked by the agent (.cursor/rules/rpc-services.mdc). The description is the trigger, so say what the rule covers in words the agent will connect to the task:

---
description: RPC service conventions for the backend. Use when creating or changing files in src/services/.
alwaysApply: false
---

- One service per file under `src/services/`.
- Validate inputs at the service boundary.
- Return error objects with `code` and `message`; never throw raw strings.

Manual only (.cursor/rules/migrations.mdc), loaded when you type @migrations:

---
alwaysApply: false
---

- Every migration has both `up` and `down`.
- Never change a column type in place: add, backfill, then drop in a later migration.

You don't have to write frontmatter by hand. The docs list two ways to create a rule: type /create-rule in Agent and describe what you want, or open Customize, go to Rules and click Add Rule. Customize also shows every rule and its status, which is the quickest way to see what Cursor actually picked up.

Writing globs that match

The docs give these patterns, with multiple patterns separated by commas:

PatternMatches
*.ts.ts files in the root only
**/*.ts.ts files in any directory
src/**Everything under src/
src/**/*.tsx.tsx files anywhere under src/
docs/**/*.md, docs/**/*.mdx.md and .mdx under docs/
tailwind.config.*tailwind.config with any extension

The classic mistake is *.ts when you meant **/*.ts: the first only matches files at the repo root. The docs' own examples write globs as a plain, unquoted, comma-separated value, so that's the safest form to copy. In a Cursor forum thread, a user reported that a quoted pattern and a YAML list both failed for them while the unquoted form worked, and later staff replies in other threads disagree on whether those forms work. If a glob rule never fires, rewrite it in the docs' form before debugging anything else.

Also know what "in context" means. In that same thread, Cursor staff said having a file open in an editor tab doesn't trigger a glob rule; the rule attaches when the agent works with a matching file. The same user found that a glob rule created in the middle of a conversation didn't take effect until they opened a new chat. So test a new rule in a fresh chat.

Why a rule doesn't load: a checklist

  1. Wrong extension. Project rules must be .mdc. The docs say a plain .md file in .cursor/rules is ignored because it has no frontmatter. If you want plain markdown, use AGENTS.md instead.
  2. Wrong place. Project rules live in .cursor/rules/ in the project. Subfolders such as .cursor/rules/frontend/ work too. User rule files go in ~/.cursor/rules and stay on that machine; user rules typed into Customize sync with your account.
  3. Type doesn't match intent. An Apply Intelligently rule needs a description, and an Apply to Specific Files rule needs a glob that matches the files you're working on. This is the first thing the docs' own FAQ tells you to check.
  4. Wrong feature. Rules only apply to Agent (Chat). The help page says they don't affect Tab completion or Bugbot PR reviews.
  5. A legacy file. .cursorrules in the project root is legacy and will be deprecated. Move its content into a new rule set to Always Apply, which matches the old behavior, then delete the file.
  6. A conflict, not a miss. When rules disagree, precedence is Team Rules, then Project Rules, then User Rules. Your project rule may be loading and losing to a team rule.
  7. Too long or too vague. The docs recommend keeping each rule under 500 lines, splitting large rules, and avoiding vague guidance. A rule can load and still be followed badly.

If an Always Apply rule still seems ignored, @-mention it in the chat to force it in. Cursor staff suggested that workaround in an April 2026 forum bug report where always rules weren't being injected, so keep Cursor updated too.

Things that surprise people

Rules or skills?

Rules are for standing guidance; Agent Skills are for procedures. Cursor's skills docs describe a built-in /migrate-to-skills that converts Apply Intelligently rules (no alwaysApply, no globs) into skills, while Always Apply and glob rules stay rules because their triggers are explicit. A good split: always-on essentials and file-scoped conventions as rules, and multi-step workflows such as "plan a feature" or "prepare a release" as skills. For how to make a skill load when it should, see how to write a SKILL.md that actually triggers; it covers Cursor's disable-model-invocation too.

Using Cursor alongside Claude Code or Codex? The file-by-file comparison is in Cursor rules vs CLAUDE.md vs AGENTS.md, and the way to stop the copies drifting is in AGENTS.md vs CLAUDE.md: one source of truth.

Five-minute rule audit

  1. List .cursor/rules/; rename any .md rule to .mdc and give it frontmatter.
  2. Open Customize, then Rules, and check each rule's type and status.
  3. Give every Apply Intelligently rule a description that names the task or folder it's for.
  4. Rewrite globs in the docs' unquoted comma-separated form, with **/ where you mean "any folder".
  5. Keep only a handful of lines in Always Apply rules and in CLAUDE.md; move the rest to scoped rules or skills.
  6. Retire .cursorrules.
  7. Test each rule in a new chat with a task that should trigger it.

FAQ

Why is my Cursor rule not being applied?

Check four things: the file is a .mdc file inside .cursor/rules (a plain .md file there is ignored), the frontmatter matches the rule type you want, an Apply Intelligently rule has a description, and an Apply to Specific Files rule has a glob that matches the files the agent is working with. Rules also only apply to Agent (Chat), not to Tab completion or Bugbot.

What does alwaysApply: true do in a Cursor rule?

It includes the rule in every chat session. When alwaysApply is true, Cursor ignores the rule's globs and description, so you don't need either of them.

How do I write globs in a .mdc rule?

Use the globs field with alwaysApply: false. Cursor's docs separate multiple patterns with commas, for example globs: docs/**/*.md, docs/**/*.mdx, and use ** for any number of directories, as in src/**/*.tsx.

What is the difference between description and globs?

A rule with globs is attached automatically when a matching file is in context. A rule with a description and no globs is offered to the agent, which reads the description and pulls the rule in when it decides the rule is relevant. With neither, the rule loads only when you @-mention it.

Does Cursor read CLAUDE.md and AGENTS.md as rules?

Yes. Cursor reads AGENTS.md in the project root and in subdirectories, and reads CLAUDE.md the same way. CLAUDE.md is always applied to every conversation, whatever its frontmatter says. Use .mdc rules in .cursor/rules when you need conditional rules.

Sources

Official docs, checked 2026-10-25.

Get the free rules sampler + new tips by email

Confirm your email and we'll send you straight to the sampler download. Then one short email every two weeks covering tool format changes (Cursor, Claude Code, Codex, Windsurf, Copilot), new rules and kit updates. No spam.

We store only your email, with our email provider Resend. See the privacy policy.

Unsubscribe anytime from any email. Rather skip email? Get the sampler on GitHub or download the zip directly.