Cursor Tips & Tricks: Get 10x More from Your AI IDE [2025]
Cursor is the most capable AI IDE available in 2025. Most developers use 20% of what it can do. This guide covers the other 80% — the workflows, configurations, and techniques that separate developers shipping 2–3x faster from those still treating Cursor like a fancy autocomplete.
Complete Keyboard Shortcuts Reference
Master these before anything else. The shortcuts determine how fluidly you can direct the AI.
| Shortcut (Mac) | Shortcut (Win/Linux) | Action | When to Use |
|---|---|---|---|
Cmd+K | Ctrl+K | Inline edit — AI edits selected code | Quick single-function changes |
Cmd+L | Ctrl+L | Open AI chat panel | Questions, explanations, debugging |
Cmd+I | Ctrl+I | Open Composer (multi-file) | Features spanning multiple files |
Tab | Tab | Accept completion | Accepting ghost text |
Esc | Esc | Dismiss completion | Rejecting ghost text |
Cmd+→ | Ctrl+→ | Accept one word of completion | Partial acceptance |
Cmd+Shift+L | Ctrl+Shift+L | Add selection to chat | Reference specific code in chat |
Cmd+Shift+K | Ctrl+Shift+K | Inline chat on selection | Ask about specific code block |
@ | @ | Context picker (in chat/composer) | Reference files, docs, symbols |
Cmd+. | Ctrl+. | Accept all Composer changes | After reviewing all diffs |
Cmd+Backspace | Ctrl+Backspace | Reject all Composer changes | When you want to start over |
Cmd+Y | Ctrl+Y | Accept individual Composer hunk | Accept one change at a time |
Cmd+N | Ctrl+N | Reject individual Composer hunk | Skip one specific change |
Cmd+/ | Ctrl+/ | Toggle suggestion on/off | Temporarily suppress completions |
Most developers open Composer for everything. But Cmd+K (inline edit) is faster for any change within a single function. Select the function, press Cmd+K, type your instruction. The result appears inline as a diff you can accept or reject. No tab switching, no context copy-paste. Use it for: renaming, adding parameters, changing return types, adding error handling, extracting logic.
The @-Context System: Precise Context Control
The @ system is Cursor's most powerful feature. Use it to give the AI exactly the context it needs — no more, no less.
| @ Reference | Example | What it includes |
|---|---|---|
@Files | @src/services/auth.ts | Full file content |
@Folders | @src/services | All files in folder |
@Code | @AuthService | Specific function/class definition |
@Docs | @https://nextjs.org/docs | Fetches and includes documentation |
@Web | @Web latest React 19 changes | Live web search results |
@Git | @Git | Recent git diff / commits |
@Terminal | @Terminal | Recent terminal output |
@Codebase | @Codebase | Semantic search across entire repo |
# | #file.ts | Attach file (alternative syntax) |
High-value pattern — reference the error output directly:
@Terminal @src/services/orderService.ts
The createOrder function is throwing. Look at the terminal output and the
function implementation, identify the root cause, and fix it.
High-value pattern — reference docs + your code:
@https://stripe.com/docs/api/payment_intents @src/payments/stripe.ts
Update the createPaymentIntent function to use the latest Stripe API
(2024-12-18 version). The docs show the new required fields.
.cursorrules: The Most Underused Feature
A .cursorrules file at your project root acts as a persistent system prompt — Cursor includes it in every request. Well-written .cursorrules dramatically improves consistency.
Template: Next.js + TypeScript + Tailwind
You are working on a Next.js 14 application with TypeScript and Tailwind CSS.
## Tech Stack
- Next.js 14 with App Router (NOT pages router)
- TypeScript strict mode
- Tailwind CSS for styling (no inline styles, no CSS modules)
- shadcn/ui component library
- Prisma ORM with PostgreSQL
- NextAuth.js v5 for authentication
- Vitest + Testing Library for tests
- Zod for validation
## Code Conventions
- Use server components by default; only add "use client" when necessary
- Prefer named exports over default exports (exception: page.tsx files)
- Use async/await, never .then() chains
- All database queries go through service functions in /src/services/
- Never put business logic in route handlers — use services
- Always handle loading and error states in UI components
- Form validation with Zod schemas defined in /src/schemas/
## File Structure
- Components: /src/components/{ComponentName}/{ComponentName}.tsx
- Pages: /src/app/{route}/page.tsx
- API routes: /src/app/api/{route}/route.ts
- Services: /src/services/{domain}Service.ts
- Types: /src/types/{domain}.ts
## Style Guide
- Tailwind: use cn() utility for conditional classes
- All user-facing strings are wrapped in translation keys (next-intl)
- No hardcoded colors — use Tailwind semantic classes
## Testing
- Test files: {ComponentName}.test.tsx alongside the component
- Use describe blocks matching component names
- Mock at the module level, not inside test bodies
Template: Python + FastAPI
You are working on a Python FastAPI application.
## Stack
- Python 3.12, FastAPI 0.115+
- SQLAlchemy 2.x with async support (asyncpg)
- Pydantic v2 for validation
- Alembic for migrations
- pytest + pytest-asyncio for testing
- Ruff for linting (not flake8/black separately)
## Conventions
- All endpoints return Pydantic response models, never raw dicts
- Database sessions via dependency injection (Depends(get_db))
- Services in /app/services/, routers in /app/routers/
- Environment variables via pydantic-settings BaseSettings
- Use httpx.AsyncClient in tests (not requests)
- Structured logging with structlog
## Error Handling
- Never raise HTTPException in services — return None or raise domain exceptions
- Route handlers convert domain exceptions to HTTPException
- Log all 5xx errors with full context
Workflow Recipes
Recipe 1: Feature Implementation
Use this workflow for any new feature that touches multiple files.
Step 1 — Spec it in a comment first (Cmd+K):
// TODO: Add rate limiting to the /api/search endpoint
// - Max 10 requests per minute per IP
// - Return 429 with retry-after header when exceeded
// - Use Redis for the counter (client in /src/lib/redis.ts)
// - Add tests for the rate limit behavior
Step 2 — Open Composer (Cmd+I), reference the TODO + relevant files:
Implement the rate limiting described in the comment above.
Reference: @src/lib/redis.ts @src/app/api/search/route.ts
@src/middleware.ts
Step 3 — Review each file diff, accept what's correct, edit what's not
Step 4 — Run tests with @Terminal, ask Composer to fix failures
Recipe 2: Bug Fixing
Step 1 — Reproduce the bug, copy the error + stack trace
Step 2 — Open chat (Cmd+L):
@Terminal @src/services/orderService.ts @src/models/order.ts
Getting this error on checkout for orders with >10 items:
[paste error + stack trace]
What's the root cause? Show me the specific line.
Step 3 — Once you understand the bug, use Cmd+K on the specific function:
Fix the off-by-one error in the quantity validation. The limit
should be inclusive (10 is valid, 11 is not).
Step 4 — Add a regression test:
@src/services/orderService.test.ts
Add a test case that specifically covers the ≥10 items boundary
Recipe 3: Large Refactoring
Step 1 — Create a refactor plan in a markdown file:
REFACTOR.md — document what's changing and why
Step 2 — Break into phases. Each Composer session = one phase.
Phase 1: "Rename UserRepository to UserStore in all files"
Phase 2: "Extract email sending logic from UserService into EmailService"
Phase 3: "Update all tests to use the new structure"
Step 3 — Do one phase per Composer session. Commit after each phase.
Never do a 10-file refactor in one Composer run — context gets confused.
Step 4 — Use @Git between phases to show Composer what's already changed:
"The previous phase renamed UserRepository to UserStore (see @Git diff).
Now extract the email logic as planned in @REFACTOR.md."
Recipe 4: Code Review Mode
Step 1 — In chat, reference the files changed in a PR:
@src/api/payments.ts @src/services/paymentService.ts
Review this code as a senior engineer. Specifically look for:
1. Error handling gaps
2. Missing input validation
3. Any security concerns
4. Race conditions
5. Performance issues
Step 2 — For each issue the AI surfaces, use Cmd+K on the specific block:
Fix the issue you identified — [describe it explicitly]
Step 3 — Ask for test coverage assessment:
@src/services/paymentService.test.ts
What edge cases are missing from these tests given the implementation?
Cost Optimization
Cursor Pro costs $20/month and includes 500 "fast" requests and unlimited "slow" requests. Fast requests use the latest frontier models with no queue; slow requests use the same models but may wait.
| Action | Token Cost | When to Use Slow |
|---|---|---|
| Cmd+K inline edit | Low (single function) | Always fine to use fast |
| Chat — quick question | Low | Can use slow |
| Chat — long context | High | Use slow if non-urgent |
| Composer — small feature | Medium | Can use slow |
| Composer — large refactor | Very High | Use slow, it's the same model |
Practical optimization strategies:
1. Use Cmd+K instead of Composer for single-file changes
→ Cmd+K uses ~5× fewer tokens than opening Composer for the same edit
2. Keep .cursorrules tight
→ .cursorrules is included in every request. A 2,000-line .cursorrules
doubles the context size of every single query. 200–400 lines is enough.
3. Reference specific files/functions, not entire folders
→ @src/services is 15 files. @src/services/auth.ts is 1 file.
Specify what's actually needed.
4. Use "slow" mode for non-urgent Composer sessions
→ Pressing the ⚡ toggle in Composer switches to slow requests.
Same output, doesn't count against your 500 fast credits.
5. For repetitive tasks, write a prompt template
→ Save common prompt patterns in snippets (use VS Code snippet files)
to avoid re-typing context every time.
Cursor's usage page (Settings > Account > Usage) shows your remaining fast requests. If you burn through 500 in the first two weeks, you're probably overusing Composer for tasks that Cmd+K would handle. Heavy agent-style usage (full feature generation) may exhaust fast requests in days.
Cursor vs. Windsurf vs. GitHub Copilot
For developers choosing between the top three:
| Feature | Cursor | Windsurf | Copilot (VS Code) |
|---|---|---|---|
| Base editor | VS Code fork | VS Code fork | Plugin for VS Code |
| Multi-file editing | Composer | Cascade | Copilot Edits |
| Context management | Excellent (@-system) | Good | Adequate |
| .cursorrules equivalent | .cursorrules | .windsurfrules | Copilot instructions |
| Model choice | GPT-4o, Claude 3.5/3.7, Gemini | GPT-4o, Claude 3.5 | GPT-4o, Claude 3.5 |
| Local model support | Via Continue workaround | Limited | No |
| Price | $20/mo Pro | $15/mo Pro | $10/mo Pro |
| Free tier | Limited | Limited | 2k completions/mo |
| JetBrains support | No | No | Yes |
| Vim/Neovim support | No | No | Yes |
| Stability | Good | Good | Excellent |
Verdict: Cursor has the deepest AI integration and best context control. Windsurf's Cascade is comparable for multi-file tasks and is $5/month cheaper. GitHub Copilot wins if you need JetBrains, Vim/Neovim, or Xcode support — it's the only tool that covers all IDEs. For VS Code users choosing between all three: Cursor's investment in the @ system and .cursorrules tooling makes it the most productive option for developers who invest time in setup.
Windsurf Pro at $15/month includes Cascade (equivalent to Composer) and comparable model access. If $20/month is a consideration, Windsurf is a legitimate alternative — not a compromise. Several benchmarks show Cascade slightly outperforming Composer on very large multi-file tasks.
Tools Mentioned
FAQ
How do I use Cursor Composer effectively?
Composer (Cmd+I) works best for bounded, specific tasks across 3–10 files. The key pattern: write a clear spec first (even just bullet points in a comment), reference the relevant files with @filename, and describe what should NOT change as clearly as what should. After generation, review each file diff carefully — accept changes you agree with, reject ones that miss the mark, then iterate with follow-up prompts in the same session.
What should I put in .cursorrules?
Your tech stack (specific versions matter), file structure conventions, naming patterns, which libraries to use for common tasks, what NOT to do (e.g., "never use class components", "always use the existing logger, not console.log"), testing conventions, and error handling patterns. Keep it under 400 lines — .cursorrules is included in every request, so very long files burn context on every query. Add entries when you catch the AI repeating the same wrong pattern.
Is Cursor worth $20/month compared to free alternatives?
For most developers who use AI assistance daily: yes. The productivity gains from Composer for multi-file tasks, the @ context system, and .cursorrules pay for themselves within hours. Compared to GitHub Copilot at $10/month: Cursor has deeper AI integration but requires switching editors. If you're committed to VS Code with extensions that don't work well in Cursor, stay with Copilot. If you can make the switch, most developers prefer Cursor's workflow within a week.
How do I stop Cursor from changing code I didn't want changed?
Three techniques: (1) Be explicit in your prompt — "Only change the validateUser function. Do not modify the schema definitions or any other functions." (2) Use Cmd+K instead of Composer — inline editing is more surgical. (3) In Composer, review each file hunk individually with Cmd+Y (accept) / Cmd+N (reject) instead of Cmd+. (accept all). The more precise your instruction, the more precise the output.
What is the difference between Cursor Chat and Cursor Composer?
Chat (Cmd+L) is conversational — you ask questions, get answers with code snippets, discuss options. It does not modify your files directly. Composer (Cmd+I) is agentic — you describe a task, and it generates a set of file modifications that you review and accept. Use Chat for understanding, debugging, and exploring. Use Composer for implementing. The shortcut Cmd+K (inline edit) is a third mode — it edits the selected code directly without a diff review step, useful for quick targeted changes.