Skip to main content
Avante.nvim offers two distinct modes of operation: Agentic Mode and Legacy Mode. Each mode provides a different approach to AI-assisted coding, optimized for different use cases and workflows.

Mode Overview

Autonomous AI agent that can independently execute actionsIn agentic mode, the AI functions as an autonomous coding agent with access to a suite of tools. It can:
  • Read and analyze files in your codebase
  • Make direct edits using sophisticated tools
  • Search for code patterns and symbols
  • Execute shell commands
  • Manage multi-file changes autonomously
This mode is inspired by modern AI coding assistants like Cursor’s Agent mode and provides the most powerful and autonomous workflow.

Configuring Modes

Set your preferred mode in your Avante configuration:
lua/avante/config.lua:31
require('avante').setup({
  ---@type "agentic" | "legacy"
  mode = "agentic",  -- Default mode
  
  -- ... other configuration
})
The default mode is "agentic". This provides the most powerful autonomous workflow but requires you to trust the AI with file operations.

Agentic Mode Deep Dive

When to Use Agentic Mode

Agentic mode excels at:
  • Complex refactoring: Multi-file changes with automatic file reading and editing
  • Feature implementation: Building complete features that span multiple files
  • Code exploration: AI can autonomously search and analyze your codebase
  • Debugging: AI can read error logs, check diagnostics, and propose fixes
  • Rapid prototyping: Quick iterations with autonomous file creation and modification

How Agentic Mode Works

When you make a request in agentic mode:
  1. Planning: AI analyzes your request and plans necessary actions
  2. Tool execution: AI calls tools like view, str_replace, bash, etc.
  3. Iteration: AI can chain multiple tool calls to complete complex tasks
  4. Completion: AI signals completion with attempt_completion tool
-- Example: Available tools in agentic mode
tools = {
  "view",              -- Read file contents
  "str_replace",       -- Edit files with string replacement
  "create",            -- Create new files
  "insert",            -- Insert code at specific lines
  "bash",              -- Execute shell commands
  "grep",              -- Search for patterns
  "glob",              -- Find files by pattern
  "get_diagnostics",   -- Get LSP diagnostics
  "attempt_completion", -- Signal task completion
  -- ... and more
}

Tool Permissions

Control AI’s autonomy with permission settings:
{
  behaviour = {
    auto_approve_tool_permissions = true,  -- Default
  },
}
AI can execute all tools without prompting. Best for trusted workflows and rapid iteration.

Fast Apply Mode

Avante supports Fast Apply mode in agentic mode for near-instant code application:
{
  behaviour = {
    enable_fastapply = true,  -- Enable Fast Apply
  },
  providers = {
    morph = {
      model = "morph-v3-large",  -- Specialized apply model
    },
  },
}
With Fast Apply:
  • Code changes apply at 2500-4500+ tokens/second
  • 96-98% accuracy with specialized apply models
  • Seamless workflow without noticeable delays
See the Fast Apply documentation for setup details.

Legacy Mode Deep Dive

When to Use Legacy Mode

Legacy mode is preferred for:
  • Code review: When you want to carefully examine each suggestion
  • Learning: Understanding AI’s reasoning before applying changes
  • Simple edits: Quick, focused changes that don’t require autonomy
  • Sensitive code: When working on critical systems requiring manual approval
  • Explanations: Getting detailed code explanations without automatic changes

How Legacy Mode Works

In legacy mode, the workflow is more traditional:
  1. Ask: You ask a question or request changes
  2. Response: AI provides suggestions in the chat sidebar
  3. Review: You review the suggested code in the diff view
  4. Apply: You manually apply changes using keybindings
-- Key bindings for legacy mode
-- In sidebar:
-- A - Apply all suggestions
-- a - Apply suggestion at cursor
-- co - Choose ours (keep current code)
-- ct - Choose theirs (apply suggested code)

Diff Application

Legacy mode uses Neovim’s diff system for change visualization:
  • Visual diff: Side-by-side comparison of current vs suggested code
  • Conflict markers: Git-style conflict markers for manual resolution
  • Selective application: Choose specific changes to apply
{
  behaviour = {
    auto_apply_diff_after_generation = false,  -- Default in legacy
  },
  diff = {
    autojump = true,
    override_timeoutlen = 500,
  },
}

Comparing the Modes

FeatureAgentic ModeLegacy Mode
Tool execution✅ Automatic❌ Not available
File reading✅ Autonomous⚠️ Manual context
Multi-file edits✅ Automatic⚠️ One at a time
Shell commands✅ Available❌ Not available
Change preview⚠️ Via logs✅ Full diff view
Manual control⚠️ Permission system✅ Complete control
Speed⚡ Fastest🐌 Slower
Complexity🎯 Handles complex tasks📝 Best for simple tasks

Mode-Specific Tools

Certain tools are only available in specific modes:

Agentic Mode Only

lua/avante/llm_tools/str_replace.lua:12
-- Tools enabled only in agentic mode:
- str_replace    -- String-based file editing
- create         -- Create new files
- insert         -- Insert code at lines
- write_to_file  -- Write entire files
- undo_edit      -- Undo previous edits
- edit_file      -- Fast Apply editing (if enabled)

Available in Both Modes

-- Tools available in all modes:
- view           -- Read file contents
- bash           -- Execute commands (with permissions)
- grep           -- Search patterns
- glob           -- Find files
- get_diagnostics -- LSP diagnostics

Switching Modes

You can change modes at any time by updating your configuration:
-- Runtime mode switching
require('avante.config').override({
  mode = "legacy",  -- or "agentic"
})
Consider starting with legacy mode if you’re new to Avante, then switch to agentic mode once you’re comfortable with the tool’s behavior.

Best Practices

For Agentic Mode

  1. Start with auto-approval off: Learn what tools do before auto-approving
  2. Use with version control: Always have uncommitted work backed up
  3. Review tool logs: Check what the AI actually did
  4. Set appropriate permissions: Balance speed with control
  5. Use prompt logging: Enable prompt_logger.enabled = true for debugging

For Legacy Mode

  1. Provide explicit context: Add relevant files manually with @file
  2. Review diffs carefully: Check all changes before applying
  3. Use conflict markers: Take advantage of Git-style conflict resolution
  4. Apply incrementally: Test changes one at a time for safer iterations
  5. Leverage chat history: Build up context over multiple exchanges

Next Steps

Agentic Workflow

Deep dive into tools and autonomous execution

Providers

Configure AI providers for each mode

Configuration

Complete configuration reference

Keybindings

Customize mode-specific keybindings

Build docs developers (and LLMs) love