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.
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
- 2,000 Tab completions
- 50 Slow Premium requests
- Unlimited free models
- Unlimited Tab completions
- 500 Fast Premium requests
- Full Agent Mode
- Claude 3.5 Sonnet / GPT-4o
- Everything in Pro
- Zero data retention
- Admin dashboard
- SSO / SAML
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
- Go tocursor.sh and download the version for macOS / Windows / Linux
- Open the downloaded file and install as usual
- On first launch Cursor asks whether to import settings from VSCode — click Import
- All extensions, themes and keybindings are copied automatically
Step 2: choosing an AI model
In Settings (Cmd+, on Mac) you can choose the AI model. Cursor supports several models:
- claude-3-5-sonnet: The default — best for writing code, the most expensive
- gpt-4o: A strong alternative, especially good for reasoning
- gemini-2.0-flash: Fast and cheap, great for Completion
- cursor-small: Cursor's in-house model — fast and doesn't cost fast requests
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.
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.
- Multi-line completions: Suggests whole blocks, not just one line
- Next-edit prediction: Cursor guesses where you'll edit next and suggests there too
- Rename-aware: When you rename a variable, Cursor offers to update all the references too
- Import suggestions: Automatically adds the required imports
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.
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.
Where is authentication handled in the project? What is the login flow?
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
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
FAILED: test_create_user — IntegrityError: UNIQUE constraint failed
Best Practices for Agent Mode
- Be specific: describe the stack, the dependencies, and the code design you want
- Use .cursorrules: define the project conventions up front (see the next section)
- Ask for tests: always ask the Agent to write and run tests — that's how it finds the problems
- Review before accepting: the Agent shows a diff before applying changes — always go over it
- Small tasks: better to split tasks into clear subtasks than one giant request
What the Agent can and cannot do
- 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)
- access the internet arbitrarily
- run GUI applications
- access external services without credentials
- remember previous sessions
- deploy to production without configuration
.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/
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
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
Vibe Coding — what fits and what doesn't
- Fast Prototypes and MVPs
- Automation scripts
- Personal tools and side projects
- API integrations
- Data analysis and processing
- Learning and experimentation projects
- Critical production code without review
- Security-sensitive code
- Financial transactions
- Code others depend on
- Systems with sensitive data
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:
Cheat sheet — Cursor AI
Keyboard shortcuts
| Action | Mac | Windows / Linux |
|---|---|---|
| Open the Chat Panel | Cmd+L | Ctrl+L |
| Agent Mode (Composer) | Cmd+Shift+I | Ctrl+Shift+I |
| Inline Edit | Cmd+K | Ctrl+K |
| Accept a Tab suggestion | Tab | Tab |
| Reject a Tab suggestion | Esc | Esc |
| Send without auto-context | Ctrl+Enter | Ctrl+Enter |
| Accept all changes | Cmd+Y | Ctrl+Y |
| Reject all changes | Cmd+N | Ctrl+N |
| Settings | Cmd+, | Ctrl+, |
| Command Palette | Cmd+Shift+P | Ctrl+Shift+P |
@References — a quick guide
| Reference | Use | Available in |
|---|---|---|
| @file | Reference a specific file | Chat + Agent |
| @folder | All files in a folder | Chat + Agent |
| @codebase | Semantic search across the whole repo | Chat + Agent |
| @web | Real-time web search | Chat |
| @docs | Documentation for a specific library | Chat |
| @git | commit history, diffs | Chat + Agent |
| @terminal | Output from the last terminal | Chat |
| @notepads | Persistent Context you defined | Chat + Agent |
Agent Mode Tips — 10 field-tested tips
- Always name the stack in the first prompt — Python 3.12, FastAPI, PostgreSQL. Specificity = better results
- Ask for tests right away — "also write pytest tests" inside the prompt. An Agent that runs tests finds bugs on its own
- Keep .cursorrules up to date — add new decisions to the file. The Agent will respect them in every session
- Split into tasks — "Step 1: create the models. Step 2: API routes. Step 3: tests" — better than one giant request
- Review every diff — the Agent shows all changes before applying. Go over them; don't hit Accept All without reading
- Describe errors fully — paste the entire stack trace, not just "there's an error"
- Use @terminal — after an error, send @terminal to chat so the Agent sees exactly what happened
- checkpoint git — commit before every long Agent session. If something goes wrong, git reset fixes everything
- Not writing code = fine — you can ask the Agent to design architecture, explain existing code, write docs without changing code
- Cmd+Z works — every Agent change can be undone. Don't be afraid to try
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.