Configuration file for Cursor AI code editor containing project-specific rules, coding conventions, and behavioral instructions for the AI assistant.
.cursorrules
.cursorrules is a project-level configuration file, placed at the root of a repository, that gives the Cursor AI code editor persistent, project-specific instructions - coding conventions, architectural constraints, preferred libraries, and behavioral guidance the assistant should follow on every request. Rather than repeating the same context in each prompt, a team encodes it once in the file so the AI works within the project’s norms by default. Cursor has since expanded this into a broader .cursor/rules directory format, but the single .cursorrules file remains the widely recognized convention.
- Repository-scoped context - Lives in version control alongside the code, so every contributor’s AI shares the same rules.
- Coding conventions - Encodes style, naming, framework choices, and patterns the assistant should honor.
- Behavioral instructions - Tells the AI what to prefer, avoid, or never do within this specific codebase.
- Prompt reduction - Removes the need to re-state project context in every interaction, keeping outputs consistent.
In the agentic turn, .cursorrules is an early, concrete example of the same governance instinct behind API-facing artifacts like AGENTS.md and llms.txt - a machine-readable file that shapes how an AI agent behaves against a body of work. For API teams it is where you pin the conventions an assistant must respect when generating client code, tests, or integrations, turning tribal knowledge about an API into rules the tooling actually enforces.