Cursor Not Following Rules? 3 Causes (and the Fix)
Cursor not following rules usually means the wrong path, AlwaysApply/globs misconfigured, or vague rules losing to model defaults. Diagnose .cursor/rules and .cursorrules in minutes.
If Cursor is not following your rules, you are not alone. Most of the time it is not “Cursor is broken” — it is one of three diagnosable problems: the rules file is in the wrong place or format, attachment settings (alwaysApply / globs) never load the rule, or the rules are too vague to beat model defaults. Cursor rules are static instructions you maintain by hand; they do not learn from PR review unless you keep rewriting them.
Symptom: Cursor ignores .cursor/rules
You added a .cursor/rules file (or legacy .cursorrules) telling the agent to use named exports, Zod validation, and your error-handling pattern. The agent still generates default exports and skips validation. This is the most common complaint from teams adopting AI coding tools — the same pattern as cursor rules not working search threads.
Cause 1: Wrong file location or format
Cursor moved from a single .cursorrules file to the .cursor/rules/ directory with individual rule files (often .mdc). If your rules live in the old location, newer Cursor versions may not load them consistently.
- Prefer project rules under
.cursor/rules/in the repo root - Treat legacy
.cursorrulesas deprecated and migrate - For rules that should apply on every project, use global user rules in
~/.cursor/rules— a different path than the project folder
Check Cursor's docs for your version and confirm the file Cursor actually loads before debugging model behavior.
Cause 2: AlwaysApply / globs never attach the rule
Modern Cursor rules are not always “always on.” A rule can be agent requested, glob-scoped, or marked alwaysApply. If you wrote a careful rule but left it agent-requested (or scoped to the wrong globs), it looks like Cursor is not following rules when the rule never entered context.
Quick check: open the rule, confirm whether it should always apply, and whether file globs match the files you are editing. Mismatched alwaysApply is one of the most common silent failures.
Cause 3: Rules compete with everything else
Cursor loads rules alongside open files, chat history, and generic model behavior. Vague rules like "write clean code" lose against strong defaults. Specific, evidence-backed rules work better — but writing them for every convention your team enforces takes hours and drifts out of date. We covered this dynamic in why AI tools ignore your team's patterns.
Cause 4: Rules don't match PR reality
The gap between what you think your team does and what PR review actually enforces is large. A rule file written by one engineer often misses conventions that only appear in review comments — the named-export preference, the ban on console.log, the custom error base class. Without PR-derived evidence, rules are guesswork.
Quick checklist when Cursor is not following rules
- Confirm the path: project
.cursor/rules/vs legacy.cursorrulesvs global~/.cursor/rules - Confirm attachment:
alwaysApply/ globs / agent-requested - Rewrite vague rules into specific, testable instructions
- Compare your rules to the last 10 PR review comments — note gaps
Optional next step: evidence-ranked team intelligence
Hand-written rules are fine for temporary project constraints. For team-wide patterns that repeat in review, extract conventions from merged and closed PRs. Codehabits analyzes review comments and code patterns, ranks each convention by confidence, and writes structured intelligence to .codehabits/ plus an Agent Skill Cursor can auto-discover.
npx @codehabits/cli enable
git add .codehabits/ .claude/skills/ .agents/skills/ AGENTS.md
git commit -m "chore: add team intelligence"
git pushTeammates clone the repo and get the same skill — no per-developer rule copy-paste. You do not need a product to run the checklist above; this is only if you want the extraction automated.
When hand-written rules still make sense
Project-specific one-offs (a migration in progress, a temporary API freeze) belong in explicit rules. Team-wide conventions that repeat in every PR belong in intelligence extracted from evidence. Use both: keep short-lived rules in .cursor/rules/ and automate the long-lived patterns when the checklist stops being enough.
FAQ
Why is Cursor not following my rules?
Start with path and attachment (alwaysApply / globs). Most “ignored rules” reports are load failures, not model failures.
Are .cursorrules still supported?
Prefer .cursor/rules/. Treat .cursorrules as legacy and migrate when you can.
Where do global Cursor user rules live?
In your home directory under ~/.cursor/rules — see Cursor global user rules.