Skip to main content
NeVibe · guide · 2026-10-24

Cursor rules: .mdc files, four modes and what replaced .cursorrules

Project rules in Cursor are .mdc files in .cursor/rules/ with a three-field YAML header: description, globs and alwaysApply. The combination decides when a rule enters context: always, for matching files, when the agent judges it relevant, or only when you call it.

Is .cursorrules deprecated?

The old way was a single .cursorrules file at the project root. Earlier Cursor docs called it legacy: still supported, but set to be deprecated. The current rules page does not mention it at all.

The new way is a .cursor/rules/ folder with as many files as you like, nested in subfolders if you want. The extension must be .mdc: the docs say .md files in that folder are ignored. People trip on this when porting rules from other agents.

Besides Project Rules, Cursor has User Rules in editor settings and Team Rules from the team dashboard. On conflict, Team wins over Project, and Project over User.

The four rule modes

ModeFrontmatterWhen the rule is in contextAlways ApplyalwaysApply: trueevery requestApply to Specific Filesglobswhen a matching file is in contextApply Intelligentlydescription onlywhen the agent decides from the description that it is relevantApply Manuallynothingonly when you mention @rule-name

Our advice: keep Always Apply to the bare minimum, things the agent gets wrong in any file. Anything stack-specific belongs behind globs. Your testing rule should not ride along while you edit CSS.

An example .mdc file

An illustrative sketch:

---
description: Conventions for Next.js API routes
globs: app/api/**/*.ts
alwaysApply: false
---

- Every route validates input with a zod schema before touching the database.
- Errors are returned as { error: string } with a 4xx or 5xx status.
- Secrets come from process.env only and never go into a response.

Cursor docs suggest keeping a rule under 500 lines. There is no hard cap, but a long rule with alwaysApply: true eats context on every request. When a rule grows, split it into several files by glob.

AGENTS.md in Cursor

Cursor reads AGENTS.md at the root and in any subfolder, with no frontmatter. Nested files combine with their parents, and the more specific one takes priority. In practice it is an always-on rule that other agents understand too.

A sensible split: project rules shared by every agent go into AGENTS.md; anything that relies on Cursor features (globs, manual calls) goes into .cursor/rules/. If anyone on the team uses Claude Code or Codex, AGENTS.md saves you from keeping two copies.

Rules, skills and migration

Cursor 2.4 added /migrate-to-skills, which converts rules and user commands into skills. Rules are not going away. A skill sits in context as a one-line description and expands on demand; a rule with alwaysApply or globs attaches itself. Keep short conventions as rules and move long task instructions into skills.

If you need the same rules in Cursor, Claude Code and Copilot, the rulesync converter can import .cursorrules (rulesync import --targets cursor) and write one source into every agent format. Some agents read the old format directly: Cline and Zed treat .cursorrules as a compatible file.

Where to find good Cursor rules

The best-known list is PatrickJS/awesome-cursorrules: 41,008 stars on 24 October 2026, CC0 license. It has already moved to the new format, with 257 .mdc files in its rules folder and no .cursorrules left. The last push was on 30 May 2026, so some rules lag behind current framework versions.

We checked the copies of that list under other names (awesome-windsurfrules, awesome-clinerules): they contain the same .cursorrules files and nothing native. Rules we have checked for license and freshness are in best Cursor rules and the IDE rules section.

FAQ

How do I add cursor rules?

Create a .cursor/rules folder at the project root and add a file with the .mdc extension. Set description, globs or alwaysApply in its header depending on when the rule should apply.

Does .cursorrules still work?

Older Cursor docs call it a legacy file that is still supported but will be deprecated. The current docs describe only .cursor/rules/*.mdc.

Why is Cursor ignoring my rule?

Most often the file ends in .md instead of .mdc, and .md files in .cursor/rules are ignored. Next most common: a rule with neither alwaysApply nor globs only applies when you mention it by hand.

How do I use cursor rules with AGENTS.md?

Cursor reads AGENTS.md at the root and in subfolders as an always-on instruction. Put rules shared by every agent there and Cursor-specific glob rules in .cursor/rules.

NeVibe catalog

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor