DEV Community

Sriram Sureshkumar
Sriram Sureshkumar

Posted on • Edited on • Originally published at codehabits.dev

Cursor Not Following Rules? 3 Causes (and the Fix)

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:

  1. Wrong path or format (.cursorrules vs .cursor/rules/ vs global ~/.cursor/rules)
  2. Attachment settings (alwaysApply / globs) never load the rule
  3. Vague rules losing to model defaults — or rules that don't match what PR review actually enforces

Symptom: Cursor ignores .cursor/rules

You told the agent to use named exports, Zod validation, and your error-handling pattern. It still generates default exports and skips validation. Same pattern as every "cursor rules not working" thread.

Cause 1: Wrong file location or format

Cursor moved from a single .cursorrules file to .cursor/rules/ with individual rule files (often .mdc). Prefer the project rules directory; treat .cursorrules as legacy.

For rules that should apply on every project, use global user rules in ~/.cursor/rules — a different path than the project folder.

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 attachment is wrong, it looks like Cursor is not following rules when the rule never entered context.

Cause 3: Vague rules or rules that don't match PR reality

Vague rules like "write clean code" lose to model defaults. And a rule file written by one engineer often misses conventions that only appear in review comments.

Quick checklist

  1. Confirm path: project .cursor/rules/ vs legacy .cursorrules vs global ~/.cursor/rules
  2. Confirm attachment: alwaysApply / globs / agent-requested
  3. Rewrite vague rules into specific instructions
  4. Compare your rules to the last 10 PR review comments

Optional: evidence-ranked team intelligence

Hand-written rules are fine for temporary constraints. For team-wide patterns that repeat in review, Codehabits can extract conventions from PR history into .codehabits/ + an Agent Skill.

npx @codehabits/cli enable
git add .codehabits/ .cursor/skills/ AGENTS.md
git commit -m "chore: add team intelligence"
git push
Enter fullscreen mode Exit fullscreen mode

You don't need a product to run the checklist — automation is optional.

Related


Originally published at codehabits.dev.

Top comments (0)