Setup Cursor IDE

If you prefer working inside an editor rather than a terminal, Cursor gives you VS Code with AI built into every corner. Set up in 5 minutes.

Beginner 8 min read Lesson 3 of 20

What is Cursor?

Cursor is a code editor (based on VS Code) with AI deeply integrated. You get everything VS Code has - syntax highlighting, extensions, git, terminal - plus three major AI features:

FeatureHow to openWhat it does
AI ChatCtrl+LChat with AI about your code, ask questions, get explanations
Inline EditCtrl+KSelect code, describe a change, AI edits it in place
ComposerCtrl+IMulti-file AI that can create and edit across your whole project
Tab completionAutomaticAI suggests the next lines as you type - press Tab to accept

Install Cursor

  1. Go to cursor.com
  2. Click Download - it auto-detects your OS (Windows/Mac/Linux)
  3. Run the installer (same as any desktop app)
  4. Open Cursor - it will ask to import VS Code settings (click Yes if you use VS Code)
  5. Sign up or log in with Google/GitHub

After login, Cursor will ask which AI model to use. Select claude-sonnet-4-6 (or the latest Claude model listed) for the best coding results.

AI Chat Panel

The chat panel (Ctrl+L) lets you talk to AI about your code. You can reference files using the @ symbol:

Chat panel - example prompts
# Ask about the current file (it's automatically in context):
"Explain what this file does"
"Find any potential bugs in this code"
"What does the getUserById function return?"

# Reference a specific file with @:
"In @UserModel.php, why does the login() method fail when remember_me is true?"

# Reference your whole codebase:
"@codebase - where is the email validation logic?"

# Ask for code:
"Write a function to validate a phone number in Indian format (+91 XXXXX XXXXX)"

Inline Edit (Ctrl+K)

This is the most powerful day-to-day feature. Select any code, press Ctrl+K, type what you want changed, and the AI edits it right there:

Inline edit - what to type after Ctrl+K
# With a function selected:
"Add input validation - check that $email is a valid email and $age is between 18 and 120"
"Convert this to use PDO prepared statements"
"Add error handling with try/catch"
"Make this function async"

# With an HTML block selected:
"Add Bootstrap classes to make this a responsive card"
"Convert this table to a mobile-friendly format"
"Add form validation attributes"

# With a CSS block selected:
"Add a dark mode version using prefers-color-scheme"
"Make this responsive for mobile"

After the AI shows the change, you see a diff view. Press Ctrl+Enter to accept or Escape to reject.

Composer - Multi-file AI

Composer (Ctrl+I) is Cursor's equivalent to Claude Code - it can create and edit multiple files at once. Use it for bigger tasks:

Composer - example tasks
# Create a new feature:
"Create a contact form with:
 - HTML form in /pages/contact.php
 - PHP handler in /api/contact-submit.php
 - Email sending using PHPMailer
 - Success/error redirect back to the form"

# Modify across files:
"Add a 'last_login' column to the users table.
 Update UserModel.php to set it on login.
 Show it in the admin/users.php table."

# Refactor:
"Move all database query functions from functions.php into
 a new UserModel class in /models/UserModel.php"

Cursor vs Claude Code

CursorClaude Code
InterfaceGUI editor (like VS Code)Terminal / CLI
Best forInline editing, file-by-file workAutonomous multi-file tasks, running code
Tab completionYes (as you type)No
Run commandsLimited (via terminal tab)Full shell access
File creationAsks in chat/composerDoes it autonomously
Learning curveLower (visual IDE)Higher (terminal-based)
RecommendationStart here if you prefer GUIGraduate to this for serious projects
Use both together

The professional workflow: Cursor open for editing code line by line. Claude Code in a terminal tab inside Cursor for running larger tasks. Switch between them freely. They share the same files on disk so changes from one are instantly visible in the other.

Frequently Asked Questions

Cursor has a free tier with limited AI requests per month. The Pro plan ($20/month as of 2025) gives unlimited requests. The free tier is enough to follow this guide and decide if you like it before paying.

If you have used VS Code, Cursor feels identical because it is built on the same foundation. If you have not, Cursor is a good first IDE to learn - everything works the same as VS Code plus AI features on top.

Yes. In Cursor Settings, under Models, you can add your own API keys for Anthropic, OpenAI, or other providers. This lets you use Claude models directly and pay via your own API account instead of Cursor's subscription.

Use both. Cursor excels at inline code completion and editing within a file. Claude Code excels at multi-file tasks, running tests, and autonomous project work. Many professional developers use Cursor for moment-to-moment editing and Claude Code for larger tasks. They complement each other.