Skip to main content

Command Palette

Search for a command to run...

Cursor Ignores Your Rules - .cursorrules vs .cursor/rules and How to Fix It

Updated
•3 min read•View as Markdown
K
Kitforge builds practical tooling for AI-assisted development. Maker of The Agentic Coding Kit.

You wrote rules for Cursor. Cursor wrote code that breaks them. This is almost never the model being disobedient - it is one of five configuration mistakes that leave your rules unloaded, unscoped, or drowned out. Here is how to tell which one you have.

Cause 1: You are still using .cursorrules

The single .cursorrules file at the repo root is the legacy format. Cursor has moved to the .cursor/rules/ directory of .mdc files, and the legacy file is on the deprecation path - some versions load it, some ignore it, and it never gets the scoping features. If your rules live in .cursorrules, migrate them first. The new format adds frontmatter that controls when the rule applies:

---
description: Next.js App Router conventions
globs: src/app/**/*
alwaysApply: false
---

- Server Components by default; add "use client" only for interactivity.
- Data fetching in the page or layout, not in client components.
- Route handlers in route.ts, never pages/api.

Cause 2: No glob scoping, so rules compete

A rule file with no globs and alwaysApply: false is matched by description alone - Cursor decides from the description whether the rule is relevant to the current file. Vague description, rule skipped. Scope each rule to the paths it governs:

---
description: Database migration safety
globs: prisma/migrations/**/*, db/migrations/**/*
alwaysApply: true
---

- Never edit an existing migration. Create a new one.
- Destructive changes (DROP, column removal) need a comment explaining the rollback.

Cause 3: alwaysApply everywhere (or nowhere)

alwaysApply: true puts the rule in every prompt. Set it on ten files and you have recreated the 900-line CLAUDE.md problem - every rule diluted by every other rule. Reserve alwaysApply for the handful of project-wide rules (package manager, test command, forbidden paths). Everything else gets a glob.

Cause 4: Contradictory rule files

Two rules that disagree ("use default exports" in one, "named exports only" in another) do not average out - the model follows whichever loaded last or reads louder in context. Audit the whole .cursor/rules/ directory the way you would review a diff: one owner per decision, overlaps merged, losers deleted.

Cause 5: Prose instead of rules

Same failure as every agent config: "try to keep things tidy and consistent" is untestable. Working rules are one line, trigger plus action:

- Always run `pnpm test:unit` before declaring a task done.
- When you add a component, add a story in the same folder.
- Never import from @/legacy in new code.

Verify like you would any config

After changing rules, open a file the rule should govern and ask: "Which rules apply to this file?" Cursor will list them. A missing rule means a loading problem (Causes 1-3), not a behavior problem - fix the config before blaming the model.


Want the migration done for you? The Agentic Coding Kit ships ready-made .mdc rule packs for Next.js, Python, Go, and more - with glob scoping and alwaysApply already set correctly - plus CLAUDE.md templates and hook configs. 34 files, $19 one-time. A free Next.js .mdc example is on GitHub.

12 views

More from this blog

K

Kitforge

23 posts