Cursor is the most popular AI code editor in 2026. Millions of developers use it daily. But most of them only use Tab completion and basic chat. They are missing the features that make Cursor truly powerful.

This article shows you everything Cursor can do — from inline editing to multi-file agents. By the end, you will use Cursor like a power user.

If you need help choosing between Cursor and other tools, read Choosing Your AI Coding Tool first. For the Cursor vs Claude Code comparison, see our detailed comparison.

The Three Core Interactions

Cursor has three ways to interact with AI. Each one is best for different tasks. Learning when to use which one is the key to productivity.

Cmd+K: Inline Edit

Press Cmd+K (Ctrl+K on Windows/Linux) with code selected or your cursor on a line. A small prompt box appears. Type what you want, and Cursor edits the code in place.

This is the fastest way to make small changes.

Example — refactoring a function:

Select a function, press Cmd+K, type:

Convert this to use early returns instead of nested if/else

Cursor rewrites the function inline. You see the diff and accept or reject.

Example — adding error handling:

Put your cursor inside a function, press Cmd+K:

Add try/catch with proper error logging

Cursor wraps the function body in a try/catch and adds error handling.

When to use Cmd+K:

  • Quick edits to a single function or block
  • Refactoring a small section of code
  • Adding comments or documentation to specific code
  • Fixing a single bug you can point to

Pro tip: You do not need to select code before pressing Cmd+K. If you just place your cursor on a line, Cursor will intelligently determine the scope of the edit based on your prompt.

Cmd+L: Chat

Press Cmd+L to open the chat panel on the right side. This is for conversations about your code — asking questions, generating new code, debugging.

Example — understanding unfamiliar code:

What does the middleware in src/auth/verify.ts do? Walk me
through the flow step by step.

Example — generating a new file:

Create a new utility function in src/utils/date.ts that
formats dates in the user's timezone. Support these formats:
"relative" (2 hours ago), "short" (Mar 5), "full"
(March 5, 2026 at 2:30 PM).

When to use Cmd+L chat:

  • Asking questions about your code
  • Generating new functions or files
  • Debugging errors (paste the error message)
  • Getting explanations of complex logic

Cmd+I: Composer (Multi-File Agent)

This is Cursor’s most powerful feature. Composer reads your project, understands the context, and makes changes across multiple files at once.

Press Cmd+I to open Composer. It can work in two modes:

Normal mode: You describe a change and Composer shows you diffs for each file it wants to modify. You review and accept.

Agent mode: Composer acts autonomously. It reads files, makes changes, runs terminal commands, and iterates until the task is done. Similar to Claude Code but inside the editor.

Example — adding a feature with Composer:

Add a dark mode toggle to the settings page. Use the existing
theme context in src/context/ThemeContext.tsx. Add a toggle
switch component. Persist the preference in localStorage.
Update the CSS variables in globals.css.

Composer identifies the files it needs to change (ThemeContext.tsx, SettingsPage.tsx, globals.css), generates diffs for each one, and shows you the changes before applying them.

When to use Composer:

  • Building new features that touch multiple files
  • Refactoring across the codebase
  • Creating a new page or component with all its parts
  • Any task that involves more than one file

Agent mode is best when:

  • You want Cursor to run commands (build, test, lint)
  • The task requires multiple iterations
  • You trust the AI to make good decisions about which files to change

@-References: Pointing AI at Context

The @ symbol is one of Cursor’s most important features. It lets you point the AI at specific context.

@file — Reference a Specific File

@src/api/users.ts Add pagination to the getUsers function.
Use cursor-based pagination, not offset-based.

This tells Cursor to read that specific file before responding. Without @file, Cursor might not know the current implementation.

@folder — Reference an Entire Directory

@src/components/ Create a new Button component that follows
the same patterns used in the existing components.

Cursor reads all files in the folder to understand your component patterns.

@codebase — Search the Whole Project

@codebase Where is the email sending logic? I need to add
a new email template for password reset.

Cursor searches your entire project for relevant files. This is powerful but slower than @file or @folder.

@web — Search the Internet

@web What is the latest syntax for React Server Components
in Next.js 15?

Cursor searches the web and uses the results to answer your question. Useful for documentation and recent changes that might not be in the AI’s training data.

@docs — Reference Documentation

@docs(prisma) How do I create a many-to-many relation
with an explicit join table?

Cursor fetches and reads official documentation. You can configure which documentation sources are available in settings.

Combining References

You can use multiple references in one prompt:

@src/models/User.ts @src/api/users.ts @docs(express)
Add a PATCH endpoint for updating user profiles.
Follow the same patterns as the existing endpoints.

This gives the AI all the context it needs in one prompt. The more context you provide, the better the results.

Notepads: Reusable Context

Notepads are saved blocks of text that you can @-mention in any conversation. Think of them as reusable prompt templates.

Creating a Notepad:

Open the Notepads panel. Create a new notepad called “api-patterns”:

When creating API endpoints, follow these rules:
- Use Express router
- Every endpoint has input validation with Zod
- Every endpoint returns { success: boolean, data: T }
- Error responses include an "error" field with a message
- All database queries use Prisma
- Add JSDoc comments for each endpoint

Using a Notepad:

In any chat or Composer prompt:

@notepad(api-patterns) Create a DELETE endpoint for removing
a user's account. Include soft delete logic.

Cursor reads the notepad and follows those rules when generating code. You do not need to repeat your coding standards in every prompt.

Good use cases for Notepads:

  • Coding standards and patterns
  • API design rules
  • Component structure templates
  • Testing guidelines
  • PR review checklist

.cursorrules: Project-Level Instructions

The .cursorrules file lives in your project root. It tells Cursor about your project — similar to CLAUDE.md for Claude Code.

Cursor also supports a newer format: a .cursor/rules/ directory where you can create multiple rule files for different parts of your project.

Example .cursorrules file:

You are helping with a Next.js 15 project using TypeScript,
Prisma, and Tailwind CSS.

Project structure:
- src/app/ — Next.js app router pages
- src/components/ — React components
- src/lib/ — Utility functions and shared logic
- src/api/ — API route handlers
- prisma/ — Database schema and migrations

Rules:
- Use TypeScript strict mode. Never use "any" type.
- Use server components by default. Add "use client" only
  when needed (interactivity, hooks).
- Use Tailwind for all styling. No CSS modules.
- Database: Always use Prisma. No raw SQL.
- Error handling: Use Result type pattern, not try/catch.
- Tests: Use Vitest. One test file per source file.

The .cursor/rules/ directory approach:

For larger projects, create separate rule files:

.cursor/
  rules/
    general.md     — overall project rules
    frontend.md    — React/UI specific rules
    api.md         — API endpoint rules
    testing.md     — test writing rules

Each file is automatically loaded as context. This is cleaner than one giant .cursorrules file.

Model Selection

Cursor lets you choose which AI model to use. This matters more than most people think.

Available models (as of mid-2026):

  • Claude Sonnet 4 — fast, good quality, best for daily coding
  • Claude Opus 4.6 — slower, highest quality, best for complex tasks
  • GPT-4o — OpenAI’s model, good alternative
  • Gemini 2.5 Pro — Google’s model, strong for long context

My recommendation:

  • Default to Claude Sonnet for Tab completions and quick chat
  • Switch to Claude Opus for Composer/Agent tasks that need deep reasoning
  • Use Gemini when you need to reference very large files (its context window is larger)

You can change models per conversation. Use the model selector at the top of the chat panel or Composer.

Background Agents

Cursor introduced Background Agents — AI tasks that run in the background while you continue working.

You start a background agent for a task:

[Background Agent] Write unit tests for all functions in
src/utils/. Follow the existing test patterns in
src/utils/__tests__/.

The agent works on the task in the background. You get a notification when it is done. You review the changes and accept or reject them.

Good tasks for background agents:

  • Generating tests for existing code
  • Adding documentation to undocumented functions
  • Migrating code patterns (e.g., updating all imports)
  • Fixing linting errors across the project

Note: Background Agents are still evolving. They work best for well-defined, repeatable tasks. Complex tasks with ambiguous requirements are better handled interactively.

Cursor + Claude Code: The Power Combo

Many developers use both tools together. Here is how they complement each other:

Use Cursor for:

  • Writing and editing code in the editor
  • Quick inline changes (Cmd+K)
  • Building UI components (you see the code and preview side by side)
  • Tab completion while typing

Use Claude Code for:

  • Complex refactors across many files
  • Deep debugging that requires reading the entire codebase
  • Git operations (branching, committing, resolving conflicts)
  • CI/CD automation and headless tasks
  • Tasks that need the best AI reasoning (Opus)

The workflow:

  1. Open your project in Cursor
  2. Use Cursor for day-to-day coding
  3. When you hit a complex task, open the terminal in Cursor and run claude
  4. Let Claude Code handle the hard stuff
  5. Switch back to Cursor for the next edit

This combination gives you the best editor experience (Cursor) and the best AI reasoning (Claude Code).

Real Session: Building a Feature

Let me walk through building a complete feature with Cursor.

The task: Add a “favorites” feature to a notes app. Users can star notes and filter by favorites.

Step 1: Composer (Cmd+I)

@src/models/ @src/api/ @src/components/
Add a favorites feature. Users can star/unstar notes.
Add a "isFavorite" boolean to the Note model.
Create a toggle endpoint. Add a star icon to the
NoteCard component. Add a "Favorites" filter button
to the NotesList page.

Composer creates diffs for 5 files: the Prisma schema, the migration, the API endpoint, the NoteCard component, and the NotesList page.

Step 2: Review and accept the diffs. The model change and API look good. The UI needs a small fix — the star icon is not aligned.

Step 3: Inline edit (Cmd+K)

Select the star icon JSX, press Cmd+K:

Align the star icon to the top-right corner of the card.
Add a hover effect that scales the icon slightly.

Cursor updates just the JSX and Tailwind classes.

Step 4: Chat (Cmd+L)

The favorites filter is not working. When I click "Favorites",
it shows all notes instead of just favorites. Here is the
filter function: @src/components/NotesList.tsx

Cursor finds the bug — the filter was checking note.favorite instead of note.isFavorite — and suggests the fix.

Total time: 8 minutes for a complete feature with model, API, UI, and filter logic.

Key Takeaways

  • Cursor has three core interactions: Cmd+K (inline edit), Cmd+L (chat), Cmd+I (Composer). Learn when to use each one.
  • Use @-references to point AI at specific files, folders, or documentation. More context gives better results.
  • Create .cursorrules or use the .cursor/rules/ directory to teach Cursor about your project.
  • Use Notepads for reusable coding standards that you can @-mention in any prompt.
  • Combine Cursor with Claude Code: Cursor for daily editing, Claude Code for complex tasks and automation.

What’s Next?

In the next article, we cover GitHub Copilot Mastery — Agent Mode, the coding agent, CLI tools, and getting the most from the largest AI coding platform.

For a quick reference on Cursor commands, check the AI Coding Tools Cheat Sheet.


This is part 6 of the Vibe Coding series.