Why Cursor is ignoring your rules (.mdc + frontmatter)
On X and Reddit, “Cursor is ignoring my rules” is often not an adherence problem — the rule never entered
context. Cursor project rules live in .cursor/rules/ as .mdc files with YAML
frontmatter. A plain .md in that folder is ignored. Cursor also reads root
AGENTS.md / CLAUDE.md as simpler always-on markdown.
Checklist below matches Cursor’s public Rules docs (keep rules under 500 lines; split large ones).
Five checks before you rewrite the rule
- Extension: file must end in
.mdcinside.cursor/rules/. - Frontmatter fields: only
description,globs, andalwaysApplycontrol load mode. - Always Apply:
alwaysApply: trueputs the rule in every chat (use sparingly — it costs tokens every turn). - File-scoped: set
globsandalwaysApply: falseso it attaches when matching files are in context. - Apply Intelligently / manual: a
descriptionwithout globs lets the agent decide; with neither description nor globs nor alwaysApply, you typically need to@-mention the rule.
Minimal working example
---
description: TypeScript conventions for this repo
globs:
- "**/*.ts"
- "**/*.tsx"
alwaysApply: false
---
- Prefer explicit return types on exported functions
- Follow the patterns in @src/lib/result.ts instead of inventing new Result helpers
If it loads but still feels ignored
- Vague wording: “write clean code” loses to “use 2-space indentation” — Cursor’s docs ask for actionable rules.
- Conflicts: the same always/never restated differently across AGENTS.md and several
.mdcfiles makes the model hedge. Cut one canonical line first. - Too much always-on: large always-applied rules compete with the task. Prefer globs/skills for procedures.
- Stale pasted docs: reference canonical files; don’t paste whole style guides (Cursor explicitly warns against this).
Prefer a short AGENTS.md example for cross-tool basics, and reserve
.mdc for activation control. Compare formats in
CLAUDE.md vs AGENTS.md vs Cursor rules.