Core Concepts
Reasoning Techniques
Memory Systems
Retrieval
Agent Types
Design Patterns
Training & Alignment
Frameworks
Tools & Products
Safety & Governance
Evaluation
Research
Development
Meta
Core Concepts
Reasoning Techniques
Memory Systems
Retrieval
Agent Types
Design Patterns
Training & Alignment
Frameworks
Tools & Products
Safety & Governance
Evaluation
Research
Development
Meta
Aider is an open-source AI pair programming tool created by Paul Gauthier that runs entirely in the terminal. It connects to LLMs like Claude, GPT-4, and Gemini to edit code directly in a local git repository, automatically committing changes with descriptive messages. With over 42,000 GitHub stars and millions of installs, Aider has established itself as a leading terminal-based AI coding assistant through its deep git integration, repository-wide context awareness, and flexible multi-model support.
Aider's architecture is built around three key components:
Repository Map (Tree-sitter)
Aider generates a structured map of the entire codebase using Tree-sitter, a language-agnostic parser generator. This repo map indexes files, functions, classes, methods, and their relationships across 100+ programming languages. Rather than naively concatenating file contents, the map provides the LLM with a compact representation of project structure, enabling:
The repo map is generated by parsing all source files into syntax trees, extracting declarations, building a dependency graph, and ranking symbols by relevance using PageRank-like scoring.
Edit Formats
Aider supports multiple formats for applying LLM-generated changes:
The edit format is selected based on the model's capabilities – more capable models use diff/udiff, while others default to whole-file replacement.
Architect/Editor Pattern
The Architect mode introduces a two-model system that separates reasoning from editing:
This separation achieves the highest benchmark scores (85% on Aider's code editing benchmark) by optimizing each model for its strength.
Git is fundamental to Aider's workflow, not an afterthought:
/diff or standard git diffgit reset HEAD~1 undoes the last AI changeThis makes AI-assisted changes fully traceable, reviewable, and reversible through familiar git workflows.
Aider handles coordinated edits across multiple files through:
/add <files>: Add files as editable context/read-only <files>: Add files as reference context (prevents accidental modification)# Aider workflow examples (terminal commands) # Start aider with Claude Sonnet in architect mode # $ aider --sonnet --architect # Start with GPT-4o # $ aider --4o # In-chat commands: # /add src/auth.py src/models.py - Add files for editing # /read-only src/config.py - Add as read-only context # /ask "How does the auth flow work?" - Ask without making edits # /architect - Toggle architect mode # /diff - Review pending changes # /run pytest tests/ - Run tests after edits # /undo - Undo last change (git reset) # /tokens - Show token usage # /model claude-3-5-sonnet - Switch models mid-session # Example session: # $ cd /path/to/project # $ aider --sonnet --architect # > /add src/api.py src/models.py # > Add pagination to the /users endpoint with limit and offset params # (Aider edits both files and auto-commits) # > /run pytest tests/test_api.py # (Aider sees test results and can fix failures)
Aider works with virtually any LLM provider:
| Provider | Models | Best For |
|---|---|---|
| Anthropic | Claude 3.5 Sonnet, Claude 3 Opus | Architect + Editor |
| OpenAI | GPT-4o, o1-preview, o1-mini | Editor, general use |
| DeepSeek | DeepSeek Chat V3, DeepSeek R1 | Cost-effective editor |
| Gemini Pro | Alternative provider | |
| Local | Ollama, LM Studio, any OpenAI-compatible | Privacy, offline use |
Models are configured via API keys in environment variables (ANTHROPIC_API_KEY, OPENAI_API_KEY, etc.) or command-line flags.
On Aider's code editing benchmark (measuring accurate multi-file changes):
| Feature | Aider | Cursor | GitHub Copilot | Claude Code |
|---|---|---|---|---|
| Interface | Terminal / chat | Full IDE (VS Code fork) | IDE plugin | Terminal / chat |
| Repo Awareness | Tree-sitter map (whole codebase) | Project-level context | Current file focus | Codebase search |
| File Edits | Multi-file diff/udiff + auto-commit | Inline suggestions | Inline autocomplete | Multi-file edits |
| Git Integration | Auto-commit with descriptive messages | Manual | Manual | Auto-commit |
| Model Flexibility | Any LLM (bring your own key) | Proprietary + OpenAI | OpenAI-focused | Claude only |
| Open Source | Yes (Apache 2.0) | No | No | No |
| Cost Model | Free tool + API costs only | Subscription | Subscription | Subscription / API |
Linting and Testing Integration
/run executes any shell command and feeds output back to the LLMVoice and Web Input
/voice for hands-free coding/web to add documentation or issue context# Install via pipx (recommended) # $ pipx install aider-chat # Or via pip # $ pip install aider-chat # Or via Homebrew (macOS) # $ brew install aider # Quick start # $ export ANTHROPIC_API_KEY=sk-ant-... # $ cd /path/to/git/repo # $ aider --sonnet