Chat & Agent Mode
Use Cursor's chat panel and Agent mode to ask questions about your codebase, plan features, and let Cursor autonomously implement multi-file changes.
Use Cursor's chat panel and Agent mode to ask questions about your codebase, plan features, and let Cursor autonomously implement multi-file changes.
Press Cmd+L (Ctrl+L) to open the Chat panel on the right side of the editor. This is where you have a conversation with Cursor that has full context of your codebase — not just the open file, but the entire project, indexed and searchable.
You can ask questions, request changes, or describe a feature you want built. Cursor will read the relevant files, plan what needs to change, and propose edits.
Type any question in plain English:
Where is user authentication handled in this project?
Cursor searches the codebase using semantic search and responds with file references, code snippets, and an explanation — even if you have never opened those files.
Where is user authentication handled in this project?
→ Authentication is handled in src/lib/auth.ts.
- signIn() and signOut() use NextAuth.js (app/api/auth/[...nextauth]/route.ts)
- Session is validated in middleware.ts (lines 12–28)
- Protected routes check session with withAuth() from src/lib/auth.ts
In chat, use @ to include specific context:
| Mention | What it includes |
|---|---|
| @filename | The content of a specific file |
| @folder | All files in a directory |
| @web | A live web search result |
| @docs | A specific documentation page |
| @git | Recent git changes or a specific commit |
Example:
@src/components/Button.tsx Why does this button flicker on first render?
Cursor reads that file and gives a targeted answer.
Agent mode lets Cursor work autonomously: it reads files, makes edits across multiple files, runs terminal commands, and iterates until the task is complete.
To activate Agent mode, click the mode selector in the chat panel and switch from "Ask" to "Agent".
Describe a task:
Add a rate-limiting middleware to all /api routes using upstash/ratelimit.
Install the package, write the middleware, and apply it to every route handler.
Cursor will:
@upstash/ratelimit packageBefore Agent makes changes, you can use Plan mode to review its strategy without applying anything:
This is particularly useful for large refactors where you want to sanity-check the approach first.
In the chat panel, you can choose which AI model powers the response. Cursor supports every major frontier model:
You can change models per-conversation. Use cheaper/faster models for quick questions and premium models for complex refactors.
Cursor automatically picks a model for Tab completions (the specialized Tab model). Model selection in Chat only affects the chat and Agent responses.
The first time you open a project, Cursor indexes it in the background. This creates a semantic search index over your codebase — letting it find relevant code even when you don't know the exact file or function name.
The index updates as you edit files. For large repositories, the initial index may take a few minutes.
Chat gives you a conversational interface for questions and small edits. Agent mode handles the heavy lifting — multi-file tasks, package installs, and iterative fixes. The recommended workflow is: ask in Chat for exploration, then hand off to Agent for execution. The next module covers Rules and MCP — how to make Cursor follow your project's conventions automatically.