Agent Mode
Autonomous AI coding agent that independently explores, plans, and executes complex codebase changes with full tools
Agent is the default and most autonomous mode in Cursor, designed to handle complex coding tasks with minimal guidance. It has all tools enabled to autonomously explore your codebase, read documentation, browse the web, edit files, and run terminal commands to complete tasks efficiently.
Agent’s Capabilities
Autonomous Operation
Independently explores your codebase, identifies relevant files, and makes necessary changes
Full Tool Access
Uses all available tools to search, edit, create files, and run terminal commands
Contextual Understanding
Builds a comprehensive understanding of your project structure and dependencies
Multi-step Planning
Breaks complex tasks into manageable steps and executes them in sequence
Make sure to read chat overview to learn more about how modes work in Cursor.
Agent’s Workflow
Much like a human, Agent mode follows a systematic approach to completing tasks:
🧠 Understand Request
Agent mode analyzes your request, and the context of the codebase to fully comprehend the task requirements and goals.
🔍 Explore Codebase
The agent may search through your codebase, documentation, and the web to identify relevant files and understand the current implementation.
📝 Plan Changes
Based on the analysis, the agent breaks down the task into smaller steps and plans the changes, learning from the available context as it goes.
🔧 Execute Changes
The agent makes the necessary code modifications according to the plan across your entire codebase, also potentially suggesting new libraries, terminal commands to run or steps you should make outside of Cursor.
🔍 Verify Results
The agent will confirm the changes look correct after being made by applying them. If it notices any issues or linter errors (when supported by the language), it will attempt to fix them.
✅ Task Complete
Once the agent is happy, it yields back and summarizes the changes it made.
Agent mode creates checkpoints before making changes, allowing you to revert if needed.
Learn more about checkpoints.
Example Use Cases
For best results, be specific about what you want to accomplish, but you don’t need to specify how the agent should approach the task.
Agent mode will:
- Identify your application’s styling approach
- Add necessary theme state management
- Create toggle component
- Update styling across relevant components
- Add persistence if appropriate
Agent mode will:
- Find all API call locations
- Implement appropriate caching strategy
- Add cache invalidation logic
- Update components to use cached data
Configuration Options
- Select a Model: Pre-select a model for agent mode
- Edit Keybindings: Set keybindings for agent mode
- Toggle Available Tools: Toggle available tools
- Enable Auto-run and Auto-fix Errors: Enable auto-run and auto-fix errors (read more about tool settings)
When using Agent mode with auto-run enabled, review proposed changes carefully before confirming major modifications.