The `.cursorignore` file lets you control which files your AI coding assistant indexes and includes in context. Without it, tools like Cursor may waste tokens on `node_modules` (100k+ files), lock files, build artifacts, and — more critically — `.env` files containing API keys. The file uses `.gitignore` syntax, so there's no learning curve. A complete example for a Next.js project is provided, covering secrets, build output, generated files, and IDE metadata. Cursor has sensible defaults already, but an explicit file serves as documentation and also works for JetBrains AI Assistant, which has no built-in defaults. Tips include commenting every rule with the reasoning and updating the file whenever new tooling is added. Ready-made templates for 20+ stacks are available via the `artem-kuchumov/cursorignore` GitHub project.