Complete Guide AI Code Editor 2025

Cursor AI: The Complete Guide

Master vibe coding with Cursor - from your first autocomplete to Background Agents and MCP servers. Everything beginners and power users need to know.

~25 minute read | Last updated December 2025

Quick Answer

Cursor is an AI-powered code editor built on VS Code that offers Tab autocomplete, multi-file editing via Composer, and autonomous Agent mode. It supports Claude, GPT-4, and other models. Free tier available, Pro is $20/month. Best for: greenfield projects, rapid prototyping, and developers who want AI to write code directly into their files.

What is Cursor?

Cursor is an AI-first code editor that has quickly become the go-to tool for vibe coding. Built on VS Code, it feels instantly familiar to millions of developers while adding powerful AI capabilities that go far beyond simple autocomplete. Where GitHub Copilot suggests code line by line, Cursor can edit entire files, run terminal commands, and complete multi-step tasks autonomously.

The company behind Cursor raised $60 million in 2024 at a $400 million valuation, with backing from OpenAI and Andreessen Horowitz. By late 2024, Cursor reported reaching $100 million ARR - remarkable growth that reflects how many developers have embraced AI-assisted coding.

What makes Cursor different from other AI coding tools is its integrated approach. Rather than being a plugin to an existing editor, Cursor was designed from the ground up around AI interaction patterns. Features like Composer (multi-file editing) and Agent mode (autonomous task completion) are first-class citizens, not afterthoughts.

Why "vibe coding"? The term describes building software by describing what you want to the AI rather than writing every line yourself. Cursor is one of the most popular tools in this new paradigm, letting developers "vibe" their way through coding tasks while the AI handles implementation details.

Who is Cursor for?

  • Beginners learning to code - Cursor explains concepts, suggests solutions, and helps you understand patterns as you build
  • Professional developers - Accelerate routine tasks like writing boilerplate, tests, and documentation
  • Indie hackers and entrepreneurs - Ship MVPs and prototypes dramatically faster
  • Teams building new products - Composer and Agent mode excel at greenfield development

Getting Started with Cursor

Setting up Cursor takes about 5 minutes. The experience is nearly identical to VS Code, so if you have used VS Code before, you will feel right at home.

Installation

  1. Download Cursor

    Visit cursor.com and download for your platform (Mac, Windows, or Linux).

  2. Import VS Code settings

    On first launch, Cursor offers to import your existing VS Code extensions, themes, and settings. Accept this to maintain your workflow.

  3. Create a Cursor account

    Sign up for free to get 2,000 completions/month and 50 premium requests. No credit card required.

  4. Open a project

    Open any folder or clone a repository. Cursor indexes your codebase automatically for context-aware suggestions.

Your first AI interaction

The fastest way to experience Cursor is to start typing in any file. Within seconds, you will see gray "ghost text" suggesting what comes next. Press Tab to accept, or keep typing to ignore.

For more complex tasks, press Cmd+L (Mac) or Ctrl+L (Windows/Linux) to open Chat. Ask questions like "How do I add authentication to this app?" or "Explain what this function does." Cursor sees your entire codebase as context.

Tip: Start with Chat mode to get comfortable with AI interactions. Once you understand how Cursor thinks, graduate to Composer for more powerful multi-file editing.

Tab Autocomplete: The Foundation

Tab autocomplete is Cursor's most basic feature - and the one you will use thousands of times a day. As you type, Cursor predicts what you are trying to write and shows suggestions as gray "ghost text" that you accept with Tab.

Unlike traditional autocomplete that only suggests variable names or function signatures, Cursor's Tab completion can suggest entire code blocks, function implementations, or even multiple lines at once. It understands your project's patterns and coding style.

How Tab works under the hood

Cursor uses a custom model called "cursor-small" for most Tab completions. This model is optimized for speed - suggestions appear in under 100ms. For more complex completions, Cursor may use Claude or GPT-4, though this counts against your premium request quota.

In late 2024, Cursor released its "Tab model" trained specifically for multi-line suggestions. The company claims it produces 21% fewer suggestions but with 28% higher accept rates - meaning it is better at predicting what you actually want.

Mastering Tab autocomplete

Tab Autocomplete Tips
// 1. Write a clear comment, then Tab for implementation
// Function to validate email format and check domain
function validateEmail(email) // Press Tab here

// 2. Start a pattern, Tab completes the rest
const routes = [
  { path: '/', component: Home },
  // Cursor predicts remaining routes from context

// 3. Partial accept with Cmd+Right
// Accept one word at a time for more control

// 4. Continue typing to refine
// If suggestion is close but not right, keep typing
// Cursor will adjust its prediction

Tab settings to know

  • Cursor Prediction - Enable to see cursor position after accepting (shows where you will be typing next)
  • Partial Accepts - Use Cmd/Ctrl+Right to accept word by word
  • Tab in comments - Cursor can complete comments too, not just code

Chat Mode (Cmd+L): Your AI Pair Programmer

Chat mode opens a conversational interface where you can ask questions, discuss architecture, and get code suggestions. Unlike Composer, Chat does not edit your files directly - it shows code that you can copy or apply manually. This makes it safer for exploring ideas.

Press Cmd+L (Mac) or Ctrl+L (Windows) to open Chat. The panel appears on the right side of your editor with a text input at the bottom.

Using @ references

The @ symbol is how you give Chat specific context. Instead of describing files, reference them directly:

@ References
@Files      - Reference specific files in your project
@Folders    - Include entire folder contents
@Code       - Reference specific code symbols (functions, classes)
@Docs       - Search indexed documentation
@Web        - Search the web for current information
@Git        - Reference git diff, commits, or history
@Codebase   - Search your entire codebase semantically

Examples:
"@schema.prisma add a Post model with title and content"
"Explain what @utils/auth.ts does"
"@Docs Next.js how do I add API routes?"
"@Codebase where is user authentication handled?"

Chat best practices

  • Add context with Cmd+Shift+L - Select code and press this shortcut to add it to Chat automatically
  • Be specific about what you want - "Add error handling to this function" beats "improve this"
  • Ask follow-up questions - Chat maintains conversation history, so you can iterate
  • Use @Codebase for discovery - Great for understanding unfamiliar codebases
Pro tip: If you select code before pressing Cmd+L, that code is automatically added as context. This is faster than typing @Files references manually.

Composer (Cmd+I): Multi-File Editing

Composer is where Cursor truly shines. Press Cmd+I to open Composer, describe what you want, and Cursor writes code directly into your files. It can create new files, modify existing ones, and coordinate changes across your entire codebase.

Think of Composer as Chat with superpowers. Instead of showing you code to copy, it applies changes for you. You see a diff view of proposed edits and can accept or reject each change.

Composer 2.0 (October 2024)

The Cursor team released a major Composer update in late 2024. Key improvements include:

  • 4x faster than comparable models - The new speculative edits system dramatically reduces latency
  • Better multi-file coordination - Changes across files are more consistent
  • Improved diff interface - Clearer visualization of what is changing
  • Background processing - Composer can work while you do other things

Composer workflow

Composer Workflow
1. Press Cmd+I to open Composer

2. Describe your goal clearly:
   "Create a user registration form with email/password
    validation, integrate with the existing auth.ts,
    and add a new API route at /api/auth/register"

3. Review the diff view:
   - Green = additions
   - Red = deletions
   - Click file tabs to see each change

4. Accept or reject:
   - Cmd+Enter accepts all changes
   - Click individual hunks to accept/reject parts
   - Type follow-up to refine

5. Iterate:
   "Also add password confirmation field"
   "Use zod for validation instead"

When to use Composer vs Chat

Implementing new features
Composer Best choice
Chat -
Asking questions about code
Composer -
Chat Best choice
Refactoring across files
Composer Best choice
Chat -
Understanding architecture
Composer -
Chat Best choice
Creating components/modules
Composer Best choice
Chat -
Debugging (discussion mode)
Composer -
Chat Best choice
Writing tests for code
Composer Best choice
Chat -
Learning new concepts
Composer -
Chat Best choice
Adding integrations
Composer Best choice
Chat -
Exploring options before committing
Composer -
Chat Best choice

Agent Mode: Autonomous Coding

Agent mode takes Composer further by giving AI the ability to execute terminal commands, read command output, and iterate until your goal is complete. Instead of just writing code, Agent can run tests, check for errors, and fix problems autonomously.

Enable Agent mode by toggling the "Agent" switch in Composer or using the keyboard shortcut. You will see a "thinking" indicator as Agent plans its approach, then watch as it executes commands and edits files.

What Agent mode can do

  • Run terminal commands - npm install, git operations, test runners
  • Read command output - Parse errors and fix them automatically
  • Create and delete files - Full filesystem access within your project
  • Install dependencies - Add packages and configure them
  • Run builds and tests - Verify changes work before completing
  • Multi-step planning - Break complex tasks into subtasks
Caution: Agent mode runs real commands on your system. Always review what Agent is doing, especially for destructive operations like rm or database modifications. Consider using a Git branch so you can easily revert.

Background Agents (Pro+ feature)

With a Pro+ subscription ($60/month), you get access to Background Agents. These run asynchronously - you can start an agent, close Cursor, and check back later. Key features:

  • Up to 8 parallel agents - Work on multiple features simultaneously
  • Git worktree isolation - Each agent works in its own branch
  • Progress tracking - See status and logs for each agent
  • Async workflow - Assign work and come back when complete

Agent mode best practices

  1. Start with a clear goal

    "Add user authentication with email/password login, session management, and protected routes"

  2. Provide constraints

    "Use the existing database schema, don't install new dependencies unless necessary"

  3. Work on a branch

    Agent makes many changes quickly. A dedicated branch lets you review and revert easily.

  4. Monitor progress

    Watch the terminal output. If Agent seems stuck or doing something wrong, interrupt early.

Inline Edit (Cmd+K): Quick Edits

Inline edit is the fastest way to make small, targeted changes. Select some code, press Cmd+K, describe your change, and Cursor rewrites the selection in place. No separate panel, no context switching.

You can also use Cmd+K without a selection to generate code at your cursor position. This is useful for quickly generating a function, adding a code block, or filling in implementation details.

Inline edit examples

Cmd+K Examples
// Select a function, Cmd+K:
"Add error handling with try/catch"
"Convert to async/await"
"Add TypeScript types"
"Make this more performant"

// Cursor on empty line, Cmd+K:
"Write a function to validate email"
"Create a React component for user cards"
"Add a test for the above function"

// Select variable, Cmd+K:
"Rename to camelCase"
"Convert to const with destructuring"

When to use Cmd+K vs Composer

Use Cmd+K for quick, localized changes - a single function, a few lines, a quick refactor. Use Composer when changes span multiple files or require more complex coordination. The mental model: Cmd+K is a surgical tool, Composer is for construction projects.

.cursorrules: Project Context That Persists

A .cursorrules file in your project root gives Cursor persistent context about your codebase. Instead of repeating the same instructions in every prompt, define them once and Cursor applies them to all AI interactions in that project.

Think of .cursorrules as a system prompt for your project. It can include coding standards, architectural decisions, common patterns, and things to avoid.

Example .cursorrules file

.cursorrules
# Project: E-commerce Platform

## Tech Stack
- Next.js 14 with App Router
- TypeScript strict mode
- Tailwind CSS for styling
- Prisma with PostgreSQL
- NextAuth for authentication

## Coding Standards
- Use functional components with hooks
- Prefer named exports over default exports
- Use async/await, never .then() chains
- Add TypeScript types to all functions
- Error handling: always use try/catch with specific error types

## File Organization
- Components in /components with index.ts barrel exports
- API routes in /app/api following REST conventions
- Database queries in /lib/db with Prisma

## Security Requirements
- Always use parameterized queries (never template literals for SQL)
- Validate all user input with zod
- Check authentication and authorization on all API routes
- Never expose sensitive data in client components

## Things to Avoid
- Don't use 'any' type
- Don't install new dependencies without asking
- Don't use inline styles, use Tailwind
- Don't create new folders without following existing structure

The new .cursor/rules folder

Cursor now supports a .cursor/ folder with modular rule files using the .mdc extension. This allows for better organization:

Folder Structure
.cursor/
├── rules/
│   ├── general.mdc      # Project-wide rules
│   ├── frontend.mdc     # React/UI rules
│   ├── backend.mdc      # API/database rules
│   └── testing.mdc      # Test patterns
└── settings.json        # Cursor-specific settings

Finding good .cursorrules

You do not need to write rules from scratch. The community has created extensive collections:

Tip: Start with a rules file from cursor.directory for your stack, then customize based on your team's conventions. A good .cursorrules file saves hours of repeated instructions.

MCP Servers: Extending Cursor's Capabilities

Model Context Protocol (MCP) is an open standard that lets AI tools connect to external services. In Cursor, MCP servers extend what AI can access - databases, APIs, file systems, browsers, and more.

MCP was developed by Anthropic and adopted by Cursor, Claude Code, and other tools. It provides a standard way for AI to safely interact with external systems without giving unrestricted access.

Setting up MCP servers

  1. Open Cursor Settings

    Go to Cursor Settings > Features > MCP Servers

  2. Add a server configuration

    Click "Add New MCP Server" and configure the server command and arguments

  3. Test the connection

    Cursor shows server status. Green means connected and ready.

Popular MCP servers

  • Filesystem - Extended file operations beyond your project
  • PostgreSQL/MySQL - Direct database access and queries
  • GitHub - Create issues, PRs, read repositories
  • Slack - Send messages and read channels
  • Browser - Web browsing and scraping
  • Puppeteer - Browser automation for testing
MCP Configuration Example
// In Cursor settings or .cursor/mcp.json
{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/dir"]
    },
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_TOKEN": "your-github-token"
      }
    }
  }
}

For more on MCP, see the official MCP servers repository with implementations and documentation.

Keyboard Shortcuts: Speed Up Your Workflow

Mastering shortcuts is the difference between a casual user and a power user. Cursor inherits all VS Code shortcuts and adds AI-specific ones. Here are the essential Cursor shortcuts:

Cmd/Ctrl + L
Open Chat Start a new conversation with AI
Cmd/Ctrl + I
Open Composer Multi-file editing and code generation
Cmd/Ctrl + K
Inline Edit Edit selected code or generate at cursor
Cmd/Ctrl + Shift + L
Add to Chat Add selected code to chat context
Tab
Accept Suggestion Accept the current autocomplete
Cmd/Ctrl + →
Accept Word Accept one word of the suggestion
Escape
Dismiss Dismiss suggestion or close panel
Cmd/Ctrl + /
Toggle Comment Comment/uncomment selection
Cmd/Ctrl + Enter
Run/Submit Submit chat or run command
@
Context Menu Reference files, docs, or symbols in chat

The "power user" shortcut flow

Efficient Workflow
1. Navigate to file:           Cmd+P (quick open)
2. Find in file:               Cmd+F
3. Select code:                Shift+Arrow or Cmd+Shift+L (select line)
4. Quick edit:                 Cmd+K (inline edit)
5. Multi-file change:          Cmd+I (Composer)
6. Ask question:               Cmd+L (Chat)
7. Add context:                Cmd+Shift+L (add selection to chat)
8. Accept suggestion:          Tab
9. Accept word:                Cmd+Right
10. Navigate back:             Cmd+Alt+Left

Combine for speed:
Select → Cmd+Shift+L → Ask question → Apply fix → Tab → Done

Models and Pricing

Cursor supports multiple AI models from different providers, and you can switch models per-request. Premium models count against your monthly quota, while the built-in cursor models are optimized for speed and cost.

Available models

Cursor offers models from multiple providers:

  • Anthropic Claude models - Generally the default and best for most coding tasks
  • OpenAI GPT models - Good alternative when you need different reasoning patterns
  • OpenAI o1 models - Chain-of-thought reasoning for complex problems, slower but powerful
  • Google Gemini models - Additional option with different strengths
  • cursor-small - Cursor's own fast model optimized for Tab autocomplete

Model availability and versions change frequently. Check Cursor's model documentation for the current list of available models and their capabilities.

Pricing overview

Cursor offers a free tier and three paid plans. The Hobby tier is free with 2,000 completions/month and 50 slow premium requests - enough to try it out. Pro at $20/month is the sweet spot for most developers, with unlimited completions and 500 fast premium requests.

Power users can upgrade to Pro+ at $60/month for unlimited fast requests and Background Agents, or Ultra at $200/month for heavy enterprise use with o1-pro access. Teams pricing starts at $40/user/month with centralized billing and admin controls.

Check cursor.com/pricing for current pricing and feature details.

Advanced Tips for Power Users

Once you are comfortable with the basics, these advanced techniques will take your Cursor workflow to the next level.

1. Use @Codebase strategically

The @Codebase reference does a semantic search across your entire project. Use it to find related code, understand patterns, and ensure consistency. But use sparingly - it consumes more tokens and is slower than specific @Files references.

2. Create custom documentation indexes

In Cursor Settings > Features > Docs, you can add custom documentation URLs. Cursor indexes these and makes them available via @Docs. Add your framework's docs, internal wikis, or API references.

3. Chain Composer tasks

Instead of one massive prompt, break work into steps. First: "Create the data model." Review and accept. Then: "Add API routes for CRUD operations." Review. Then: "Add the frontend components." This gives you control points and better results.

4. Use Notepads for context

Cursor Notepads are scratchpads that persist across sessions. Use them to store:

  • Architecture decisions and rationale
  • API documentation for external services
  • Code snippets you reference often
  • Meeting notes and requirements

Reference notepads in Chat with @Notepads.

5. Debug with the terminal

When Agent mode runs commands, watch the terminal output carefully. If you see errors, you can often catch problems before Agent starts fixing the wrong thing. Sometimes interrupting early and refining your prompt is faster than letting Agent struggle.

6. Leverage git branches

For any significant Agent task, create a branch first. Agent makes many changes quickly, and having a clean branch means you can easily diff, review, and revert if needed.

7. Combine with Claude Code

Some developers use Cursor for visual editing and Claude Code (terminal-based) for complex refactoring or when they need more control. The tools complement each other - Claude Code has unlimited context and better file handling for large changes.

Video Tutorials

Sometimes watching someone use Cursor is more helpful than reading about it. These YouTube tutorials cover everything from getting started to advanced workflows.

Recommended learning path: Start with Lee Robinson's 50-minute tutorial for a complete overview, then watch Nat Eliason's full-stack build for practical application. Come back to the Fireship comparison and Agent deep-dive as you advance.

Resources

Bookmark these resources for when you need help, inspiration, or the latest updates.

Security considerations

Like all AI coding tools, Cursor can generate code with security vulnerabilities. We maintain a dedicated guide on Cursor Security Patterns covering common issues like SQL injection, missing authentication, and hardcoded secrets.

Cursor vs Alternatives

Cursor is not the only AI coding tool. Here is how it compares to the main alternatives:

Quick comparison summary

Multi-file editing
Cursor Composer
Copilot Limited
Claude Code Full codebase
Agent mode
Cursor Yes
Copilot No
Claude Code Yes
IDE support
Cursor Cursor only
Copilot All IDEs
Claude Code Terminal
Model choice
Cursor Multiple
Copilot GPT-4 only
Claude Code Claude only
Free tier
Cursor Generous
Copilot Limited
Claude Code Free

Frequently Asked Questions

Is Cursor free to use?

Yes, Cursor has a free Hobby tier that includes 2,000 code completions per month and 50 slow premium requests. This is enough for casual use or trying out the editor. For serious development, the Pro tier at $20/month is the sweet spot, offering unlimited completions and 500 fast premium requests.

What is the difference between Chat, Composer, and Agent mode?

Chat (Cmd+L) is for asking questions and getting code suggestions you copy manually. Composer (Cmd+I) writes code directly into your files and can edit multiple files at once. Agent mode is Composer with autonomous capabilities - it can run terminal commands, create files, and iterate until your goal is complete.

Should I use Cursor or GitHub Copilot?

Cursor has stronger multi-file editing capabilities through Composer and Agent mode. Copilot has better IDE integration (JetBrains, Neovim) and GitHub ecosystem features like PR reviews. Many developers use Cursor for greenfield projects and Copilot for maintenance work. See our detailed comparison at /kb/vibe-coding-tools/cursor-vs-copilot/

What are .cursorrules files?

A .cursorrules file in your project root gives Cursor persistent context about your codebase - coding standards, framework choices, and project-specific patterns. Think of it as a system prompt that applies to all AI interactions in that project. The newer .cursor/rules folder allows for more organized, modular rules.

Which AI model should I use in Cursor?

Claude 3.5 Sonnet is the default and best for most coding tasks - fast and accurate. Use GPT-4o for complex reasoning or when Claude struggles. Use cursor-small for simple completions to save premium requests. For very complex problems, o1 provides chain-of-thought reasoning but is slower.

Can Cursor access the internet or external documentation?

Yes. Use @Docs in chat to reference official documentation Cursor has indexed. You can also add custom documentation URLs for frameworks Cursor does not know. For real-time web access, you can set up MCP servers to give Cursor browsing capabilities.

Is my code sent to third parties?

By default, yes - code is sent to AI providers (Anthropic, OpenAI) for processing. In Cursor Settings, you can enable Privacy Mode which adds end-to-end encryption and prevents your code from being used for training. Enterprise plans offer additional compliance features.

What are Background Agents?

Background Agents (Pro+ and above) let Cursor work on tasks asynchronously. You can have up to 8 agents running in parallel, each in its own Git worktree. You can close Cursor and check back later when agents complete their work. Think of it as assigning tasks to AI teammates.

Ready to start vibe coding with Cursor?

Download free at cursor.com and follow this guide to get productive fast.

Related Content