WorkspaceBrowse, save, and manage patterns without leaving the shell

Cursor Rules Directory

Scoped .cursor/rules/*.mdc files with glob patterns, auto-attach triggers, and file references. The modern Cursor project setup.

balancedWeb AppFeatured
Q
Quzr27@quzr27

software engineer

1 followerquzr27
AI Tools
cursor
File structure5 files
7
Pros
Glob-based scoping ensures rules only fire on relevant files
Rules are version-controlled and shareable via cursor.directory
Auto-attach mode eliminates manual rule invocation
File references (@filename.ts) give rules concrete anchors
Cons
Cursor-only — no portability to Claude Code, Copilot, or Windsurf
Rules can be forgotten mid-conversation as context window fills
.mdc format is Cursor-proprietary, not standard Markdown
Avoid if
Your team does not use Cursor as primary editor
You need rules to work across Claude Code, Copilot, or Windsurf too
Your project is small enough that a single rules file suffices

Description

Cursor deprecated the single .cursorrules file in favor of the .cursor/rules/ directory. Each rule is an .mdc file with YAML frontmatter that controls when it activates: alwaysApply for global standards, glob patterns for file-type scoping, or manual invocation via @ruleName. Rules can reference other files with @filename.ts syntax, pulling in templates and examples as context. This pattern scales naturally — start with one global rule, then add scoped rules as friction points emerge. The WorkOS team and Cursor docs both recommend small, focused rules over one massive file. Community rules are shareable via cursor.directory.

Who is this for

Teams using Cursor as their primary AI editor on medium-to-large codebases with multiple languages or frameworks.

Why files are split this way

Different parts of a codebase need different AI guidance. A React component rule should not fire when editing a database migration. Cursor's glob-based scoping solves this by attaching rules only to matching file paths, keeping each rule focused and reducing prompt bloat.

What changed from the previous setup

A single .cursorrules file in the project root, which is now deprecated by Cursor in favor of the .cursor/rules/ directory.