Cursor Tutorial: How to Use Cursor AI Editor in 2026
Complete Cursor tutorial for 2026: learn Agent Mode, Composer, keyboard shortcuts, MCP setup, and advanced features to maximize your AI coding workflow.
Cursor Tutorial: How to Use Cursor AI Editor in 2026
Cursor is the most powerful AI-powered code editor in 2026, combining the familiar VS Code interface with advanced AI features like Agent Mode (autonomous multi-file editing), Composer (structured refactoring), and multi-model support (Claude, GPT, Grok).
This complete tutorial walks you through everything from installation to advanced workflows, helping you code 10x faster with AI assistance.
What Is Cursor?
Cursor is a VS Code fork with built-in AI capabilities. Unlike GitHub Copilot (which is an extension), Cursor integrates AI at the core level, enabling features that extensions cannot provide:
- Agent Mode: AI edits multiple files autonomously
- Composer: Plan and preview large refactors before applying
- Multi-model: Switch between Claude, GPT, and Grok per task
- MCP: Connect to external data sources (Notion, GitHub, Figma)
Step 1: Installation and Setup
Download and Install
- Go to cursor.com
- Download for your OS (Windows, Mac, Linux)
- Install like any app
- On first launch, Cursor imports your VS Code settings, extensions, and keybindings
Migration tip: Cursor is a VS Code fork, so all your VS Code extensions work immediately.
Sign Up and Choose a Plan
| Plan | Price | Features |
|---|---|---|
| Hobby | Free (14 days) | 50 requests/month, basic models |
| Pro | $20/month | 500 fast requests, Claude Sonnet, GPT-4o, Agent Mode |
| Pro+ | $60/month | 2,000 requests, priority access |
| Ultra | $200/month | Unlimited requests, all premium models |
Recommendation: Start with the 14-day free trial, then upgrade to Pro ($20/month) for serious development.
Configure Your First API Key (Optional)
Cursor Pro includes built-in models, but you can add your own API keys for:
- OpenAI GPT models
- Anthropic Claude models
- Custom models via MCP
Settings → Models → Add API Key
Step 2: Core Features and Keyboard Shortcuts
1. Autocomplete (Tab)
What it does: Suggests code as you type, press Tab to accept.
Keyboard shortcut: Just type, press Tab to accept
Use case: Writing new code line-by-line
Example:
// Type: function calculate
// Cursor suggests:
function calculateTotal(items: Item[]): number {
return items.reduce((sum, item) => sum + item.price, 0);
}
// Press Tab to acceptPro tip: Cursor learns from your codebase. The more you code, the better suggestions become.
2. Cmd+K (Inline Edit)
What it does: Edit code inline with AI assistance.
Keyboard shortcut:
- Mac:
Cmd+K - Windows/Linux:
Ctrl+K
Use case: Quick fixes, refactors, improvements within one file
Example workflow:
- Select code to modify
- Press
Cmd+K - Type instruction: “Add error handling”
- Cursor rewrites the selected code
- Accept or reject the change
Common prompts:
- “Add TypeScript types”
- “Convert to async/await”
- “Add JSDoc comments”
- “Optimize this function”
3. Cmd+L (Chat)
What it does: Chat with AI about your code, ask questions, get explanations.
Keyboard shortcut:
- Mac:
Cmd+L - Windows/Linux:
Ctrl+L
Use case: Understanding code, debugging, asking “how to” questions
Example:
You: "How does this authentication middleware work?"
Cursor: [Reads the file and explains the logic step-by-step]
You: "Why is this API call failing?"
Cursor: [Analyzes logs and suggests fixes]Pro tip: Use @filename to reference specific files in your questions.
4. Cmd+I → Agent Mode (Multi-file)
What it does: AI autonomously edits multiple files, runs commands, and verifies changes.
Keyboard shortcut:
- Mac:
Cmd+I→ select “Agent” - Windows/Linux:
Ctrl+I→ select “Agent”
Use case: Large refactors, feature implementation, bug fixes across multiple files
Example workflow:
You: "Refactor the user authentication to use JWT instead of sessions"
Cursor Agent:
1. Reads auth middleware, user model, session config (8 files)
2. Generates JWT utility functions
3. Updates all authentication endpoints
4. Modifies the database schema
5. Updates tests
6. Runs tests to verify everything works
7. Presents the complete refactor for your reviewWhen to use Agent Mode:
- Multi-file refactors (3+ files)
- Implementing new features
- Debugging complex issues
- Migrating libraries or frameworks
When NOT to use Agent Mode:
- Simple one-line changes (use Cmd+K)
- Quick questions (use Cmd+L)
- Learning/exploring (Agent Mode consumes more quota)
5. Composer (Structured Refactoring)
What it does: Plan and preview large changes before applying them.
How to access:
- Click “Composer” button in top-right
- Or press
Cmd+Shift+I(Mac) /Ctrl+Shift+I(Windows/Linux)
Use case: When you want to see the full plan before AI makes changes
Workflow:
- Open Composer
- Describe the change: “Convert REST API to GraphQL”
- Composer shows a step-by-step plan
- Review the plan
- Click “Apply” to execute
- Review diff for each file
- Accept or reject each change individually
Composer vs Agent Mode:
- Composer: You control each step, see diffs before applying
- Agent Mode: AI works autonomously, you review at the end
Step 3: Advanced Features
Multi-Model Switching
Cursor supports multiple AI models. Choose the best one for each task:
Claude Sonnet 3.7: Best for complex refactors, long context (200K tokens)
GPT-4o: Fastest, best for autocomplete and quick tasks
GPT-5.6: Best reasoning for algorithms
o1-preview: Advanced reasoning for complex problems
How to switch models:
- Open settings (Cmd+,)
- Search “model”
- Choose default model
- Or switch per-request in Chat/Agent panels
Pro tip: Use GPT-4o for autocomplete (fast), Claude Sonnet for Agent Mode (better at multi-file).
Using @Commands for Context
Add specific context to your AI requests:
@Files: Include specific files@Folders: Include entire folders@Codebase: Search entire codebase@Docs: Reference documentation@Web: Search the web@Git: Reference git history
Example:
@Files src/auth/middleware.ts @Files src/models/user.ts
"Make these two files consistent with each other"MCP (Model Context Protocol) Setup
MCP lets Cursor access external data sources:
Available MCP servers:
- GitHub (issues, PRs, code search)
- Notion (documentation, notes)
- Figma (design files)
- Linear (project management)
- Slack (team communication)
Setup MCP:
- Settings → Features → Model Context Protocol
- Click ”+ Add MCP server”
- Choose a server (e.g., GitHub)
- Authenticate with your account
- Now Cursor can read GitHub issues, PRs, etc.
Use case example:
You: "@GitHub fetch issue #245 and fix the bug"
Cursor: [Reads the GitHub issue, understands the bug, fixes it across multiple files].cursorrules (Custom Instructions)
Create a .cursorrules file in your project root to give Cursor project-specific instructions:
Example .cursorrules:
# Project Rules
## Code Style
- Use TypeScript strict mode
- Prefer functional components in React
- Use async/await over promises
- Add JSDoc for public functions
## Naming Conventions
- Components: PascalCase
- Functions: camelCase
- Constants: UPPER_SNAKE_CASE
## Testing
- Write tests for all new features
- Use Jest and React Testing Library
- Aim for 80%+ coverage
## Imports
- Absolute imports from `~/`
- Group by: React, external, internal, stylesCursor reads .cursorrules and follows your project conventions automatically.
Step 4: Real-World Workflows
Workflow 1: Implementing a New Feature
Task: Add user authentication to an app
Steps:
- Open Composer (
Cmd+Shift+I) - Prompt: “Add JWT authentication with login/register endpoints”
- Review the plan (Composer shows 10 steps)
- Click “Apply”
- Review each file diff
- Accept changes
- Run tests to verify
- Commit to git
Time saved: 2-3 hours → 20 minutes
Workflow 2: Debugging a Complex Bug
Task: API call fails intermittently
Steps:
- Open Chat (
Cmd+L) - Prompt: “@Files api/auth.ts Why does authentication fail sometimes?”
- Cursor analyzes the file and logs
- Cursor: “Race condition in token refresh logic”
- You: “Fix it”
- Cursor rewrites the problematic section
- Test and verify
Time saved: 1-2 hours → 10 minutes
Workflow 3: Refactoring Legacy Code
Task: Refactor a messy 500-line component
Steps:
- Open Agent Mode (
Cmd+I → Agent) - Prompt: “Refactor UserProfile.tsx: extract components, add TypeScript types, improve performance”
- Agent works autonomously:
- Splits into 5 smaller components
- Adds TypeScript interfaces
- Optimizes re-renders with useMemo
- Updates tests
- Review the changes
- Accept and commit
Time saved: 4-6 hours → 30 minutes
Step 5: Pro Tips and Best Practices
1. Use Specific Prompts
❌ Bad: “Make this better”
✅ Good: “Add error handling, TypeScript types, and unit tests”
❌ Bad: “Fix bug”
✅ Good: “Fix the authentication timeout issue in auth.ts line 45”
2. Break Large Tasks into Steps
Instead of: “Rewrite the entire authentication system”
Do this:
- “Extract JWT utility functions”
- “Update login endpoint to use JWT”
- “Update middleware to verify JWT”
- “Add refresh token logic”
Smaller steps = better results + easier to review.
3. Review Before Accepting
Always review AI-generated code:
- Check for security issues
- Verify logic correctness
- Ensure tests pass
- Run the app to confirm it works
AI is powerful but not perfect. You’re still the engineer.
4. Pin Your Preferred Model
If you prefer Claude for refactors and GPT for autocomplete:
- Settings → Models
- Set “Autocomplete model” to GPT-4o
- Set “Chat/Agent model” to Claude Sonnet 3.7
This prevents quota waste on the wrong model.
5. Monitor Your Quota
Cursor Pro gives 500 fast requests/month:
- 1 autocomplete = 0 credits (free)
- 1 Cmd+K = 1 credit
- 1 Agent Mode task = 1-3 credits
Check remaining quota: Settings → Usage
If you run out, either:
- Wait until next month
- Upgrade to Pro+ ($60/month, 2,000 credits)
- Use your own API key (pay per token)
Learn how to optimize quota usage
Step 6: Common Issues and Solutions
Issue 1: “Quota exceeded”
Solution:
- Use Cmd+K for small changes (1 credit vs Agent Mode 3 credits)
- Pin GPT-4o for fast tasks (cheaper than Claude)
- Upgrade to Pro+ or use your own API key
Issue 2: Agent Mode is slow
Solution:
- Agent Mode analyzes multiple files, runs tests, verifies changes
- For quick edits, use Cmd+K instead
- Reduce the number of files Agent needs to read
Issue 3: Autocomplete suggestions are wrong
Solution:
- Cursor learns from your codebase over time
- Add a
.cursorrulesfile with your project conventions - Use
@Filesto give more context for specific suggestions
Issue 4: Can’t install extensions
Solution:
- Cursor uses VS Code extensions directly
- Open Extensions panel (
Cmd+Shift+X) - Search and install like VS Code
Frequently Asked Questions
Is Cursor better than GitHub Copilot?
Cursor has more advanced features (Agent Mode, Composer, multi-model). Copilot has faster autocomplete and costs less. Choose Cursor for complex projects, Copilot for simple autocomplete.
Do I need to learn new shortcuts?
No. Cursor uses VS Code shortcuts by default. The AI features add a few new shortcuts (Cmd+K, Cmd+L, Cmd+I), but all your VS Code muscle memory works.
Can I use Cursor with my existing projects?
Yes. Cursor works with any project. Just open the folder in Cursor like you would in VS Code.
Does Cursor work offline?
No. Cursor requires internet to access AI models. Autocomplete and basic editing work offline, but AI features require a connection.
How much does Cursor cost?
$20/month for Pro (500 fast requests). Free 14-day trial available. Get Cursor Pro from $15/month
Next Steps
Now that you understand Cursor’s core features, try these:
- Install Cursor and complete the 14-day free trial
- Try Agent Mode on a real refactoring task in your codebase
- Set up MCP to connect GitHub or Notion
- Create a
.cursorrulesfile with your project conventions - Compare models (Claude vs GPT) for different tasks
Get Cursor Pro | View Pricing | Contact Us
Related Articles:
