Getting Started with Cursor
Set up Cursor, configure a .cursorrules file, and learn the inline Cmd+K and chat workflows that make it useful day to day.
What Cursor is
Cursor is a code editor built on top of VS Code with AI assistance woven directly into the editing experience — inline edits, a chat panel with your codebase as context, and autocomplete that predicts multi-line changes. See /tools/cursor for a full comparison against terminal-based agents like Claude Code.
Step 1: Install and open a project
- Download and install Cursor for your OS
- Open an existing project folder (File → Open Folder) — it can import your VS Code settings and extensions automatically
- Sign in to enable the AI features
Step 2: Set project rules with .cursorrules
Like Claude Code's CLAUDE.md, Cursor supports a rules file at your project root that's applied to every AI interaction automatically. Set this up before you start generating real code.
Always use TypeScript, never plain JavaScript.
Prefer named exports over default exports.
Use Tailwind CSS utility classes only — do not write custom CSS files.
Keep components small and focused; extract logic into hooks when a
component exceeds ~100 lines.
Never remove or weaken existing tests without asking first.Step 3: Inline edits with Cmd+K (Ctrl+K on Windows)
Select a block of code and press Cmd+K to describe a change directly in place — this is the fastest loop for small, localized edits where you already know exactly what needs to change.
Extract this validation logic into a separate function called
validateEmail, and add a check for a missing @ symbol.Step 4: Use chat for anything that spans multiple files
The chat panel is better suited to tasks that touch more than one file — it can search your codebase for context, propose changes across several files, and show you a combined diff before applying anything.
The /checkout page calls calculateTotal from lib/pricing.ts. Find every
place that function is called, and update all of them to pass the new
optional "couponCode" argument I just added to its signature.Step 5: Review before accepting
- Read the proposed diff in full before clicking Accept — don't accept multi-file changes on autopilot
- Run your test suite after any chat-driven change, not just the file you were focused on
- If autocomplete suggests something that looks subtly wrong, reject it — a wrong suggestion accepted quickly is more expensive to find later
Common pitfalls
- Skipping .cursorrules and re-explaining the same conventions in every chat
- Using Cmd+K for changes that actually span multiple files — switch to chat instead
- Accepting long autocomplete blocks without reading them, especially around business logic
Tools used in this tutorial
Cursor
An AI-native code editor built on VS Code, with deep inline editing, chat, and agent capabilities.
Claude Code
A terminal-based agentic coding tool from Anthropic that reads, edits and runs code in your own repository.
Windsurf
An AI-native code editor with an agentic "Cascade" mode designed for autonomous multi-step coding tasks.
Prompts to pair with this
Design and build an accessible, reusable UI component
Gets an AI to design a UI component's full set of states and variants up front, then implement it accessibly, instead of building only the happy-path visual state.
Copy promptreactRefactor a messy React component into clean, reusable pieces
Guides an AI to safely refactor a large, tangled React component into smaller composable pieces while preserving exact behavior.
Copy promptRelated tutorials
Getting Started with Claude Code
Install Claude Code, set project-level conventions, and complete your first real task inside an existing codebase.
BeginnerHow to Build React Components with AI
Generate a properly typed React component with an AI tool, then extend it with props, state and a test the right way.
BeginnerHow to Debug AI-Generated Code
A repeatable method for tracking down bugs in AI-generated code — reproduce, isolate, prompt with real context, and verify with a test.
IntermediateReady to build the next one?
Browse the full tutorial library or grab a ready-made prompt for your next step.