The ultimate guide to mastering Cursor AI IDE
Keyboard shortcuts, Composer workflows, .cursorrules examples, and Reddit community wisdom
Shortcuts β’ Composer β’ Context β’ Rules β’ Models β’ MCP β’ Security β’ Troubleshooting β’ Reddit Tips β’ GPT-5.1 Guide β’ Known Bugs
π° December 2025: Anysphere (Cursor's parent company) valued at $29.3 billion after Series D funding, reflecting the explosive adoption of AI-assisted development.
Cursor is not just VS Code with AI - it's a fork that integrates LLMs directly into the rendering pipeline. This enables:
- Cursor Tab: Multi-line predictions (not just single line like Copilot)
- Composer: Autonomous multi-file editing agent
- Shadow Workspace: Background indexing for semantic search
- Native Diffs: Inline green/red diff visualization
Strategic thinking before coding. AI analyzes, plans, asks clarifying questions - then executes.
"Plan Mode forces 'measure twice, cut once' philosophy"
Millisecond codebase search. No more context hallucinations - agent verifies every reference instantly.
Run parallel agents using git worktrees:
- Agent 1: Refactoring component
- Agent 2: Writing tests
- No file lock conflicts
- 4x faster than general LLMs for diff-edit loops
- Codebase-wide semantic search
- Implicit checkpoints for instant rollback
Some features were removed in 2.0/2.1:
| Removed | Replacement |
|---|---|
| Interpreter Mode | Agent + Terminal |
| @Web, @Definitions | Auto-context |
| Reapply Button | Checkpoints |
| .cursorrules | .mdc files |
| Fast Request Packs | Usage-based pricing |
β Full Deprecated Features Guide
Popular "vibe coding" pattern for rapid prototyping:
1. Lovable β Design UI visually, connect to GitHub
2. Clone β Pull repo to local
3. Cursor β Add backend logic, APIs, complex features
4. Push β Sync back to Lovable
Users report building full SaaS products in 4 days using this hybrid approach.
β Full Lovable + Cursor Guide
| Command | Mac | Windows/Linux | Scope | When to Use |
|---|---|---|---|---|
| Inline Edit | Cmd + K |
Ctrl + K |
Single file | Quick fixes, rename, split function |
| Chat | Cmd + L |
Ctrl + L |
Conversational | Explain code, debug, explore |
| Composer | Cmd + I |
Ctrl + I |
Multi-file | Refactoring, new features |
| Composer Full | Cmd + Shift + I |
Ctrl + Shift + I |
Multi-file | Large refactors, review diffs |
| Add to Context | Cmd + Shift + L |
Ctrl + Shift + L |
Selection | Add selected code to chat |
| Terminal AI | Cmd + K (in terminal) |
Ctrl + K |
Shell | Generate shell commands |
Cmd + K β "Fix this type error"
Cmd + L β "Explain how auth works"
Cmd + I β "Refactor to use Axios instead of Fetch"
Pro Tip: Use
Cmd + Kfor local scope,Cmd + Ifor global scope. Don't useCmd + Kfor multi-file tasks.
β Full Shortcuts Guide | β Development Workflows
Composer is Cursor's killer feature - an autonomous agent that can plan and execute multi-file edits.
| Mode | Description | Risk Level |
|---|---|---|
| Normal | Proposes edits, you click "Accept" | Safe |
| Agent | Creates/deletes files, runs terminal |
Composer creates snapshots at each step. If the AI breaks something:
- Click previous Checkpoint
- Workspace reverts instantly
- Try different approach
β Bad: "Add a login page"
β Good:
Implement a login route:
- @user_model.ts @auth_service.ts @routes.json
- Use Zod for validation
- Match error format in @errors.ts
- Create unit test in tests/auth/
The AI is only as good as the context you provide.
| Symbol | What it does | Best for |
|---|---|---|
@Files |
Full file content | Active editing |
@Folders |
File tree + summaries | Architecture questions |
@Codebase |
Semantic RAG search | "Where is X used?" |
@Docs |
External documentation | Third-party APIs |
@Git |
Git history/diff | Commit messages, history |
@Web |
Web search | Current info |
@Codebase is probabilistic - if you call it "Login"
but code says "SessionCreation", RAG may fail.
Use explicit @Files for critical tasks.
Create a current_task_spec Notepad with:
- PRD / Requirements
- Design constraints
- Architecture decisions
Reference with @current_task_spec in every new chat.
β Full Context Guide | β Security Best Practices
System prompts that customize AI behavior per project.
Create .cursorrules in project root:
You are an expert TypeScript engineer.
Use functional components with Hooks.
Use Tailwind CSS for styling.
Never use CSS modules or styled-components.
Every function needs a unit test.
New system uses .cursor/rules/*.mdc with glob patterns:
---
description: "React Component Rules"
globs: ["src/**/*.tsx"]
alwaysApply: false
---
Use shadcn/ui for primitives.
Components in src/ui must be presentational only.
Business logic goes in src/services.| Category | Example Rule |
|---|---|
| Tech Stack | "Use Tailwind. Never styled-components." |
| Architecture | "Services in src/services, UI in src/ui" |
| Anti-Lazy | "Output FULL file. No placeholders. No //...existing code" |
| Testing | "Every function needs unit test in tests/" |
You are an expert engineer.
You DO NOT use placeholders.
You output the FULL content of the file every time.
You do not be lazy.
β Full .cursorrules Guide | β .mdc Examples
| Model | Best For | Context | Speed | Cost |
|---|---|---|---|---|
| Claude 4.5 Opus | Planning, reliability, backend | 200K | Medium | $$$ |
| GPT-5.1 High Max | Architecture, balanced reasoning | 128K | Medium | $$ |
| Gemini 3 Pro | Visuals, massive context, frontend | 2M | Fast | $ |
| Kimi k2 Thinking | Cost-effective reasoning, open-source | 256K | Medium | Β’ |
| Grok 4.1 | Personality, real-time data, vibe coding | 256K | Fast | $$ |
| Model | "Vibe" |
|---|---|
| Claude 4.5 | Strict Senior Developer |
| GPT-5.1 | Pragmatic Architect |
| Gemini 3 | Creative Designer |
| Kimi k2 | Efficient Researcher |
| Grok 4.1 | Witty Collaborator |
1. PLAN (Claude 4.5 / GPT-5.1 High):
"Analyze request. Don't code. Create plan.md"
2. CRITIQUE (Gemini 3 Pro - optional):
"Review plan.md for efficiency gaps"
3. EXECUTE (Composer / GPT-5.1):
"Implement Step 1 of plan.md. Run tests."
Don't over-prompt! Give high-level goals:
β "Write function that does X, Y, Z step by step"
β
"Goal: Implement resilient payment processor.
Reason about Stripe failure modes. Then output code."
Pro Plan ($20/mo):
βββ Credit pool system (fast vs slow)
βββ "Auto" mode switches models by task complexity
βββ Set per-user spending limits (Enterprise)
Strategy:
βββ Daily work β Pro Plan (Auto mode)
βββ Heavy refactoring β BYOK Claude 4.5
βββ Budget tasks β Kimi k2 via OpenRouter
βββ Hard bugs β GPT-5.1 High Max
Warning: Don't switch models mid-conversation. It breaks the "train of thought."
Model Context Protocol lets Cursor connect to databases, GitHub, and browsers.
Create mcp.json in project root:
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres", "${env:DATABASE_URL}"]
}
}
}| Server | Use Case |
|---|---|
server-postgres |
Query database schema |
github-mcp-server |
Manage PRs/Issues |
server-puppeteer |
Browser automation |
@playwright/mcp |
E2E testing, self-healing tests |
@sentry/mcp-server |
Production error debugging |
The most transformative MCP application:
1. Agent runs E2E test
2. Test fails (selector changed)
3. Agent analyzes DOM
4. Agent fixes test automatically
5. Agent verifies fix
β οΈ As AI agents gain autonomy, security risks increase exponentially.
The ability of an Agent to execute shell commands and connect to the internet (via MCP) introduces new risks:
| Risk | Description |
|---|---|
| Prompt Injection | Malicious READMEs or docs that trick the AI |
| Credential Exfiltration | Agent accessing environment variables |
| MCP Exploits | Malicious MCP servers hijacking machines |
| YOLO Mode Dangers | Auto-execution of destructive commands |
β
Review all terminal commands before approval
β
Use read-only MCP configurations
β
Audit .mdc files in cloned repositories
β
Never approve `env` or `printenv` commands
β
Set strict YOLO mode restrictions
β Don't trust arbitrary @Docs sources
β Don't enable unrestricted shell access
β οΈ "Vibe Coding" can create unmaintainable code
If you don't understand the AI-generated code:
- You can't debug it when AI fails
- It becomes "Legacy Code" immediately
- Security vulnerabilities go unnoticed
| Problem | Solution |
|---|---|
| "Connection Failed" | New chat (Cmd+L), disable HTTP/2 |
| "Stuck Generating" | New Composer (Cmd+N) |
| Files deleted by Agent | Use checkpoint to restore |
| Rules ignored | Restart Cursor |
| High token usage | Set API spending limits |
Don't reuse Composer windows. One task = one Composer. Prevents context pollution.
git add -A && git commit -m "checkpoint"β Full Troubleshooting Guide
Tips from r/cursor power users:
If debugging exceeds ~20 messages, context is polluted. Start NEW chat with summary.
In Agent mode, Cursor sometimes deletes and recreates files instead of editing. Always commit before Agent sessions.
Paste UI bug screenshots directly into chat. Vision models diagnose CSS issues better than text descriptions.
Set hard limits in OpenAI/Anthropic dashboard. Runaway Agent loops can drain your credit card.
Don't switch from GPT-4o to Claude mid-task. Stick to one model per conversation.
1. Discovery: "Map usage of User component" (no code yet)
2. Plan: "Propose refactor plan, list affected files"
3. Critique: Review plan, challenge assumptions
4. Execute: Open Composer, paste approved plan
5. Audit: Review git diff line-by-line
1. "Write Vitest test for compound interest calculator"
2. Review test logic
3. "Now write function to pass this test"
1. Command fails in terminal
2. Click "Debug with AI" button
3. AI gets full error context automatically
4. Don't manually copy-paste errors
| Feature | Cursor 2.1 | Google Antigravity | Windsurf | GitHub Copilot |
|---|---|---|---|---|
| Philosophy | Augmentation | Full Autonomy | Augmentation | Assistance |
| Architecture | Fork (Native) | New IDE | Fork (Native) | Extension |
| Multi-File | Composer β | Agents | Cascade | Limited |
| Model Choice | All models | Gemini only | Proprietary | OpenAI only |
| Special | Plan Mode, Instant Grep | Mission Control, Artifacts | Auto-context | Enterprise SSO |
| Price | $20/mo (500 fast/mo) | Free Preview | $15/mo | $10/mo |
| Aspect | Cursor | Antigravity |
|---|---|---|
| Control | Developer is pilot | Developer is mission controller |
| Verification | Git diffs, code review | Artifacts (screenshots, logs) |
| Best For | Precision, existing codebases | Greenfield, rapid prototyping |
| Lock-in | Model agnostic | Google ecosystem |
A critical differentiator between Cursor and Windsurf:
| Aspect | Cursor | Windsurf |
|---|---|---|
| Autonomy | Asks permission by default | Acts proactively |
| Shell Commands | Requires approval | Often auto-executes |
| User Feeling | Controlled, predictable | "Magical" but scary |
"Windsurf feels magical to new users, but terrifying to senior engineers who want to review every shell command."
Verdict: Cursor for control and precision. Antigravity for full automation experiments. Windsurf for auto-context (but watch the autonomy). Copilot for enterprise compliance.
β Full Comparison | β Cursor vs Windsurf Deep Dive
The new development paradigm where domain experts focus on intent while AI implements.
| Type | Description | Strength | Risk |
|---|---|---|---|
| Shadow Engineer | Manages AI agents, writes PRDs, verifies output | Full control, maintainable code | Slower iteration |
| Vibe Coder | Relies entirely on natural language | Rapid MVPs | "Black box" code, debugging walls |
β οΈ Warning: If you don't understand the AI-generated code, you can't debug it when AI fails. It becomes "Legacy Code" immediately.
Traditional: Developer writes code β Tests β Iterates
Vibe Coding: Developer describes intent β AI implements β Developer reviews
- Tradofire: Solo developer shipped complex crypto trading app
- Enterprise ERP: Full-scale systems built in weeks using TaskMaster workflow
1. Generate detailed PRD (Product Requirement Document)
2. Feed PRD to task management system
3. Agent parses PRD into individual tickets
4. Execute tickets one by one
5. Human review at each milestone
The deployment of GPT-5.1 Codex (December 2025) introduced new capabilities and quirks.
The new "smart" model sometimes behaves "stupidly" due to over-reasoning and safety alignment:
- Over-analyzes simple requests
- Hallucinated constraints (e.g., insisting VPS is required)
- Conservative refusals on legitimate security utilities
Complex Architecture Planning β GPT-5.1 Codex Max (expensive)
Implementation Details β Gemini 3 Pro or Claude Sonnet (cheaper)
Use Composer over raw chat β Cursor's agent harness improves model behavior significantly.
A powerful technique to combat AI hallucinations:
"Fix this only if you are 100% confident. Tell me your confidence score."
This prompt bypasses the "helpful assistant" persona and accesses the model's raw probability assessment, forcing it to:
- Re-evaluate its own logic
- Search for actual evidence
- Admit uncertainty instead of hallucinating
β Full Confidence Scoring Guide
UI shows diffs but files are never written to disk. Always verify file timestamps after accepting changes.
ls -la --time=modified <filename>
git diff| Bug | Severity | Status |
|---|---|---|
| Plan mode not writing files | CRITICAL | Open |
| Todo List corruption | CRITICAL | Open |
| Ghost Process spawn (rg.exe) | HIGH | Fixed in v2.1.39 |
| Context Decay | MEDIUM | Workaround: Session Reset |
| PowerShell variable expansion | MEDIUM | Manual escaping required |
New competitor capturing "Early Adopter" mindshare with parallel agents and free preview.
| Feature | Cursor | Antigravity |
|---|---|---|
| Multi-Agent | Sequential | Parallel |
| Price | $20/mo | Free Preview |
| Verification | Git diffs | Artifacts |
| Best For | Precision | Rapid prototyping |
The Hybrid Workflow: Users exhaust Cursor credits, then switch to free Antigravity.
β Full Google Antigravity Guide
Sophisticated patterns from production teams:
If existing code is altered, warn by shouting:
βοΈSHOUT WITH LARGE LETTERSβοΈ
"WARNING: Modified existing function in file.ts"
Presentation components must include "Dumb" in filename:
- UserProfileCardDumb.vue
- ProductListDumb.tsx
NEVER use page.waitForTimeout(5000)
ALWAYS use built-in auto-wait mechanisms
Target elements using data-testid attributes
β Full Advanced .cursorrules Guide
Based on community intelligence:
- Enforce Confidence Scoring: Mandate for all debugging tasks
- Adopt Interface Freeze: Don't let AI define architecture
- Implement Rigid .cursorrules: Copy "Dumb Component" and "Auto-Wait" patterns
- Monitor Plan Bug: Verify file timestamps after every Accept
- Session Reset Cadence: Clear context every 2-4 hours
- Commit Before Agent: Always
git commit -m "checkpoint"
- Learn
Cmd + Kfor inline edits - Learn
Cmd + Lfor chat - Use
@Filesto add context
- Master
Cmd + IComposer - Create
.cursorrules - Use
@Codebasefor exploration
- Agent Mode with checkpoints
- Custom
.mdcrules per file type - Research-First protocol
- BYOK API for heavy tasks
Found a tip? Share it!
- Fork this repo
- Add your tip to relevant file
- Include source (Reddit, Twitter, etc.)
- Open PR