# Cursor Rules
Configuration system for controlling AI behavior in [[Cursor.com]]. Similar in concept to CLAUDE.md for [[Claude Code]].
## Rule Types
### 1. Project Rules
Stored in `.cursor/rules/`, version-controlled, scoped to the codebase. Use `.md` or `.mdc` files. `.mdc` supports frontmatter with `description`, `alwaysApply`, and `globs` fields.
**Application modes:**
| Type | Behavior |
|------|----------|
| Always Apply | Active in every chat session |
| Apply Intelligently | Agent decides based on the rule's description |
| Apply to Specific Files | Activated when file matches glob pattern |
| Apply Manually | Invoked via `@rule-name` in chat |
### 2. User Rules
Global, per-user rules for Agent/Chat (set in Cursor Settings).
### 3. Team Rules
Org-wide, managed via dashboard (Teams/Enterprise). Applied and enforced by admins.
### 4. AGENTS.md
Simple markdown file in project root or subdirectories. No frontmatter needed. Subdirectories can have their own `AGENTS.md` with more specific instructions taking precedence.
## Precedence
Team Rules > Project Rules > User Rules
## Creation
- `/create-rule` command in chat
- Settings UI (Cursor Settings > Rules)
## Remote Rules
Import rules from GitHub repos; they auto-sync with their source.
## Scope Limitation
Rules apply to Agent (Chat) and Inline Edit only. They do NOT affect [[Cursor Tab]].
## Best Practices
- Keep rules under 500 lines
- Use `@filename.ts` references instead of copying code
- Focus on concrete guidance with examples
## References
- Documentation: https://www.cursor.com/docs/rules
- Changelog: https://cursor.com/changelog
## Related
- [[Cursor.com]]
- [[Cursor Tab]]
- [[Claude Code]]