This article was originally published on aifoss.dev
Aider is what you reach for when you want an AI coding assistant that doesn't require installing a VS Code extension, logging into a browser tool, or surrendering your terminal for a GUI. It runs in your shell, edits your actual files, and commits each change to Git — automatically, with a descriptive message it generates. That workflow is either exactly what you want or a deal-breaker, and the line between those two camps is sharper than most tool comparisons.
Tested against: v0.86.2 (last stable release as of February 2026 — check PyPI for current). License: Apache 2.0. 40K+ GitHub stars, 4.1M installs.
What Aider actually does
You start a session by pointing Aider at one or more files in your repo:
aider src/main.py src/utils.py
From there, you describe what you want in plain English: "refactor the auth function to return a Result type instead of throwing," "add pagination to the list endpoint," "fix the failing test in test_parser.py." Aider edits the files directly and commits each change to Git with a descriptive message.
That Git-first philosophy is the tool's single strongest differentiator. Most AI coding tools treat Git as an afterthought — something you do after the AI finishes. Aider treats Git as the state machine. Every change is tracked, every rollback is clean, and you always know exactly what the AI touched. If something breaks, git revert HEAD puts you back in seconds.
The workflow matches how experienced engineers already work: edit incrementally, commit often, review the diff. Aider slots into that loop rather than replacing it.
Installation
Aider requires Python 3.10–3.12. Python 3.13 works via uv but isn't officially supported — uv will pull in a separate Python 3.12 automatically if needed.
# Recommended: isolated install via uv
pip install uv
uv tool install aider-chat
# Or direct pip install
pip install aider-chat
# Verify
aider --version
On first run in a project directory, Aider creates an .aider directory for session files and adds .aider* to your .gitignore automatically. It won't pollute your repo history with its own housekeeping.
Configure your model API key before starting:
# Claude (best results on Aider's Polyglot benchmark)
export ANTHROPIC_API_KEY=sk-ant-...
aider --model claude-sonnet-4-20250514
# OpenAI
export OPENAI_API_KEY=sk-...
aider --model gpt-4o
# DeepSeek (cost-efficient, competitive quality)
export DEEPSEEK_API_KEY=...
aider --model deepseek/deepseek-chat
# Local via Ollama
aider --model ollama_chat/qwen2.5-coder:32b
For projects where you use the same setup every time, put configuration in .aider.conf.yml at the project root:
model: claude-sonnet-4-20250514
architect: true
editor-model: claude-haiku-4-5-20251001
Architect mode
Architect mode is the most significant feature Aider has shipped. The problem it solves is real: frontier models that reason brilliantly about code often produce malformed diff output. A model capable of planning a clean six-file refactor will sometimes generate broken patch syntax that can't be applied.
The fix: split the job between two models. The first (the "architect") plans what needs to change and why. The second (the "editor") takes that plan and generates the actual file edits. You get sophisticated reasoning from an expensive model and clean, reliable output from a cheaper, more precise one.
# Cost-effective architect mode split
aider --architect \
--model claude-opus-4-20250514 \
--editor-model claude-haiku-4-5-20251001
For simple single-file changes, the overhead isn't worth it — run the fast model directly. For multi-file refactors, architectural changes, or complex logic rewrites, architect mode measurably reduces edit failures.
The cost math often works in your favor: Opus is expensive per token but the architect role doesn't need many. Haiku handles the high-volume edit generation. Total session cost is frequently lower than running Opus for everything, with higher quality.
Model support and the Polyglot benchmark
Aider publishes its own Polyglot coding benchmark — multi-language code editing tasks designed to reflect real-world performance rather than trivia. The leaderboard is updated as new models release, which makes it one of the more honest resources for choosing a model for coding work.
As of mid-2026, Claude Opus 4.x leads the Aider Polyglot benchmark. GPT-4o and Gemini 2.5 Pro are both strong performers. DeepSeek offers competitive quality at lower API cost. For local models, qwen2.5-coder:32b is the strongest open-weight option.
| Provider | Recommended model | Notes |
|---|---|---|
| Anthropic | claude-sonnet-4-20250514 | Best quality/cost balance for daily use |
| OpenAI | gpt-4o or o3-mini | Solid results; o3-mini cheaper for simple tasks |
| gemini-2.5-flash | Good value; thinking tokens supported | |
| DeepSeek | deepseek-chat | 50–80% cheaper than Claude, approaching frontier quality |
| Local (Ollama) | qwen2.5-coder:32b | Best open-weight code model as of 2026 |
The Ollama context window problem
Aider + Ollama works, but there's a critical setting most setup guides skip. Ollama defaults to a 2,048-token context window. For any non-trivial codebase, that means Aider is silently discarding most of your file content — and Ollama won't warn you. Results will look like model quality issues when the actual problem is context truncation.
Fix it before your first session:
# Set context to 32k before starting Ollama
OLLAMA_NUM_CTX=32768 ollama serve
Or add it permanently to your Modelfile:
FROM qwen2.5-coder:32b
PARAMETER num_ctx 32768
Our Ollama review covers Ollama's configuration in more depth, including how context window settings interact with VRAM usage.
Edit formats
Aider supports several formats for how it writes changes to files — this matters because model choice affects which format works reliably:
- whole: Rewrites the complete file. Most reliable, highest token cost.
- udiff: Unified diff format — efficient but occasionally misapplied by weaker models.
- editor-diff / editor-whole: Used in architect mode. The editor model receives the architect's plan and generates targeted changes.
Aider selects the format based on the model you're running. For Claude or GPT-4o sessions, the defaults are fine. If you're seeing frequent edit application failures with local models, --edit-format whole usually resolves it at the cost of higher token use.
Session workflow and commands
Once inside an Aider session, these commands cover most day-to-day use:
/add src/api/routes.py # Bring a file into session context
/drop src/api/routes.py # Remove a file from context
/run pytest tests/ # Run a command; output goes into context
/git diff HEAD # Review what Aider just changed
/undo # Undo the last Aider commit
/architect # Switch to architect mode for next request
/ask # Ask a question without making edits
/clear # Clear session history
The /run command is the one most users underuse. The pattern of running a test suite, letting Aider see the failure output, and asking it to fix the failing test is reliable and fast. Aider reads the exact error, knows which files are in scope, and makes targeted fixes — no copy-pasting stack traces.
The /ask command is useful when you want analysis without changes. Ask what a function does, ask for a refactoring plan, ask what tests should cover — then decide whether to proceed.
Aider vs. the alternatives
The two comparisons that come up constantly: Aider vs. Cline, and Aider vs. Continue.dev.
| Feature | Aider | Cline | Cont
Top comments (0)