Cursor rules

Cursor rules that actually change what the agent does

Cursor reads project rules from .cursor/rules, where each rule is an .mdc file with a short frontmatter block. Older repos may still have a single root .cursorrules file; new rules belong in the folder.

Reviewed Oct 17, 2026. Checked against Cursor's rules documentation.

How a rule is applied

  • Always apply (alwaysApply: true): included in every session.
  • Apply intelligently: the agent decides from the description.
  • Apply to specific files: attached when a file matches globs. Separate multiple patterns with commas.
  • Apply manually: only when you @-mention the rule in chat.
  • Also read: User Rules (global, set in Customize > Rules), Team Rules on Team and Enterprise plans, and AGENTS.md files, which can be nested in subfolders.

.cursor/rules/backend.mdc

---
description: RPC service conventions for the backend
globs: src/server/**/*.ts
alwaysApply: false
---

- Keep handlers thin; business logic lives in src/server/services.
- Validate input with the shared schemas in src/server/schemas.

Cursor Team Rules

Team-wide rules managed from the Cursor dashboard. Available on Team and Enterprise plans.

  • Team administrators create and manage Team Rules directly from the Cursor dashboard.
  • Admins choose whether each rule is enforced. An enforced rule is required for every team member and cannot be disabled in Customize. A rule that is not enforced can be toggled off by each member under Team Rules in Customize.
  • A rule with a glob pattern (for example **/*.py) only applies when matching files are in context. A rule without a glob applies to every conversation.
  • Leave the enable box unchecked to save a rule as a draft that does not apply yet.
  • Enabled Team Rules are included in Agent (Chat) context across all repositories and projects for the team.
  • Order: Team Rules, then Project Rules, then User Rules. All applicable rules are merged, and earlier sources win when guidance conflicts.

Full rules setup guide: project rules, User Rules, Team Rules and AGENTS.md

Get Cursor rules and settings changes by email

When Cursor changes how rules, run modes or settings work, we update these pages from the docs and send a short note. One email a week at most.

Rules of thumb

  • Keep each rule under 500 lines; split by topic instead.
  • Reference files instead of pasting their contents.
  • Write what the agent cannot infer from the code: commands that must pass, sharp edges, what not to touch.
  • Plain .md files in .cursor/rules are ignored; use .mdc with frontmatter.
  • Share one set of instructions across tools with AGENTS.md, which Cursor also reads.

Rule templates

Short, opinionated starting points. Copy one into .cursor/rules and edit it to match your repo.

More Cursor setup guides

Sourced answers for the Cursor settings people search for most.