Aider: Terminal Pair Programming Where Every Edit Is a Git Commit
17 November 2026 · Updated 28 November 2026 · 11 min read · by Yang Kai
An Aider setup and workflow guide built from the official docs: installation, the repo map, architect mode's two-model split, the slash commands that matter, real costs, and who this open-source tool still suits.
Aider session command card
Contents
- What you need before you start
- Step 1: Install Aider
- Step 2: Start a first session
- Step 3: A first real edit, start to finish
- The repo map: Aider's answer to codebase context
- Architect mode: the two-model trick
- The session command card
- Settings that outlive one session
- What Aider costs
- Choosing a model for Aider
- Where Aider shows its age — honestly
- Common mistakes in a first week with Aider
- Verdict: who Aider still suits
Most AI coding tools leave you with a changed working tree and no clean record of what happened. Aider takes the opposite position: every accepted edit becomes a git commit with a generated message, so a bad change is one revert, not an archaeology project.
This guide covers Aider as it stands in November 2026: installation, the repo map, architect mode, the commands worth memorising, what it actually costs, and where it falls behind newer agents.
Everything below is drawn from Aider’s official documentation and its published leaderboard, checked November 2026 — this is a desk-researched guide, not a hands-on review.
| Aider at a glance | |
|---|---|
| Price | Free and open source (Apache-2.0); you pay only for the model |
| Runs in | Your terminal, inside a git repository |
| Models | Almost any LLM via LiteLLM — Claude, OpenAI, DeepSeek, Gemini, or local models through Ollama |
| Signature features | Auto-commits every edit, repo map, architect mode (two-model split) |
| Missing vs newer agents | No subagents, no skills system, no bundled MCP tooling |
What you need before you start
- Git installed — Aider works inside a repository and offers to initialise one if none exists.
- Python 3.8–3.13 if you use the
aider-installroute, or nothing at all if you use the one-line installer, which sets up its own Python 3.12. - A model: an API key for a hosted provider (set as an environment variable such as
ANTHROPIC_API_KEY), or a local model served by Ollama. - About ten minutes for install and a first session.
Step 1: Install Aider
The documented install routes, from Aider’s own docs:
# Recommended: the aider-install helper (isolated environment)
python -m pip install aider-install
aider-install
# Or the one-line installer (macOS / Linux)
curl -LsSf https://aider.chat/install.sh | sh
# Or with pipx / uv
pipx install aider-chat
uv tool install --python python3.12 aider-chat
Run aider --version in a new terminal to confirm the install worked. Aider’s docs advise against third-party system packages, which often pull the wrong dependencies.
Step 2: Start a first session
Move into a git repository and name the model you want:
aider --model sonnet path/to/file.py
The model string decides the provider, because Aider talks to models through LiteLLM. Documented examples include sonnet for Claude, gpt-4o for OpenAI, and ollama/qwen3-coder:30b for a local model. You can also pass a key directly with --api-key provider=<key>.
That breadth is Aider’s quiet advantage. When a new model ships, Aider usually works with it the same day, because there is no vendor roadmap to wait for.
Note: only add files you intend to edit. Files you merely want the model to know about belong in the repo map or in /read-only, covered next.
Step 3: A first real edit, start to finish
A typical session follows a rhythm worth learning deliberately, because each step has a check built into it.
- Start clean. Commit or stash your own work in progress first. Aider’s safety net is git, and it works best when its commits are the only unreviewed changes in the tree.
- Add narrowly.
/addthe one or two files the change touches. Resist adding a whole directory — every added file is context you pay for on every message. - Ask for the change in plain terms. State the behaviour you want and the constraint that matters (“keep the public API unchanged”). Aider edits the files and commits automatically, with a message describing the change.
- Read the diff.
/diffshows exactly what changed since the last commit. This is the review step most agent tools make awkward and Aider makes trivial. - Close the loop. If you launched with
--test-cmd, Aider has already run your tests and reacted to failures. If not,/testruns them now. - Undo without fear. Wrong turn?
/undoreverts Aider’s last commit and removes those files from the chat, so the session continues from the state before the mistake.
You should end the session with a short run of small, readable commits — each one a change you can defend. If the history looks messy, the session was too ambitious; split the next one.
The repo map: Aider’s answer to codebase context
Aider does not dump your repository into the prompt. It builds a repo map: a compact, tree-sitter-derived summary of the classes, functions and signatures across your codebase, ranked by relevance to the current chat, and sent with every request.
The model therefore knows what exists — which functions it can call, which files matter — without you pasting files or paying for a full index. Three controls matter:
--map-tokenssets the map’s token budget (default 1,000)./addbrings a file’s full contents into the chat when a summary is not enough./mapand/map-refreshshow and rebuild the map.
On a large codebase, raising the map budget for architecture questions and lowering it for focused edits is a real cost control that indexed editors hide from you.
Watch out: the map shows signatures, not implementations. Work that hinges on the body of code in files you have not added will go wrong until you /add them.
Architect mode: the two-model trick
Aider’s most copied idea is its mode split. In default code mode, one model reasons and edits. In architect mode, two models divide the labour:
- A strong, expensive architect model produces the plan.
- A cheaper editor model converts the plan into file edits.
aider --architect --model <strong-model> --editor-model <cheaper-model>
A third setting, --weak-model, handles the small jobs — commit messages and chat summarisation — so the flagship model never burns tokens naming a commit.
If you pay API rates, this three-tier routing is the most granular cost control any coding agent offers. It is the same principle as the Claude Code cost ladder, except Aider assigns the rungs per role instead of per session. In chat, /architect, /code, /ask (discuss without editing) and /help switch modes per message.
The session command card
/add <file> Bring a file into the chat (editable)
/drop <file> Remove it, freeing context
/read-only <f> Reference only — visible, never edited
/run <cmd> Run a shell command, feed output to the model
/test <cmd> Run tests; Aider reacts to failures
/diff Show what changed since the last commit
/undo Revert Aider's last commit
/model <name> Switch model mid-session
/tokens Show context usage — check before big asks
/map Show the repo map Aider built
Pair these with two launch flags. --lint-cmd and --test-cmd close the loop: Aider runs them after edits and tries to fix what breaks.
That loop — edit, lint, test, commit — is the whole Aider philosophy in one line: small verified steps, each one reversible.
Settings that outlive one session
Anything you pass as a flag repeatedly belongs in .aider.conf.yml, in your home directory or the project root. The file most projects end up adding is a conventions file, read into every session:
read:
- CONVENTIONS.md
A CONVENTIONS.md plays the same role for Aider that instruction files play elsewhere — the conventions split is mapped in AGENTS.md vs CLAUDE.md. Keep it short: Aider sends it with every request, so every line is a recurring token cost.
Aider also has a watch mode (--watch-files): mark a comment in your editor with AI! and Aider implements it, or AI? and it answers the question in a reply comment. It is the closest Aider gets to an editor integration, and it works with any editor because it never leaves the file.
What Aider costs
Pricing: the software is $0 — free and open source under Apache-2.0 (checked November 2026). Your only cost is the model.
That cost has three shapes:
- Hosted API models — billed per token at the provider’s rates. Architect mode exists precisely to push most tokens onto a cheaper editor model.
- Local models via Ollama — $0 per token, bounded by your hardware. The reality check on what local models can and cannot do is in the local LLM coding guide.
- Your time — Aider is a REPL you drive. It does not run unattended in the background.
Aider’s site also publishes a public leaderboard scoring how well models perform its editing benchmarks. It is a useful, vendor-neutral way to pick a model before you spend anything.
Choosing a model for Aider
Because Aider is model-agnostic, model choice is a decision you actually have to make. Three patterns cover most users:
- One strong model for everything. The simplest setup: a current frontier model in code mode. Best when sessions are short and you value zero configuration over cost.
- Architect plus editor. A strong model plans, a cheaper model edits. Best for long refactors and large features, where planning quality decides the outcome and edit volume decides the bill.
- Local model for drafts, hosted model for hard problems. Start sessions against Ollama for exploration and small edits, then switch with
/modelwhen the work gets serious. The switch is one command, mid-session, with the chat history intact.
Whichever pattern you pick, set a --weak-model as well. Commit messages and summaries are generated constantly; routing them to a small model is the easiest saving in the whole tool.
Where Aider shows its age — honestly
Aider’s release pace has slowed compared with its 2024–25 peak. It also lacks the apparatus the bigger tools now ship:
- No skills ecosystem comparable to Claude Code’s skills system.
- No subagents for parallel delegated work.
- No bundled MCP story comparable to Claude Code’s MCP setup.
- No graphical diff review — the interface is a terminal REPL, and it expects you to be comfortable there.
If you want an agent that orchestrates other agents, Aider is the wrong shelf. The direct comparison with its closest open-source neighbour is Cline vs Aider, and the wider field is covered in Codex vs Claude Code vs Cursor.
Common mistakes in a first week with Aider
- Adding the whole repository. The repo map already gives the model the lay of the land. Adding dozens of files bloats every request and dilutes the model’s attention. Add the files to edit; let the map handle the rest.
- Skipping
/tokensbefore a big ask. Context fills quietly. Checking usage first — and/drop-ing files you no longer need — prevents the degraded, forgetful answers that arrive near the limit. - Leaving the map at default on a huge codebase. A 1,000-token map is a summary of a summary on a large repo. Raise
--map-tokensfor architecture work; lower it again for focused edits. - Working on a dirty tree. Your uncommitted changes and Aider’s commits become hard to tell apart, and
/undoonly reverts Aider’s own commits. Commit your work first. - Never reading the diff. Auto-commit is a safety net, not a review substitute. The workflow only stays honest if a human reads what each commit contains.
Verdict: who Aider still suits
If you are git-fluent, model-agnostic and allergic to opaque tooling, Aider remains the most transparent tool in the category: a sharp editor that works with a model you chose and leaves a clean git history behind it.
If you want deep customisation, delegation and an ecosystem, the newer agents have genuinely moved past it — they have not just marketed past it, but they have not replaced the commit-per-edit discipline either.
Try it on one real repository for an afternoon. The install is five minutes, the software is free, and the git history will tell you plainly whether the workflow fits. For maintained version and model-support details, see the Aider tool profile.
FAQ
Is Aider free? Yes. The software is free and open source (Apache-2.0). You pay for the model: API keys at provider rates, or nothing per token with a local model via Ollama.
What is Aider’s repo map?
A compact summary of your codebase’s definitions and signatures, built with tree-sitter and ranked by relevance, sent with each request so the model knows what exists without reading every file. Its size is controlled by --map-tokens, and the default budget is 1,000 tokens.
What does architect mode do?
It splits the work between two models: a strong model plans, and a cheaper editor model applies the edits. You set them with --model and --editor-model alongside --architect. It cuts cost on large tasks where planning is the hard part.
Does Aider work with local models?
Yes — through LiteLLM it connects to Ollama and other local endpoints (--model ollama/<model>). Expect the usual local limits: strong for single-file work, weaker on long multi-step tasks.
How is Aider different from Claude Code? Aider is model-agnostic and commits every edit to git automatically; Claude Code is tied to Anthropic’s models and offers a deeper system of instruction files, skills, hooks and subagents. Aider is the lighter, more transparent tool; Claude Code is the more capable platform.
Category: Claude Code & Context Engineering · Tags: #ai-coding #git #automation
Next step: this article is part of Claude Code guides, which covers the full topic from first setup to advanced use.