Updated April 2026 15 min read For developers at every level

Cursor AI — the complete guide
Agent Mode, Tab & Vibe Coding

Cursor is not just another AI plugin — it is a new code editor that erases the line between developer and AI. This guide shows you how to use it fully: from basic Tab Completion to an Agent Mode that writes, runs and fixes code on its own.

VSCode
Based on
Claude 3.5
Sonnet by default
Agent
built-in Mode
$20
Pro per month

What is Cursor?

Cursor is a fork of Visual Studio Code rebuilt around AI. The company behind it — Anysphere — was founded in 2023 and has already raised hundreds of millions of dollars. The idea is simple: instead of adding AI as an external plugin, build a code editor where AI is an integral part of every interaction.

Because it is based on VSCode, all your extensions, themes and keybindings keep working. Moving from VSCode to Cursor takes a few minutes — settings import is automatic.

Cursor vs the competition — a comparison table

Feature Cursor GitHub Copilot Windsurf
Standalone code editor Yes (VSCode fork) Plugin only Yes (VSCode fork)
Agent Mode Yes — full Partial Yes — Cascade
Tab Completion Advanced multi-line Good Good
Codebase Context Full @codebase Partial Yes
Pro price $20/month $10–$19/month $15/month
Bring Your Own Key Yes No Yes

Cursor pricing

Hobby
Free
  • 2,000 Tab completions
  • 50 Slow Premium requests
  • Unlimited free models
Recommended
Pro
$20/month
  • Unlimited Tab completions
  • 500 Fast Premium requests
  • Full Agent Mode
  • Claude 3.5 Sonnet / GPT-4o
Business
$40/user/month
  • Everything in Pro
  • Zero data retention
  • Admin dashboard
  • SSO / SAML
lightbulb
The biggest thing in Cursor: Agent Mode

Agent Mode is why people switch to Cursor. Unlike other tools that only offer suggestions, Agent Mode writes code, runs the terminal, reads results, and fixes errors — all in an automatic loop until the task is done.

Installation & setup

Installing Cursor is simple and fast. Go to the official site and click Download — Cursor is available for macOS, Windows and Linux.

Step 1: download and install

Step 2: choosing an AI model

In Settings (Cmd+, on Mac) you can choose the AI model. Cursor supports several models:

Cursor Settings — AI Models
// Cursor > Settings > Models
claude-3-5-sonnet-20241022
Default
gpt-4o
OpenAI
gemini-2.0-flash
Google
cursor-small
Fast + free
Bring Your Own Key (BYOK)
ANTHROPIC_API_KEY = sk-ant-...

Step 3: Bring Your Own Key

If you have your own API keys (Anthropic, OpenAI, Google), you can set them in Settings and use them directly. This way you pay the model provider directly rather than Cursor, and it does not count against the fast-requests quota.

play_circle
Cursor AI — install & setup guide 2024
YouTube • search for tutorials
open_in_new

Key features

Cursor offers four layers of AI assistance, from the simplest to the deepest. Learn all of them so you can pick the right tool for each task.

Tab Completion — smart completion

Cursor's Tab Completion is not a "single-line suggestion" like older tools. It analyzes your context — the code before and after the cursor, your recent changes, and the current file — and suggests whole blocks of code.

Cursor — myproject/src/users.py
// type the function name...
def get_user_by_email(email: str):
# Tab suggestion (appears dimmed):
"""Get user from database by email address."""
user = db.session.query(User).filter(
User.email == email
).first()
if not user:
raise ValueError(f"User {email} not found")
return user
Tab to accept a suggestion Esc to reject

Cmd+K — Inline editing

Cmd+K (Mac) / Ctrl+K (Windows) is the tool for focused editing. Select code, press Cmd+K, and describe what you want to change in natural language.

edit Examples of using Cmd+K
"convert to async/await"
"add error handling"
"write unit tests for the function"
"convert to TypeScript"
"optimize for Python 3.12"
"explain this code"
tips_and_updates Tips for Cmd+K

No selection → shows a prompt to create from scratch

With a selection → edits only the selected code

Press Cmd+K again to open the diff view

Accept: Enter | Reject: Esc

Chat Panel — Cmd+L

Cmd+L Opens the Chat Panel — a conversation with an AI that knows your code. The real power is in the@references that let you control exactly what the AI sees.

Cursor Chat — @codebase
A
@codebase

Where is authentication handled in the project? What is the login flow?

AI

I found the auth in three files:

• src/auth/middleware.py — JWT validation

• src/api/auth.py — login/logout endpoints

• src/models/user.py — User model + password hash

The flow: POST /auth/login → validate credentials → issue JWT → return token

@ Ask a question... (@ to highlight files)
@file
A specific file
@folder
A whole folder
@codebase
The entire codebase
@web
Web search
@docs
Specific documentation
@git
git history
@terminal
terminal output
@notepads
persistent context

Agent Mode — AI that works for you

Agent Mode is the feature that sets Cursor apart from every other AI tool on the market. Instead of answering a question and waiting for the next instruction, Agent Mode works in an automatic loop: it writes code, runs it in the terminal, reads the results, and fixes errors — until the task is complete.

To enable: Cmd+Shift+I (Mac) / Ctrl+Shift+I (Windows) — opens the Composer in Agent mode.

How Agent Mode works — the full loop

smart_toy Agent Mode — example Workflow
You
Initial instruction
"Build me an API endpoint to manage users with FastAPI — full CRUD, validation, and JWT auth"
AI
Step 1: writes code
creates src/api/users.py, src/models/user.py, src/schemas/user.py
AI
Step 2: runs the terminal
$ pip install fastapi uvicorn python-jose passlib
AI
Step 3: runs tests — an error was found
$ pytest tests/test_users.py
FAILED: test_create_user — IntegrityError: UNIQUE constraint failed
AI
Step 4: fixes automatically
Adds a uniqueness check before creating a user, updates error handling
Completed successfully
$ pytest — 12 passed in 1.43s
Cursor Agent — Terminal Output
[Agent] Starting task: Build FastAPI users CRUD API
[Agent] Creating file: src/api/users.py
[Agent] Creating file: src/models/user.py
[Agent] Creating file: tests/test_users.py
[Terminal] $ pip install fastapi uvicorn python-jose passlib bcrypt
Successfully installed fastapi-0.110.0 uvicorn-0.28.0...
[Terminal] $ pytest tests/ -v
FAILED tests/test_users.py::test_create_duplicate_user
[Agent] Analyzing error: duplicate email constraint missing
[Agent] Fixing: src/api/users.py — adding email uniqueness check
[Terminal] $ pytest tests/ -v
........... 12 passed in 1.43s
[Agent] Task complete! API is ready at /api/users

Best Practices for Agent Mode

What the Agent can and cannot do

check_circle The Agent can
  • create, edit and delete files
  • run terminal commands
  • run tests and fix errors
  • search the codebase
  • read documentation on the web
  • manage git (commit, diff)
cancel The Agent cannot
  • access the internet arbitrarily
  • run GUI applications
  • access external services without credentials
  • remember previous sessions
  • deploy to production without configuration
play_circle
Cursor Agent Mode — full guide
YouTube • search "cursor ai agent mode tutorial"
open_in_new

.cursorrules — project settings for the AI

.cursorrules is a text file placed in the project root. It functions as apersistent system prompt for all interactions with Cursor in Chat and Agent. Every question you ask, every piece of code the Agent writes — will be influenced by the .cursorrules.

It is the most important tool for consistency: Cursor knows your stack, conventions and style — without you having to repeat yourself every time.

A .cursorrules example for a FastAPI project

# .cursorrules — FastAPI Project

You are an expert Python developer working on a FastAPI production application.

## Tech Stack
- Python 3.12
- FastAPI 0.110
- SQLAlchemy 2.0 (async)
- Pydantic v2
- PostgreSQL + asyncpg
- pytest + pytest-asyncio

## Code Style Rules
- Always use type hints for all function parameters and return values
- Follow PEP 8, max line length 88 (black formatter)
- Write Google-style docstrings for all public functions
- Use async/await for ALL database operations and I/O
- Never use sync blocking calls in async context

## Architecture Rules
- Repository pattern for database access (src/repositories/)
- Dependency injection via FastAPI Depends()
- Pydantic schemas for all request/response validation
- JWT authentication via python-jose
- Settings via pydantic-settings from .env file

## Testing Rules
- Write pytest tests for every new endpoint
- Use pytest fixtures for DB setup/teardown
- Test both happy path and error cases
- Aim for >80% coverage

## Language Rules
- Code: English (variable names, function names, comments)
- API responses: English
- Docstrings: Hebrew is acceptable
- Log messages: English

## Folder Structure
src/
  api/          — FastAPI routers
  models/       — SQLAlchemy models
  schemas/      — Pydantic schemas
  repositories/ — DB access layer
  services/     — Business logic
  core/         — Config, security, dependencies
tests/
link
cursorrules.com — a ready-made library

The site cursorrules.com contains hundreds of ready-made .cursorrules for popular stacks: Next.js, Django, React, Rust, Go and more. No need to build from scratch — browse, adapt, and use.

Notepads — persistent Context for projects

Notepads are a newer version of .cursorrules in Cursor. You can create several Notepads per project, reference them in Chat with @notepads, and set which Notepads are always active.

Context management — how the AI "sees" your code

The Context Window is the amount of information models can process at once. Claude 3.5 Sonnet supports128K tokens — a small-to-medium project fits entirely. But proper context management saves money and improves results.

Methods for managing Context

data_object
@file and @folder
The most precise way. When you know exactly which files are relevant — name them. This saves tokens and improves accuracy.
account_tree
@codebase
Cursor does a semantic search across the whole repo and brings the most relevant sections. For questions about architecture and patterns. It doesn't bring everything — it brings what looks relevant.
note
Notepads — persistent Context
Set up Notepads with always-relevant information: architecture decisions, API keys structure, naming conventions. They persist between sessions.
send
Ctrl+Enter — no automatic Context
Send a question without Cursor adding automatic context. Useful when you want a general question unrelated to the current code.
warning
Keep repos focused

Cursor works best with small, focused repositories. A giant monorepo with 100K+ files? Cursor will struggle to navigate. Consider splitting into separate repos by domain.

Vibe Coding — development in natural language

The term "Vibe Coding" was coined by Andrej Karpathy (co-founder of OpenAI, former head of AI at Tesla) in early 2025. The idea: development conducted entirely in Natural Language — you describe what you want, the AI writes, and you look, approve, and guide.

Vibe Coding is not "let the AI write and close your eyes." It is a new way of working that requires intuition, judgment, and the ability to describe requirements clearly.

Vibe Coding Workflow

1
Describe in plain English
Write what you want to build — as if explaining to a mid-level developer. Be specific about behaviors, not implementations.
2
Cursor writes
Agent Mode takes the instruction, picks a stack, writes code, runs it, and fixes. You don't read every line — that's fine.
3
Look and approve
Go over the diff, run it yourself, check that it does what you asked. Ask questions about parts you don't understand.
4
Test + Iterate
Run tests, describe errors, guide the Agent to fix. Repeat the step until it works.

Vibe Coding — what fits and what doesn't

Great for Vibe Coding
  • Fast Prototypes and MVPs
  • Automation scripts
  • Personal tools and side projects
  • API integrations
  • Data analysis and processing
  • Learning and experimentation projects
Requires more caution
  • Critical production code without review
  • Security-sensitive code
  • Financial transactions
  • Code others depend on
  • Systems with sensitive data
security
Security and Vibe Coding

Code written with Vibe Coding may contain vulnerabilities that aren't immediately visible — SQL injection, open redirects, insecure defaults. Always run security linters and do a code review of the parts touching auth, payments, and user data.

5 practice projects with Cursor

The best way to learn Cursor is to use it. Here are five projects ranked by difficulty, with prompts for Agent Mode:

1
CLI Chatbot
Beginner
A Python script that uses the OpenAI API, keeps history, supports slash commands
"Create a CLI chatbot in Python that uses the OpenAI API. Support /clear shortcuts to clear history and /save to save the conversation to a file. Store the API key in .env"
2
REST API — full CRUD
Intermediate
FastAPI + SQLite with CRUD operations, validation, automatic Swagger docs
"Build a REST API to manage a todo list with FastAPI + SQLite. Full CRUD for tasks, Pydantic validation, pytest tests. Swagger at /docs"
3
Web Scraper with Export
Intermediate
A Playwright scraper that collects data, cleans and exports to CSV/JSON
"Write a Playwright scraper that collects titles + prices from books.toscrape.com. Data cleaning, export to CSV and JSON, pagination support"
4
Full-Stack App
Advanced
Next.js frontend + FastAPI backend + PostgreSQL, full auth
"Full-stack expense tracker: Next.js 14 (App Router) + FastAPI + PostgreSQL. JWT auth, adding expenses, categories, a dashboard with charts (recharts)"
5
A custom AI Agent
Advanced
A LangChain agent with tools: web search, calculator, file read/write
"A LangChain agent that can: search the web (Tavily), read/write files, evaluate expressions. CLI interface, streaming output, conversation memory"

Cheat sheet — Cursor AI

Keyboard shortcuts

Action Mac Windows / Linux
Open the Chat PanelCmd+LCtrl+L
Agent Mode (Composer)Cmd+Shift+ICtrl+Shift+I
Inline EditCmd+KCtrl+K
Accept a Tab suggestionTabTab
Reject a Tab suggestionEscEsc
Send without auto-contextCtrl+EnterCtrl+Enter
Accept all changesCmd+YCtrl+Y
Reject all changesCmd+NCtrl+N
SettingsCmd+,Ctrl+,
Command PaletteCmd+Shift+PCtrl+Shift+P

@References — a quick guide

Reference Use Available in
@fileReference a specific fileChat + Agent
@folderAll files in a folderChat + Agent
@codebaseSemantic search across the whole repoChat + Agent
@webReal-time web searchChat
@docsDocumentation for a specific libraryChat
@gitcommit history, diffsChat + Agent
@terminalOutput from the last terminalChat
@notepadsPersistent Context you definedChat + Agent

Agent Mode Tips — 10 field-tested tips

A quick .cursorrules template

# .cursorrules — [project name]

You are an expert [LANGUAGE] developer working on [DESCRIPTION].

## Stack
- [Framework + version]
- [Database]
- [Key libraries]

## Code Rules
- [coding style]
- [naming conventions]
- [error handling approach]

## Testing
- [test framework]
- [coverage expectations]

## Do NOT
- [anti-patterns to reject]
- [patterns to avoid]

Summary — why Cursor?

Cursor represents a paradigm shift in software development. Not "AI that helps write code" — but a development environment built from the ground up around developer–AI collaboration. Tab Completion reduces friction, Cmd+K speeds up edits, the Chat Panel answers questions in the project's context — and Agent Mode lets us work at the level of intent, not implementation.

The best way to start: download, import your VSCode settings, and start a new project with Agent Mode. The first 30 minutes will change how you think about development.