Creating Your First .cursorrules File
Create a file named .cursorrules in your project root. Write your rules in plain English — one instruction per line or organized into labeled sections. Cursor reads the file automatically when you open the project. No restart required, no settings to toggle. The rules take effect immediately for all AI interactions within the project directory.
Start with 5-10 rules that capture your most important conventions. "Use TypeScript strict mode." "Prefer functional components over class components." "Use async/await instead of .then() chains." "Include error handling in all API endpoints." "Write tests with Jest and React Testing Library." These foundational rules immediately improve AI output quality. Add more rules as you discover patterns the AI should follow. According to the Cursor documentation, projects with well-defined rules see up to 60% fewer AI-generated suggestions that require manual correction.