CURSORRULES(5)CURSORRULES(5)

NAME

.cursorrules — instruction file for Cursor

SYNOPSIS

./.cursorrules

METADATA

FORMATText
FILENAME.cursorrules
CASE SENSITIVENo
TOOLCursor
ENCODINGUTF-8
GIT COMMITTEDYes
MAX SIZE8KB
SINCECursor (2023)

DESCRIPTION

.cursorrules is the original (now deprecated) project-level instruction file for Cursor, the AI-powered code editor. It is a plain text file placed at the project root that gets injected into the system prompt for all AI interactions — Tab completions, Cmd+K edits, and Chat.

The format is entirely unstructured: Cursor reads the file as a raw string and prepends it to the AI context. While many developers used Markdown-style formatting for readability, Cursor assigns no semantic meaning to headings or structure.

As of late 2024, Cursor deprecated .cursorrules in favor of the new .cursor/rules/*.mdc format, which adds YAML frontmatter, glob-based file scoping, and support for multiple rule files. Existing .cursorrules files continue to work but should be migrated.

STRUCTURE

└──General Instructions
Free-form text describing coding preferences, project conventions, and style rules. No required structure.

ANNOTATED EXAMPLE

.cursorrules
text
1You are an expert in TypeScript, React, and Tailwind CSS.
2
3Key principles:
4- Write concise, type-safe TypeScript code
5- Use functional and declarative patterns; avoid classes
6- Prefer iteration and modularization over code duplication
7- Use descriptive variable names with auxiliary verbs (isLoading, hasError)
8
9TypeScript:
10- Use "interface" over "type" for object shapes
11- Avoid enums; use const maps instead
12- Use strict mode with no implicit any
13
14React:
15- Use functional components with TypeScript interfaces for props
16- Use Tailwind CSS for all styling; no CSS modules or styled-components
17- Implement responsive design with mobile-first approach
18- Place static content and interfaces at the end of files
19
20Naming:
21- Components: PascalCase
22- Files: kebab-case
23- Variables/functions: camelCase
24- Constants: UPPER_SNAKE_CASE

COMMON MISTAKES

Gotchas
✗WRONG Creating new .cursorrules files in 2025+
✓RIGHT Use .cursor/rules/*.mdc (or *.md) instead — .cursorrules is no longer documented

Cursor's official documentation no longer references .cursorrules. The modern approach uses .cursor/rules/ with .md or .mdc files supporting YAML frontmatter, four activation modes (Always, Auto Attached, Agent Requested, Manual), and three-tier precedence (Team > Project > User). The legacy format still works but receives no new features.

✗WRONG Using Markdown headers and structured sections
✓RIGHT Plain text works, but the format is unstructured — Cursor treats it as a raw string

Unlike CLAUDE.md, .cursorrules has no concept of sections or directives. The entire file content is injected into the system prompt as-is. Markdown formatting is preserved visually but has no semantic meaning to Cursor.

✗WRONG Placing .cursorrules in subdirectories for scoped rules
✓RIGHT .cursorrules only works at the project root

The legacy format supports exactly one file at the project root. For directory-scoped rules, migrate to the new .cursor/rules/*.mdc format which supports glob-based file matching.

✗WRONG Writing extremely detailed rules expecting perfect adherence
✓RIGHT Keep rules concise — they compete with code context for token budget

The .cursorrules content is prepended to every AI request. Long files eat into the context window that could otherwise hold relevant code. Focus on the 10-20 most important conventions.

USED BY

SIMILAR FILES

CLAUDE.mdClaude Memory File
.windsurfrulesWindsurf Rules (Legacy)
.cursor/rules/*.mdcCursor Rules (MDC Format)

COMPARISONS

agentconfig.ing2026-03-16CURSORRULES(5)