Skip to main content

Agent Mode: Modify Your Entire Codebase with One Command

Complete guide to Agent Mode: Modify Your Entire Codebase with One Command: architecture, practical implementation and best practices for developers…

What do you think about this article?

At a Glance

Complete guide to Agent Mode: Modify Your Entire Codebase with One Command: architecture, practical implementation and best practices for developers…

03 - Agent Mode: Modify Your Entire Codebase with One Command

Picture this: you tell your IDE "add JWT authentication to this Angular application" and watch as the editor creates files, writes services, updates components, runs tests, and fixes errors on its own - without you touching a single line of code. This is not science fiction: it is Cursor's Agent Mode, one of the most transformative features in the AI-native IDE ecosystem of 2025.

Unlike simple autocompletion or text-based AI chat, Agent Mode elevates artificial intelligence to an entirely new level: the agent has access to the file system, can execute terminal commands, read error output, and iterate autonomously until a task is correctly completed. It is like having a senior developer working in parallel with you, capable of handling complex multi-file tasks with deep understanding of the project context.

In this article, we will explore Agent Mode in its entirety: from internal architecture to practical capabilities, from real use cases to advanced strategies for maximizing productivity. We will see how to integrate it with the Cursor Rules system, how to manage its limitations, and how it compares to competitors like GitHub Copilot Agent and Claude Code.

What You Will Learn in This Article

  • Agent Mode architecture: how LLM + tool use + file system access work together
  • The difference between Ask Mode, Edit Mode and Agent Mode - and when to use each
  • How to activate and configure Agent Mode with the right models
  • Complete agent capabilities: file creation, multi-file editing, terminal, web search
  • Practical use cases with complete Angular code examples
  • How Cursor Rules amplify agent effectiveness
  • Limitations, workarounds and advanced modes like YOLO Mode and Max Mode
  • Comparison with GitHub Copilot Agent and Claude Code
  • Best practices for effective prompts and professional workflows

Series Overview: Cursor IDE and AI-Native Development

# Article Focus
1Complete Cursor IDE GuideFull overview
2Cursor RulesCustom AI configuration
3You are here - Agent ModeAdvanced multi-file automation
4Plan Mode and Background AgentsPlanning and parallelism
5Cursor HooksWorkflow automation
6MCP and CursorDatabase and API integrations
7Debugging with Cursor AI3x faster debugging
8Cursor vs Windsurf vs CopilotTool comparison 2026
9Professional Angular WorkflowFull project with Cursor

Agent Mode Architecture: How It Really Works

To use Agent Mode effectively, it is essential to understand what happens under the hood. Agent Mode is not simply "the AI that writes more code": it is a multi-component system where a Large Language Model is equipped with concrete tools to interact with the development environment.

The Tool Use Model

At the heart of Agent Mode is the concept of tool use (or function calling). The underlying LLM - whether Claude Sonnet, GPT-4o, or Gemini - does not just generate text: it is trained to recognize when it needs to use an external tool to complete a task. Instead of "inventing" the contents of a file, the agent can actually read that file. Instead of imagining the output of a command, it can execute it and read the result.

The tools available to the Cursor agent include:

  • read_file: Reads the content of a specific file
  • write_file: Creates or overwrites a file with new content
  • edit_file: Applies specific changes to portions of a file
  • list_directory: Lists files in a directory
  • search_files: Searches for textual or semantic patterns in the codebase
  • run_terminal_command: Executes commands in the integrated terminal
  • read_terminal_output: Reads terminal output (including errors)
  • web_search: Searches for updated information on the web
  • create_subagent: Creates specialized agents for specific tasks (Cursor 2.0+)

The Agentic Loop

Agent Mode works through an iterative reasoning cycle:

  1. Observe: Reads context (files, project structure, existing errors)
  2. Plan: Determines the steps needed to complete the task
  3. Act: Uses available tools (creates files, runs commands, etc.)
  4. Evaluate: Reads outputs, checks for errors, verifies the result
  5. Iterate: If there are errors, returns to step 1 with new information

This loop continues autonomously until the task is complete or the agent determines it needs input from the user.

Context Gathering: How the Agent Understands the Project

Before writing a single line of code, Agent Mode performs a thorough context analysis. Cursor indexes the codebase using semantic embeddings, allowing the agent to find relevant files and patterns even when they are not explicitly mentioned in the prompt. This is fundamentally different from a simple grep: the agent understands the conceptual relationships between different parts of the code.

For example, if you ask the agent to "add validation to the login form," it automatically knows to look at the login component, the reactive form, existing validators, TypeScript models, and potentially associated unit tests - all without you having to specify it.

Ask Mode, Edit Mode and Agent Mode: The Key Differences

Cursor offers three main modes of AI interaction, each optimized for different scenarios. Understanding when to use each is fundamental to maximizing productivity.

Ask Mode: The Conversation

Ask Mode (accessible with Ctrl+L / Cmd+L) is Cursor's conversational mode. In this mode, the AI answers your questions with explanations, suggestions and code snippets, but does not directly modify files. It is the ideal mode for:

  • Understanding complex or legacy code sections
  • Exploring architectural alternatives before implementing
  • Asking questions about specific libraries, APIs or patterns
  • Performing code reviews and receiving feedback on existing code
  • Brainstorming on project design and structure

Edit Mode: Contextual Editing

Edit Mode (accessible with Ctrl+K / Cmd+K) allows targeted, contextual edits. The AI acts on the current file or a specific selection, applying localized transformations. It is ideal for:

  • Refactoring a single function or class
  • Code transformations (e.g., converting a function to async/await)
  • Adding JSDoc documentation to existing methods
  • Fixing a specific bug in the current file
  • Quick fixes suggested by the IDE

Agent Mode: Complete Automation

Agent Mode (accessible with Ctrl+I / Cmd+I, by selecting "Agent" from the dropdown) is the most powerful mode. The agent can work across multiple files, execute commands, iterate on errors and complete complex tasks autonomously. It is the right mode for:

  • Implementing complete features involving multiple files
  • Large-scale codebase refactoring (e.g., migrating from CommonJS to ES modules)
  • Initial project setup with complete scaffolding
  • Bug fixing requiring cross-file analysis
  • Adding tests to existing components
  • Technology migrations (e.g., RxJS 6 to RxJS 7)
When to use each mode

QUESTION: "What does this RxJS operator do?"
→ Use Ask Mode (information, no modification)

TASK: "Convert this callback function to a Promise"
→ Use Edit Mode (localized modification, single file)

TASK: "Add JWT authentication to the entire application"
→ Use Agent Mode (multi-file, commands, iteration)

TASK: "Write tests for this component"
→ Use Agent Mode (creates test files, runs tests, fixes errors)

TASK: "Explain the project architecture"
→ Use Ask Mode (analysis, no modification)

TASK: "Add form validation and update TypeScript types"
→ Use Agent Mode (modifies multiple related files)
    

Activating and Configuring Agent Mode

Opening the Chat and Selecting Agent Mode

Agent Mode is activated through Cursor's Composer window. Here are the steps:

  1. Press Ctrl+I (Windows/Linux) or Cmd+I (macOS) to open the Composer
  2. In the dropdown at the top left of the chat, select "Agent"
  3. Alternatively, in an existing chat, click on the current mode and select "Agent"

You can also set Agent Mode as default in Cursor settings: Settings > Features > Chat > Default Mode.

Choosing the Right Model

Agent Mode supports several LLM models, each with different characteristics. Model choice significantly influences the quality of results:

Model selection guide for Agent Mode

CLAUDE SONNET 4.5 / CLAUDE OPUS 4
- Best understanding of complex context
- Excellent for refactoring and architecture
- Deeper reasoning
- Recommended for: complex tasks, large codebases

GPT-4O
- Great speed/quality balance
- Good long context handling
- Recommended for: medium tasks, rapid iterations

GEMINI 2.0 FLASH
- Very fast
- Very large context window (1M tokens)
- Recommended for: tasks with many files, large codebase analysis

CURSOR FAST (proprietary model)
- Optimized for speed
- Recommended for: quick completions, inline suggestions
    

YOLO Mode: Automatic Command Execution

By default, Agent Mode asks for confirmation before executing any terminal command. YOLO Mode removes this confirmation requirement, allowing the agent to execute commands autonomously. To activate it:

Settings > Features > Chat & Composer > Allow agent to run commands automatically

Be Careful with YOLO Mode

YOLO Mode is powerful but requires caution. Always configure allowed commands by specifying an allowlist (e.g., npm test, ng build) and a denylist (e.g., rm -rf, git push). Do not activate YOLO Mode in production environments or on repositories with sensitive data without properly configuring limits first.

Max Mode: Extended Context

Introduced with recent updates, Max Mode removes Cursor's aggressive context pruning limitations. While in standard mode the agent reduces context to improve response speed, Max Mode uses the full context available from the model. This translates into significantly better results for:

  • Large codebases with many cross-file dependencies
  • Complex bugs requiring understanding of multiple application layers
  • Refactoring that must respect architectural patterns distributed throughout the project

Complete Agent Capabilities

File Creation and Modification

The agent can create new files and modify existing ones with full awareness of the project structure. It does not just generate code in isolation: it reads existing files, understands their patterns, and generates new code consistent with the project's style and conventions.

Example: creating a complete feature

Agent prompt:

"Create a toast-style notification system for this Angular application.
It must include:
- NotificationService with success(), error(), warning(), info() methods
- Standalone NotificationComponent with CSS animations
- Integration in AppComponent
- NotificationMessage model with type, message and duration
- Unit tests for the service

Use standalone components, signals for state, and respect
the project's Angular conventions (OnPush, async pipe, etc.)"
    

With this single prompt, Agent Mode typically creates or modifies:

  • src/app/core/models/notification.model.ts (new)
  • src/app/core/services/notification.service.ts (new)
  • src/app/shared/components/notification/notification.component.ts (new)
  • src/app/shared/components/notification/notification.component.html (new)
  • src/app/shared/components/notification/notification.component.css (new)
  • src/app/app.component.ts (modified to include the component)
  • src/app/app.component.html (modified to add the component tag)
  • src/app/core/services/notification.service.spec.ts (new)

Terminal Command Execution

Agent Mode can execute commands in Cursor's integrated terminal and read their output. This allows it to:

  • Install dependencies with npm install
  • Run the build and read TypeScript errors
  • Execute tests and iterate until they pass
  • Run linters and formatters automatically
  • Use Angular CLI for scaffolding
  • Execute custom project scripts

Real-Time Web Search

An often undervalued capability is the ability to search for information on the web during task execution. The agent can consult official documentation, look up solutions to specific errors, or verify the correct syntax of updated APIs. This is especially useful when working with frequently-updated libraries like Angular, RxJS or Material Design components.

Error Analysis and Self-Correction

One of Agent Mode's most powerful features is its ability to self-correct. After generating code, the agent runs the build (if YOLO Mode is active or the user approves), reads TypeScript or linter errors, and iterates by modifying the code until there are no more errors. This feedback loop drastically reduces the time needed to achieve a clean build.

Practical Use Cases with Angular

Case 1: Adding a Complete Feature (Component + Service + Test)

The most common use case for Agent Mode is implementing new features. Let us look at a concrete example: adding a pagination system to an Angular list.

Prompt to implement complete pagination

Implement a pagination system for the UserListComponent.

Technical requirements:
- Create standalone PaginationComponent with signal-based state
- PaginationService for business logic (page calculation, navigation)
- UserListComponent must accept input() for totalItems and pageSize
- Emit output() pageChange with current page number
- Use HttpClient to load paginated data from endpoint /api/users?page=&size=
- Handle loading state and error state
- Add ARIA labels for accessibility
- Unit tests for PaginationService (min 80% coverage)
- Integration tests for UserListComponent

Expected file structure:
- src/app/shared/components/pagination/pagination.component.ts
- src/app/shared/components/pagination/pagination.component.html
- src/app/shared/components/pagination/pagination.component.css
- src/app/core/services/pagination.service.ts
- src/app/features/users/user-list.component.ts (update)
    

Here is the code the agent typically generates for PaginationService:

pagination.service.ts - Generated by Agent Mode

import { Injectable, signal, computed } from '@angular/core';

export interface PaginationState {
  currentPage: number;
  pageSize: number;
  totalItems: number;
}

@Injectable({
  providedIn: 'root'
})
export class PaginationService {
  private readonly _state = signal<PaginationState>({
    currentPage: 1,
    pageSize: 10,
    totalItems: 0
  });

  readonly state = this._state.asReadonly();

  readonly totalPages = computed(() =>
    Math.ceil(this._state().totalItems / this._state().pageSize)
  );

  readonly hasPreviousPage = computed(() =>
    this._state().currentPage > 1
  );

  readonly hasNextPage = computed(() =>
    this._state().currentPage < this.totalPages()
  );

  readonly pageNumbers = computed(() => {
    const total = this.totalPages();
    const current = this._state().currentPage;
    const range = 2;

    const start = Math.max(1, current - range);
    const end = Math.min(total, current + range);

    return Array.from({ length: end - start + 1 }, (_, i) => start + i);
  });

  updateState(partial: Partial<PaginationState>): void {
    this._state.update(state => ({ ...state, ...partial }));
  }

  goToPage(page: number): void {
    const total = this.totalPages();
    if (page >= 1 && page <= total) {
      this._state.update(state => ({ ...state, currentPage: page }));
    }
  }

  nextPage(): void {
    if (this.hasNextPage()) {
      this.goToPage(this._state().currentPage + 1);
    }
  }

  previousPage(): void {
    if (this.hasPreviousPage()) {
      this.goToPage(this._state().currentPage - 1);
    }
  }
}
    

Case 2: Cross-File Refactoring

One of Agent Mode's most evident strengths is refactoring that spans multiple files. Consider this scenario: you need to migrate all components in an Angular project from ngModel to Reactive Forms.

Prompt for large-scale refactoring

Migrate all application forms from Template-Driven Forms to Reactive Forms.

Analyze all files in src/app/ and:
1. Identify all components using ngModel or [(ngModel)]
2. For each component found:
   - Replace ngModel with FormControl/FormGroup
   - Add ReactiveFormsModule to component imports
   - Remove FormsModule if no longer needed
   - Update inline validation with Validators
   - Keep the same submit logic
3. Update existing tests to use ReactiveFormsModule
4. Verify the build passes after each modification

Maintain UI backward compatibility.
Do not modify HTTP services or business logic.
    

Case 3: Context-Aware Bug Fixing

Agent Mode excels at bug fixing because it is not limited to the file where the error appears: it understands relationships between components and services to find the true root cause.

Prompt for intelligent bug fixing

I have a bug in the application: when I navigate to /users/123/settings
and then go back with the browser, UserSettingsComponent shows the previous
user's data instead of reloading it.

The error seems related to route params handling combined with
service caching. The bug only occurs AFTER the first navigation -
page refresh works correctly.

Analyze:
- UserSettingsComponent and how it handles ngOnInit/ActivatedRoute
- UserService and its caching strategy
- Routing configuration for this module
- Any Observables that might not be re-subscribed

Propose and implement the fix with explanations.
    

In this scenario, Agent Mode typically:

  1. Reads user-settings.component.ts and identifies it uses ngOnInit instead of ngOnChanges or takeUntilDestroyed
  2. Reads user.service.ts and finds the Observable completes and does not re-emit after subscription
  3. Reads app.routes.ts or the routing module to understand if the component is recreated or reused
  4. Proposes the fix: using ActivatedRoute.paramMap with an Observable instead of snapshot
  5. Implements the fix across all involved files
  6. Runs the linter to verify the correctness of modified code

Agent Mode and Cursor Rules: A Powerful Synergy

Agent Mode becomes exponentially more powerful when combined with the Cursor Rules system. Rules act as "system instructions" that guide the agent on how to operate within your specific project. Without Rules, the agent generates generic code that may not respect team conventions. With well-configured Rules, the generated code is indistinguishable from that written by an experienced developer familiar with the project.

How Rules Influence Agent Mode

Always type Rules are injected at the start of every agent session, providing constant context. Agent Requested Rules are dynamically loaded when the agent determines they are relevant to the current task. This allows specialized rules for different aspects of the project without unnecessarily bloating the context window.

Here is a complete example of a Rules configuration for an Angular project with Agent Mode. In the new Cursor structure (post 0.45), rules go in the .cursor/rules/ directory as .mdc files:

.cursor/rules/angular-core-always.mdc

---
description: Core rules for Angular development in this project
globs: ["src/**/*.ts", "src/**/*.html"]
alwaysApply: true
---

# Angular Rules - Always Active

## Framework and Version
- Angular 19+ project with standalone components (NO NgModules)
- TypeScript strict mode enabled
- RxJS 7.8+ (avoid deprecated operators)

## Component Guidelines
- ALWAYS OnPush change detection
- ALWAYS standalone: true
- USE signals (signal(), computed(), effect()) for local state
- USE input() and output() instead of @Input/@Output decorators
- AVOID constructor injection, use inject()
- USE takeUntilDestroyed() to manage subscriptions

## Service Guidelines
- providedIn: 'root' for global services
- USE HttpClient with typed responses HttpClient.get<T>()
- ALWAYS handle errors with catchError
- Use interceptors for auth headers, not logic in services

## File Naming
- Components: kebab-case, e.g. user-profile.component.ts
- Services: kebab-case with .service.ts suffix
- Models: kebab-case with .model.ts suffix
- Separate HTML and CSS files (no inline templates/styles)

## Testing
- Use jasmine + karma (not jest, not vitest)
- Minimum 80% coverage for services
- Use TestBed for component tests
- Mock HTTP services with HttpClientTestingModule
    
.cursor/rules/angular-agent-patterns.mdc

---
description: Advanced patterns for Agent Mode in this Angular project
globs: ["src/app/**/*.ts"]
alwaysApply: false
---

# Project Architectural Patterns

## Directory Structure
```
src/app/
├── core/           # Singleton services, guards, interceptors
├── shared/         # Reusable components and pipes
├── features/       # Feature modules (lazy loaded)
│   ├── auth/
│   ├── users/
│   └── dashboard/
└── models/         # Shared TypeScript interfaces
```

## State Management
- Use signals for component-local state
- Use services with BehaviorSubject/signal for shared state
- NO NgRx unless already in the project

## HTTP Patterns
```typescript
// CORRECT PATTERN for HTTP calls
getData(): Observable<User[]> {
  return this.http.get<User[]>('/api/users').pipe(
    catchError(err => {
      console.error('Failed to fetch users:', err);
      return throwError(() => new Error('Failed to fetch users'));
    })
  );
}
```

## When the Agent Creates a New Component:
1. Check if a similar component already exists in shared/
2. ALWAYS add to a barrel file export (index.ts)
3. Update routing if the component is a page
4. Generate the corresponding test file
    

With this Rules configuration, when the agent receives a prompt like "Create a component for the orders list," it automatically generates:

  • A standalone component with OnPush change detection
  • Signals for local state
  • input()/output() instead of decorators
  • inject() for dependency injection
  • takeUntilDestroyed() for subscriptions
  • The corresponding test file
  • The barrel file update

All of this automatically, without you needing to specify it in the prompt.

Agent Mode Limitations and How to Overcome Them

Context Window and Large Files

The most common limitation of Agent Mode is the context window. When the codebase is very large, the agent may not have sufficient space to load all relevant files simultaneously. This can lead to inconsistent modifications or loss of context between different parts of a task.

Strategies for Managing the Context Window

  • Break large tasks into steps: Instead of a single mega-task prompt, split the work into logical steps. Complete and verify each step before moving to the next.
  • Use @file for explicit context: Explicitly indicate relevant files with @filename in the prompt to help the agent prioritize context.
  • Enable Max Mode: For complex tasks requiring much context, Max Mode reduces aggressive pruning and improves result quality.
  • Create context documents: For very large projects, create ARCHITECTURE.md or CONTEXT.md files that summarize the project structure. The agent can read these at the start of a task.

Potentially Destructive Actions

Agent Mode can modify or delete critical files if not properly guided. Some fundamental preventive measures:

  • Commit before delegating to the agent: Always commit or stash your changes before running Agent Mode on significant tasks. This lets you return to the previous state with a simple git checkout.
  • Use Rules to define protected files: Add a rule indicating which files the agent should never modify (e.g., critical configuration files, database migration files).
  • Review before applying: Cursor always shows a diff of proposed changes before applying them. Take time to review, especially for critical files like configurations or database schemas.

Reasoning Errors and Hallucinations

Like any AI system, Agent Mode can make mistakes. It may "hallucinate" non-existent APIs, use outdated library versions, or misinterpret ambiguous requirements. Countermeasures:

  • Specific prompts: The more specific your prompt, the smaller the margin for misinterpretation. Include library versions, preferred patterns, and explicit constraints.
  • Enable web search: Allowing the agent to consult updated documentation significantly reduces the risk of using outdated APIs.
  • Verify the output: Never apply changes without reviewing them. This is especially important for critical business logic or security code.

Never Delegate Security Code Without Review

Authentication, authorization, encryption, and secrets management are areas where AI can produce functionally correct code but with subtle security vulnerabilities. Always carefully review agent-generated security code and, if possible, have it reviewed by a security expert.

Agent Mode vs GitHub Copilot Agent vs Claude Code

The AI agent landscape for software development in 2025-2026 is competitive. Let us see how Cursor's Agent Mode compares to the main alternatives.

Direct comparison: Cursor Agent vs Copilot Agent vs Claude Code

CAPABILITY                  CURSOR AGENT    COPILOT AGENT   CLAUDE CODE
────────────────────────────────────────────────────────────────────────
Parallel agents             8 (worktrees)   1               1 (task)
File system access          Yes             Yes             Yes
Terminal execution          Yes (YOLO Mode) Limited         Yes (bash)
Web search                  Yes             No              Yes
Codebase indexing           Yes (semantic)  Yes             No (manual)
Multi-repo support          Yes (worktrees) No              Partial
Context window              200K+ (Max Mode) 128K           200K (Claude 3.5)
Background agents           Yes             No              No
Cursor Rules integration    Yes (native)    No              CLAUDE.md
MCP support                 Yes (native)    Limited         Yes
Price                       $20/mo (Pro)    $10/mo          API usage
IDE integration             Dedicated editor VS Code plugin CLI/API
Model control               Yes (LLM choice) Limited        Yes (Claude)
────────────────────────────────────────────────────────────────────────
    

Cursor Agent: Key Strengths

Cursor's main advantage is the native integration between IDE, agent, and Rules system. The agent has access to the entire semantically-indexed codebase, can modify files directly in the editor, execute commands in the integrated terminal, and iterate on errors in a closed loop. The ability to manage up to 8 parallel agents with git worktrees (introduced in Cursor 2.0) allows exploring alternative implementations simultaneously.

GitHub Copilot Agent: Key Strengths

Copilot Agent, integrated directly into GitHub Workflow, excels at autonomous GitHub Issues resolution. It can open PRs directly, work on tasks defined in issues, and natively integrate with GitHub code review processes. For teams already working in the GitHub ecosystem, this workflow is very fluid.

Claude Code: Key Strengths

Claude Code (Anthropic's CLI tool) shines for its flexibility and deep reasoning on complex tasks. It works well for long-duration tasks, architectural analysis, and situations where maximum reasoning quality is needed rather than execution speed. It can be integrated into any IDE through the terminal.

When to Choose Which

  • Cursor Agent: Daily development, feature implementation, refactoring, debugging. Best choice for those wanting an integrated IDE experience.
  • Copilot Agent: GitHub-centric teams, automated Issue resolution, PR workflow. Ideal as a complement to Cursor for the GitHub layer.
  • Claude Code: High-reasoning tasks, architectural analysis, automation scripts, environments where changing IDE is not possible.

Best Practices for Agent Mode

1. The Art of the Effective Prompt

The quality of Agent Mode's output is directly proportional to the quality of the prompt. A vague prompt produces generic code; a specific prompt produces code that looks like it was written by someone who deeply knows the project.

Anatomy of an effective prompt for Agent Mode

RECOMMENDED STRUCTURE:

[CONTEXT]
I am working on an Angular 19 application for HR management.
The EmployeeListComponent currently shows only a static list.

[SPECIFIC TASK]
Add search and filtering functionality to the employee list.

[TECHNICAL REQUIREMENTS]
- Real-time search with 300ms debounce (use RxJS debounceTime)
- Multiple filters: department (select), status (active/inactive), role
- Filters must be combinable (AND logic)
- Filter state must persist in URL as query params
- Use signals for local state, ActivatedRoute for URL sync

[CONSTRAINTS AND LIMITATIONS]
- Do not modify EmployeeService (it has its own tests)
- Maintain compatibility with the existing pagination component
- Do not add new npm dependencies

[EXPECTED OUTPUT]
- Update EmployeeListComponent
- Create EmployeeFilterComponent if needed
- Update EmployeeListComponent tests

---

EXAMPLE OF INEFFECTIVE PROMPT (to avoid):
"Add search to the list"
    

2. Use Frequent Git Checkpoints

Before every Agent Mode session on significant tasks, create a git checkpoint:

Recommended git workflow with Agent Mode

# Before launching Agent Mode on a significant task
git add -A
git commit -m "chore: checkpoint before agent mode - feature X"

# Or, for a temporary backup branch
git stash push -m "backup before agent mode"

# After the agent completes
# Review the changes
git diff HEAD

# If satisfied, commit
git add -A
git commit -m "feat(users): add pagination via agent mode"

# If something went wrong
git checkout .           # Undo all uncommitted changes
# Or
git stash pop            # Restore the stash
    

3. Review Before Applying

Cursor always shows a diff of the agent's proposed changes. Always take time to review these changes, especially for:

  • Configuration files (angular.json, tsconfig.json, package.json)
  • Authentication and authorization code
  • Database migration files
  • Critical business logic
  • Environment variables and sensitive configurations

4. Iterate and Refine the Task

Do not expect Agent Mode to complete complex tasks with a single perfect prompt. The most productive workflow is iterative:

Iterative workflow with Agent Mode

ITERATION 1: Base implementation
Prompt: "Create the base NotificationService with success/error methods"
→ Review, approve, commit

ITERATION 2: Feature addition
Prompt: "Add to NotificationService support for persistent notifications
        (that don't auto-close) and queue management (max 3 visible)"
→ Review, approve, commit

ITERATION 3: Tests and fixes
Prompt: "Write unit tests for NotificationService.
        Verify ng test passes without errors"
→ Agent writes tests, runs them, fixes any errors
→ Review, approve, commit

ITERATION 4: Integration
Prompt: "Integrate NotificationService in AuthService to show
        a success notification after login and error on invalid credentials"
→ Review, approve, commit
    

5. Configure Agent-Specific Rules

As we saw in the previous section, Rules are the most powerful productivity multiplier for Agent Mode. Invest time building a good Rules foundation for your project. A good rule of thumb: every time you correct something the agent did "wrong" relative to project conventions, add that correction as a Rule.

Professional Workflow with Agent Mode

A Developer's Typical Day with Agent Mode

Let us see how Agent Mode integrates into an Angular developer's daily workflow:

Professional daily workflow with Agent Mode

09:00 - PLANNING
- Open the backlog, select the day's task
- Use Ask Mode to analyze the task's impact on the codebase
  Prompt: "Analyze the codebase and tell me which files I'll need
           to modify to implement [feature X]. Identify dependencies and risks."

09:15 - GIT CHECKPOINT
git checkout -b feature/user-search
git add -A && git commit -m "chore: init feature branch"

09:20 - IMPLEMENTATION WITH AGENT MODE
- Activate Agent Mode
- Use structured prompt (context + task + constraints)
- Let the agent work (5-15 minutes for medium features)

09:40 - REVIEW AND REFINEMENT
- Review generated diff file by file
- Accept correct changes, reject problematic ones
- For partially correct changes, use Edit Mode for adjustments
- Ask for clarifications with Ask Mode if something is unclear

10:00 - TESTING
Agent Mode prompt: "Run ng test and fix all errors found.
Ensure coverage of modified files is >= 80%"

10:20 - COMMIT AND PR
git add -A
git commit -m "feat(users): add real-time search with URL sync"
git push origin feature/user-search
# Open PR on GitHub

10:30 - NEXT TASK
    

Pattern: Agent Mode for Assisted Code Review

A less obvious but highly effective use of Agent Mode is assisted code review. Before opening a PR, ask the agent to review your work:

Code review prompt with Agent Mode

Do a code review of the files I modified in this branch.

Analyze:
1. Compliance with Angular best practices (standalone, signals, etc.)
2. Potential memory leaks (unclosed subscriptions, reference cycles)
3. Performance (change detection, trackBy, pure pipes)
4. Security (XSS, injection, sensitive data in logs)
5. Test quality (coverage, edge cases, appropriate mocks)
6. Consistency with project conventions

For each issue found:
- Indicate the file and line
- Explain the problem
- Propose the fix

At the end, give an overall rating: Approved / Needs Changes / Major Issues
    

Agent Mode in Cursor 2.0: The New Frontiers

Cursor 2.0, released in late 2025, introduced significant improvements to Agent Mode. These features represent the future of AI-native development.

Parallel Agents with Git Worktrees

The most revolutionary feature of Cursor 2.0 is the ability to run up to 8 agents in parallel, each operating on a separate git worktree. Each agent works in isolation, allowing exploration of alternative implementations simultaneously without interference.

Imagine needing to choose between three different approaches to implement a critical feature. With parallel agents, you can launch three agents simultaneously, each with a different prompt specifying a different approach. After 15-20 minutes, you have three complete implementations to compare and choose the best one.

Background Agents

Cursor 2.0's Background Agents allow delegating long-term tasks that run in the background while you continue working on other things. You can launch an agent to "update all project tests for the new Angular version" and continue developing features in the meantime. The agent notifies you when it completes or when it needs input.

Specialized Subagents

Agent Mode now supports the creation of specialized subagents. An "orchestrator" agent can delegate specific parts of a task to specialized subagents: one for writing tests, one for performance optimization, one for documentation. Subagents can be configured with different models, rules, and tool access from the main agent.

Conclusions and Next Steps

Cursor's Agent Mode represents one of the most significant productivity leaps available to developers today. This is not about "AI writing code for you" - it is about an intelligent collaborator that accelerates your workflow, handles technical complexity, and frees your time to focus on architecture, design, and high-value decisions.

Key points to remember:

  • Agent Mode = LLM + Tool Use + Context: Not magic - a well-designed system where AI uses concrete tools to interact with the codebase.
  • Prompt quality determines output quality: Specific, contextual prompts with explicit constraints produce significantly better results than vague prompts.
  • Cursor Rules are the productivity multiplier: Good Rules configuration transforms the agent from "generic AI" to "experienced developer who knows your specific project."
  • Always review before applying: Agent Mode is powerful but not infallible. Your critical review is essential, especially for security code and critical business logic.
  • Iterate in small steps: The most effective workflow breaks complex tasks into iterative steps, with review and commits at each step.

Continue the Series: Next Article

In the next article of the series, we will explore Plan Mode and Background Agents: how to use structured planning for complex tasks and how to delegate work to Cursor 2.0's background agents to maximize productivity. If Agent Mode is the engine, Plan Mode is the steering wheel.

Related Articles in the Series

  • Cursor Rules (article 2): Deep dive into Rules system configuration to amplify Agent Mode in your specific project.
  • Plan Mode and Background Agents (article 4): The next step for automating even more complex tasks with structured planning.
  • MCP and Cursor (article 6): How to connect Agent Mode to databases, external APIs and custom tools through the Model Context Protocol.
  • Professional Angular Workflow (article 9): A complete Angular project developed entirely with Cursor Agent Mode, from creation to deployment.

Try These Tools

Free developer tools related to this topic.

Commenti

Caricamento commenti...

Sign in to comment

Discuss this article in the community

Join the Telegram group to discuss with other developers, ask questions and share your experiences.

Did you like this article?

Explore other content on the blog or discover my projects