Skip to main content

Operation Modes

Forge operates in two distinct modes that provide precise control over its interaction with your system: ACT mode and PLAN mode. These modes implement different permission and execution models, allowing you to calibrate Forge's capabilities to match your specific requirements and security considerations.

ACT Mode

ACT mode is Forge's default operation mode, permitting direct implementation of code changes and command execution. In this mode, Forge functions with full read-write capabilities within your environment.

Capabilities in ACT Mode

  • Full Execution: Forge can modify files, create new ones, and execute shell commands
  • Implementation: Directly implements the solutions it proposes
  • Verification: Performs verification steps to ensure changes work as intended
  • Feedback Loop: Provides real-time feedback on changes as they're implemented

When to Use ACT Mode

  • When you want hands-off implementation of solutions
  • For routine tasks that you're confident about
  • When you need quick fixes that don't require extensive review
  • When working in non-critical environments or with proper version control
  • For tasks where you want to see immediate results

Example Use Cases

  1. Bug Fixing: "Fix the null pointer exception in the authentication service"
  2. Code Generation: "Create a React component for a user profile page"
  3. Refactoring: "Refactor this function to use async/await instead of promises"
  4. Test Creation: "Generate unit tests for the payment processor module"

Activating ACT Mode

ACT mode is the default, but if you've switched to another mode, you can return to ACT mode with:

/act

PLAN Mode

PLAN mode is a read-only operation mode where Forge analyzes your codebase and suggests changes without implementing them. This mode is perfect for when you want to understand the potential impact of changes before they're made.

Capabilities in PLAN Mode

  • Read-Only Operations: Can only read files and run non-destructive commands
  • Detailed Analysis: Thoroughly examines code, identifies issues, and proposes solutions
  • Structured Planning: Provides step-by-step action plans for implementing changes
  • Safe Exploration: Allows exploration of potential solutions without making changes

When to Use PLAN Mode

  • When working with critical systems where changes need careful review
  • For learning how specific changes would be implemented
  • When you want to understand the scope and impact of a task
  • For complex refactoring that requires careful planning
  • When collaborating with others and changes need approval

Example Use Cases

  1. Architecture Planning: "How would you redesign this API to be more scalable?"
  2. Security Review: "Analyze this codebase for security vulnerabilities"
  3. Performance Analysis: "Identify potential performance bottlenecks in this application"
  4. Learning: "Explain how you would implement pagination for this API"

Activating PLAN Mode

To switch to PLAN mode, use:

/plan

Mode Switching Strategy

When to Switch from ACT to PLAN

  • When you're about to make significant architectural changes
  • Before modifying critical or production code
  • When you want to understand the scope of changes first
  • If you're working in an unfamiliar codebase

When to Switch from PLAN to ACT

  • After reviewing and approving the proposed changes
  • When moving from analysis to implementation
  • Once you understand the scope and impact of changes
  • For quick implementation following a planning session

Best Practices

  • Start Conservative: Begin in PLAN mode for critical systems to understand potential changes
  • Review Before Acting: Use PLAN mode to generate a plan, review it, then switch to ACT mode for implementation
  • Iterative Approach: For complex tasks, alternate between modes - plan first, implement a portion, plan again
  • Version Control: Always ensure you have commits or backups before using ACT mode for significant changes
  • Task Specificity: Be more specific with your requests in ACT mode to ensure accurate implementation