Feature Implementation
Building new features that touch multiple files and require understanding existing patterns
Each of Cursor’s modes represents a different AI personality, optimized for specific types of tasks. Understanding when and how to use each mode is the difference between fighting the tool and flowing with it.
Mode | Best For | Capabilities | Tools Available |
---|---|---|---|
Agent | Complex features, refactoring | Autonomous exploration, multi-file edits | All tools enabled |
Ask | Learning, planning, questions | Read-only exploration, no automatic changes | Search tools only |
Manual | Precise, targeted edits | Direct file editing with explicit control | Edit tools only |
Custom | Specialized workflows | User-defined capabilities | Configurable |
Agent mode is Cursor’s most powerful feature. It’s like having a senior developer who can explore your codebase, understand complex requirements, and implement solutions across multiple files.
Feature Implementation
Building new features that touch multiple files and require understanding existing patterns
Large Refactoring
Renaming across the codebase, changing interfaces, updating dependency patterns
Bug Fixing with Investigation
When you need to find and fix issues that span multiple components
Test Generation
Creating comprehensive test suites that understand your code’s behavior
Instead of jumping straight into implementation, use Agent’s planning capabilities:
"First, analyze the authentication system and create a detailed plan for adding OAuth 2.0 support.Write the plan to plan.md, then wait for my approval before implementing."
This approach:
With Cursor v1.2+, you can queue multiple agent tasks:
Task 1: "Analyze the current payment processing flow"Task 2: "Add Stripe integration alongside existing PayPal"Task 3: "Update all payment-related tests"Task 4: "Add monitoring and error handling"
The agent will execute these sequentially, maintaining context between tasks.
Before giving Agent a complex task, prime it with context:
"Look at our existing API patterns in /src/api, especially how we handle authentication and error responses.Now, create a new user management API following these same patterns."
Enable these settings for optimal Agent performance:
{ "cursor.agent.yoloMode": true, "cursor.agent.yoloPrompt": "Run tests after changes. Create directories as needed. Use TypeScript.", "cursor.agent.yoloAllowList": ["npm test", "mkdir", "tsc"], "cursor.agent.yoloDenyList": ["rm -rf", "git push"]}
{ "cursor.performance.memoryLimit": "8GB", "cursor.performance.cacheSize": "2GB", "cursor.agent.maxContextTokens": 200000}
Here’s how a senior developer used Agent mode to extract a service from a monolith:
Context Gathering
"Analyze the order processing logic in our monolith.Identify all dependencies, database tables, and API endpoints related to orders."
Planning
"Create a detailed plan for extracting order processing into a microservice.Include: API design, data migration strategy, and rollback plan."
Implementation
"Following the approved plan, create the new order-service with:- RESTful API matching our standards- Database migrations- Docker configuration- Integration tests"
Integration
"Update the monolith to use the new order-service API.Implement feature flags for gradual rollout."
Ask mode is read-only but incredibly powerful for understanding and planning. It’s your codebase encyclopedia that never makes unwanted changes.
Don’t just ask one question. Approach from multiple angles:
"How does the authentication system work from these perspectives:1. User flow (from login to authenticated request)2. Security measures (token handling, session management)3. Database structure4. API endpoints involved5. Error handling and edge cases"
Use Ask mode to identify patterns and anti-patterns:
"Analyze our React components and identify:- Common patterns we use for state management- Inconsistencies in component structure- Opportunities for creating shared abstractions"
Before making changes, use Ask to understand impact:
"If I change the User interface to add a 'role' field,what parts of the codebase would be affected?List all files, functions, and tests that would need updates."
Ask mode becomes even more powerful with MCP servers:
// With context7 MCP enabled"How do I implement infinite scrolling in Next.js 14?Use context7 to get the latest documentation."
// With GitHub MCP"What changes were made to authentication in the last 10 PRs?Check both merged PRs and comments for context."
Manual mode is for when you know exactly what needs to change and want full control.
Be Specific with File Selection
@file
references for clarityProvide Clear Instructions
"In the login function starting at line 45:1. Add input validation for email format2. Add rate limiting check before authentication3. Update the error response to match our API standards"
Use for Teaching Manual mode is excellent for onboarding:
"Update the calculatePrice function to include tax.Follow our existing pattern in calculateShipping."
Custom modes let you create specialized AI personalities for your team’s unique needs.
{ "name": "Security Audit", "tools": ["codebase_search", "read_file", "terminal"], "instructions": "Focus on finding security vulnerabilities. Check for: SQL injection, XSS, hardcoded secrets, missing authentication. Create security_report.md with findings and fixes.", "model": "claude-4-opus"}
{ "name": "Documentation", "tools": ["codebase_search", "read_file", "edit_file"], "instructions": "Generate comprehensive documentation. Include: purpose, parameters, return values, examples, edge cases. Follow JSDoc standards.", "model": "claude-4-sonnet"}
{ "name": "Performance", "tools": ["all_search", "terminal", "read_file"], "instructions": "Identify performance bottlenecks. Look for: N+1 queries, unnecessary loops, missing indexes, large payloads. Suggest optimizations with benchmarks.", "model": "o3"}
A team created a custom mode for database migrations:
// Custom Migration Mode Configuration{ "name": "DB Migration", "tools": ["read_file", "edit_file", "terminal"], "instructions": ` When creating migrations: 1. Always create up and down migrations 2. Test rollback before marking complete 3. Update schema documentation 4. Create migration guide for other devs `}
For consistent API design across teams:
{ "name": "API Designer", "tools": ["codebase_search", "edit_file"], "instructions": ` Follow REST principles and our API standards: - Consistent naming (kebab-case) - Proper HTTP status codes - Pagination for lists - Standard error format - OpenAPI documentation `}
Start with Ask Mode
Switch to Agent Mode
Finish with Manual Mode
When switching modes, preserve context:
// In Ask Mode"Analyze the payment processing flow and identify where we calculate taxes"
// Switch to Agent Mode"Based on the tax calculation you just found, update it to handle international taxes"
// Switch to Manual Mode"In the tax configuration file, add specific rates for EU countries"
Mode | Memory Usage | Token Consumption | Best Model Choice |
---|---|---|---|
Agent | High (explores many files) | Very High | Claude 4 Sonnet (balance) |
Ask | Medium (searches codebase) | Medium | Gemini 2.5 Pro (long context) |
Manual | Low (specific files) | Low | Any fast model |
Custom | Varies by configuration | Varies | Task-specific |
The 80/20 Rule
“80% of the time, I’m in Ask mode learning. 20% in Agent mode implementing. This ratio gives me the best results.” - Senior Dev at TechCorp
Mode Macros
Create keyboard shortcuts for common mode switches. Map Ctrl+Shift+A
for Agent, Ctrl+Shift+Q
for Ask (Q = Question).
Custom Mode Library
Build a library of custom modes for your team. Share them via Git for consistency across developers.
Problem: Agent mode is powerful but can over-engineer simple changes. Solution: Use Manual mode for straightforward edits. Save Agent for complex, multi-file work.
Problem: Developers try to understand code by reading it manually. Solution: Ask mode with good questions is 10x faster. Practice asking comprehensive questions.
Problem: Teams don’t invest in creating custom workflows. Solution: Start with one custom mode for your most common task. Expand gradually.
Now that you understand the nuances of each mode:
Remember: Modes are tools. The best developers know when to use each one. Master this, and you’ll work at a completely different level of efficiency.