Back to Documentation

Agent Mode

An autonomous AI coding assistant that uses tools to read files, write code, run tests, and manage your project - all while keeping you in control.

Getting Started

Switching to Agent Mode

  1. Open your workspace in the Generation page
  2. Look for the Mode Toggle in the header
  3. Click "Agent" to switch from Classic mode
  4. You'll see a green "Tool-based agent" indicator when active

Your First Conversation

Try simple requests like:

  • "Read the package.json file"
  • "List all TypeScript files"
  • "Create a new README.md file"

How Agent Mode Works

Your Request[Analyzing] - Understanding your intent[Thinking] - Planning the approach[Executing] - Using tools[Observing] - Checking resultsResponse

Available Tools (32 Total)

File Operations (8 tools)

  • Read files
  • Write new files
  • Edit existing files
  • Search file contents
  • List files by pattern
  • Delete files (with confirmation)
  • Apply code diffs
  • Get file with dependencies

Code Execution (5 tools)

  • Run shell commands
  • Install packages (npm, pip, etc.)
  • Run tests
  • Lint code
  • Format code

Git Operations (6 tools)

  • Git status and diff
  • Create commits
  • Push to remote (with confirmation)
  • Pull from remote
  • Manage branches

Context Analysis (4 tools)

  • Analyze codebase structure
  • Get component information
  • Find references
  • Trace dependencies

Web Operations (3 tools)

  • Search the web
  • Scrape websites
  • Fetch documentation

Planning (6 tools)

  • Break down complex tasks
  • Verify step completion
  • Ask clarifying questions
  • Quality validation (linting)
  • Finish task

Understanding Confirmations

The agent uses smart confirmations - you'll only be prompted for high-risk operations:

Always Confirm

(High Risk)
  • Deleting files
  • Git push to remote
  • Destructive commands (rm -rf, sudo, etc.)

Sometimes Confirm

(Medium Risk)
  • Modifying important files (package.json, tsconfig.json)
  • Installing new packages
  • Large refactors (5+ files)
  • Auto-fixing lint errors
  • Formatting all files

Never Confirm

(Low Risk)
  • Reading files
  • Searching code
  • Git status/diff
  • Context analysis

Tips for Best Results

Be Specific

X "Fix the app"

O "Fix the authentication error when users try to login"

Provide Context

If the agent needs more information, it will ask questions like: "Which authentication method should I use?" or "Should I create tests for this component?"

Let the Agent Work

The agent operates autonomously through multiple iterations. You'll see state changes, tool executions, and progress updates. Don't interrupt - watch the magic happen!

Keyboard Shortcuts

ShortcutAction
Cmd/Ctrl + KFocus input field
Cmd/Ctrl + EnterSend message
Cmd/Ctrl + Shift + CClear conversation
Cmd/Ctrl + MToggle Classic/Agent mode

Troubleshooting

Agent is Stuck

Check the current state indicator, wait for the iteration to complete, try rephrasing your request, or switch to Classic mode temporarily.

Unexpected Results

Provide more specific instructions, use follow-up messages to refine, or ask the agent to undo or modify its changes.

Error Recovery

Retryable errors (network, timeout) auto-retry up to 3 times. Non-retryable errors trigger alternative approaches. Critical errors are caught by error boundary with recovery options.