AIHow AI Works

Aider

CLI-based AI pair programmer that edits code directly in your local git repository with multi-model support, git-native commits, and autonomous debugging.

At a glance

Developer Paul Gauthier (Open Source)
Type CLI Tool
Pricing Open Source (Bring Your Own API Key)
Models used Claude Opus 5, GPT-6 Astra, Gemini 3.8 Flash, DeepSeek V4 (model-agnostic)
Difficulty Intermediate
Setup time 5 minutes
Integrations CLI, Git, VS Code (Terminal), All Major IDEs (Terminal)

Aider is the AI pair programmer that lives in your terminal and edits code directly inside your real git repository. It’s the tool that developers who love the command line reach for when they want AI to actually change their codebase — not just suggest code in a chat window — while keeping a clean, human-readable git history.

(adsbygoogle = window.adsbygoogle || []).push({});

Overview

Created in 2023 by Paul Gauthier, Aider has become the gold standard for CLI-based AI coding. What makes it uniquely powerful is its deep integration with git: every change Aider makes is automatically committed with a descriptive message, giving you a clear history of what the AI did and an easy path to undo any change.

Aider is model-agnostic and works with virtually any frontier model — Claude, GPT, Gemini, DeepSeek, Mistral, and local models via Ollama. It also publishes the widely cited Aider LLM leaderboard, a polyglot coding benchmark built on Exercism exercises across C++, Go, Java, JavaScript, Python, and Rust, which measures each model’s code-editing skill.

(adsbygoogle = window.adsbygoogle || []).push({});

Key Features

  • Git-Native Commits: Every file edit is automatically committed to git with an AI-generated commit message. Edit history is transparent and fully reversible with git revert.
  • Architect Mode: Aider first plans a multi-step solution using a strong reasoning model, then executes the plan using a fast, cost-efficient model — combining quality and speed.
  • Multi-Model Orchestration: Configure different models for different roles (e.g., Claude for planning, DeepSeek for writing) to optimize for both quality and API cost.
  • Repository Map: Uses tree-sitter to build a syntax-aware map of your codebase, letting Aider understand cross-file dependencies and make coordinated changes.
  • In-Chat File Control: Explicitly tell Aider which files to work with (/add src/api.py) or let it suggest relevant files automatically.
  • Voice Coding: Optional speech-to-text mode for hands-free prompting.
  • Universal Model Support: Works with a wide range of models via API (through LiteLLM) or locally via Ollama/LM Studio.

How It Works

  1. Launch: Run aider in your project directory — Aider indexes your codebase.
  2. Request: Describe your change in natural language (“Add pagination to the users endpoint”).
  3. Plan (Architect Mode): Aider creates a step-by-step implementation plan.
  4. Edit: Aider writes the code changes directly to your files.
  5. Commit: Changes are committed to git with a descriptive message.
  6. Review: Use git diff HEAD~1 to review exactly what changed.

Technical Architecture:
– Language: Python.
– Codebase Indexing: tree-sitter (multi-language syntax parsing).
– Git Integration: Native git library for atomic commits.
– Model Integration: LiteLLM for unified access to many model providers.
– Context Management: Intelligent file map to stay within model context limits.

Use Cases

Feature Development

  • New Endpoints: “Add a /health endpoint to the Express server that returns system status.”
  • UI Components: “Create a reusable DataTable component in React with sorting and pagination.”
  • Database Migrations: “Add an archived boolean field to the User model and create the migration.”

Debugging & Refactoring

  • Bug Fixing: Paste a stack trace and ask Aider to find and fix the root cause.
  • Legacy Modernization: “Refactor this class to use async/await instead of callbacks throughout.”
  • Test Coverage: “Write pytest unit tests for all functions in utils/parser.py.”

Multi-File Coordination

  • API + Tests + Docs: “Add the POST /orders endpoint with full validation, unit tests, and update the OpenAPI spec.”
  • Cross-Module Refactoring: Rename a function across all files that import it.

Pricing & Access

  • Aider Tool: Free and open-source (Apache 2.0). No subscription needed.
  • API Costs (Bring Your Own Key): You pay your model provider directly. All figures below are per 1M output tokens in USD, from each vendor’s own pricing page.
  • Cheapest option: DeepSeek V4-Flash — $1.32 at peak, $0.66 off-peak. DeepSeek has billed peak and off-peak rates since August 16, 2026; peak is 01:00–04:00 and 06:00–10:00 UTC on weekdays.
  • Best value: Claude Sonnet 5 — $10, with input at $2.
  • Best quality: Claude Opus 5 at $25, Claude Fable 5.1 at $50, or GPT-6 Astra at $50.
  • Local Option: Use Ollama with --model ollama/qwen2.5-coder:7b for zero API cost.

Architect Mode is what makes the arithmetic work: put the expensive model on the plan and a cheap one on the diff, and the frontier model never has to emit a single line of code.

Getting Started

Step 1: Install Aider

pip install aider-chat
# Or with pipx for isolated install:
pipx install aider-chat

Step 2: Set Up Your API Key

# For Claude (recommended for best results):
export ANTHROPIC_API_KEY=your-key-here

# For OpenAI:
export OPENAI_API_KEY=your-key-here

# For DeepSeek (cheapest):
export DEEPSEEK_API_KEY=your-key-here

Step 3: Start Aider in Your Project

cd your-project
aider  # Uses the best available model from your env vars

# Or specify a model explicitly:
aider --model claude-sonnet-5
aider --model gpt-6-astra
aider --model deepseek/deepseek-v4-flash  # Very cost-effective

Step 4: Use Architect Mode (Recommended)

# Plan with a strong model, execute with a cheaper one:
aider --architect --model anthropic/claude-opus-5 --editor-model deepseek/deepseek-v4-flash

Step 5: Add Files and Make Changes

# Inside aider session:
> /add src/api/users.py src/models/user.py
> Add rate limiting to the POST /users endpoint — max 10 requests per minute per IP.

Best Practices

  • Use Architect Mode for complex, multi-file changes.
  • Add only the relevant files to keep context small and responses precise.
  • Review every commit with git diff HEAD~1 before proceeding.
  • Use DeepSeek as the editor model in Architect Mode — V4-Flash output runs roughly 20x cheaper per token than Claude Opus 5.
  • Use /undo if Aider’s change isn’t right — it reverts the last commit instantly.

Limitations

  • CLI Only: Terminal-based — no GUI. Less accessible for non-technical users.
  • API Cost: You bear the full cost of API calls. Complex tasks can become expensive with premium models.
  • Context Limits: Very large codebases require careful file selection to stay within model context windows.
  • No Visual Interface: Can’t see live UI previews or browser output (use Cline for that).
  • The docs lag the model landscape. Aider reaches providers through LiteLLM, so current model IDs generally work as soon as LiteLLM knows them — but aider.chat/docs/llms.html still recommends Gemini 2.5 Pro, Claude 3.7 Sonnet and o3/o4-mini. Treat that page as a list of providers, not a list of current models, and pass the model ID yourself.

Alternatives

  • Claude Code – The same terminal-first shape with a sandbox and a single vendor’s models. Pick it if you want one polished path rather than a model switch.
  • Cline – Open-source VS Code extension, bring-your-own-key like Aider, but with an editor UI and browser previews.
  • Cursor – A full editor rather than a CLI. Better when you review every edit; weaker for scripted or headless runs.
  • Windsurf – Agentic IDE with flow-state tracking, for developers who want the agent inside the editor.
  • Ollama – Not a competitor but the usual pairing: run the model locally and Aider costs nothing per token.

Community & Support

Common questions

Which model should I run Aider with?

Aider is model-agnostic and reaches providers through LiteLLM, so the answer is whichever frontier model you already pay for. Claude Opus 5 and GPT-6 Astra are the strongest general choices; Claude Sonnet 5 is the best value per token for everyday edits; DeepSeek V4-Flash is the cheapest option that still edits code reliably.

Is Aider free?

The tool is free and open source under Apache 2.0. You pay your model provider directly for API usage, or nothing at all if you point Aider at a local model through Ollama.

What is Architect Mode?

A two-model setup: a strong reasoning model plans the change, and a cheaper, faster model writes the edits. You set both with --model and --editor-model. It is the setting that makes multi-file changes affordable, because the expensive model never has to emit the diff.

Does Aider's documentation list current models?

No. The recommended-models page on aider.chat still names Gemini 2.5 Pro, Claude 3.7 Sonnet and o3/o4-mini. Because Aider routes through LiteLLM, current model IDs generally work anyway — pass them yourself rather than taking the doc's list as the supported set.