In this categoryCursor ยท 26
- How to Install Cursor and Import VS Code Settings (6 Minutes)Start
- Cursor Setup Guide: From Install to Your First AI Edit
- How to Set Up Project Rules in the .cursor/rules Folder
- How to Set Up Codebase Indexing in Cursor
- How to Enforce Project Conventions with Cursor Rules
- How to Write a Team Rule That Applies Only to Certain Files
- How to Migrate a Legacy .cursorrules File to the New Rules Folder
- How to Use Cursor Rules to Guide AI Edits
- How to Set Project Rules in Cursor
- How to Add a .cursorrules File to Steer Cursor
- How to Customize Cursor Keyboard Shortcuts
- How to Edit Multiple Files at Once with Cursor Composer
- How to Use Cursor Tab Completion Effectively
- How to Edit Code Inline with Cmd+K in Cursor
- How to Add Context to Cursor Chat with @ Mentions
- How to Choose and Switch AI Models in Cursor
- How to Add Library Docs as Context with @Docs in Cursor
- How to Generate and Maintain Tests with Cursor Composer
- How to Undo a Composer Change with Checkpoints in Cursor
- How to Use Cursor Agent Mode to Build a Feature End to End
- How to Connect an MCP Server to Cursor
- How to Refactor Across Your Whole Codebase in Cursor
- How to Query Your Database from Cursor with a Postgres MCP Server
- How to Let Cursor Run Commands Automatically (and Keep It Safe)
- How to Build a Full Feature Across Frontend and Backend with Composer
- How to Debug an MCP Server That Will Not Connect in Cursor
How to Use Cursor Agent Mode to Build a Feature End to End
Drive Agent mode to plan, edit multiple files, run commands and iterate, while you stay in control of every change.
Agent mode is Cursor's autonomous mode: instead of answering, it plans a task, edits files across the project, runs terminal commands, reads the output, and keeps going until the task is done. It is powerful and needs supervision. This guide builds a small feature with the agent while keeping you in the driver's seat.
What you need
- Cursor with a project that has a working build
- Codebase indexing finished so the agent can find code
- A version-controlled repo so you can review and revert
- A small, well-defined feature to build
Step 1: Switch the chat to Agent
Open chat and set the mode selector to Agent (the other modes are Ask, which only answers, and a manual edit mode). Agent is the mode that is allowed to change files and run commands.
Step 2: Write a clear task with context
Give the agent a goal, not a vague wish, and attach the relevant files with @. State the acceptance criteria so it knows when it is finished. The more precise the brief, the less it wanders.
Add a /health endpoint to @server.ts that returns
{ status: "ok", uptime } as JSON.
- Reuse the existing router pattern in @routes/index.ts
- Add a test in __tests__/health.test.ts
- Run the test suite and make sure it passesStep 3: Review the plan and approve actions
The agent outlines a plan, then proposes edits and commands. It pauses for approval before running terminal commands by default. Read each diff and each command before you let it proceed; this is your safety gate.
Step 4: Let it read failures and iterate
If a command fails, the agent reads the error output and tries a fix on its own. This loop is the real strength of Agent mode. Let it run a couple of cycles, but step in if it goes in circles.
Step 5: Review the full diff and commit
When the agent reports it is done, do not trust the summary alone. Open the source control view, read every changed file, run the app yourself, then commit. The agent did the typing; you own the merge.
Result: a working /health endpoint with a passing test, built across several files in one supervised run, where you reviewed every diff and command rather than hand-typing the boilerplate.
Watch related tutorials
14:05
22:40
30:24
15:50
18:22
30:00New guides in your inbox
Fresh step-by-step how-to guides as we publish them. One email a week, no more.