How to Set Up Aider and Edit a Whole Repo From the Terminal

November 4, 2026

Aider is a free, open-source AI pair programmer that runs in your terminal. You start it inside a git repo, chat with it, and it writes edits directly into the files, committing each change to git so you can review or revert.

It is not an IDE plugin. There is no sidebar. That is the point — it works the same over SSH, in a container, on a 2015 laptop.

What does Aider change compared with an AI chat window?

A chat window gives you code you paste somewhere. Aider gives you a repository state.

It reads the files you add to the conversation, builds a map of the repo (function and class names, not full text), and edits. Then it commits with a message it writes. If the change is bad, git revert or /undo fixes it in seconds.

That commit-per-change behaviour is the main reason people keep using it after the novelty wears off.

How do you install Aider and get it running?

  1. pip install aider-chat (Python 3.9 or newer).
  2. Set a key: export ANTHROPIC_API_KEY=... or export OPENAI_API_KEY=....
  3. cd into a git repo. Run aider.
  4. Add files with /add path/to/file.py, or just start talking and use /add as you go.
  5. Type the request. It edits, runs any tests you ask for, and commits.

Windows users need a WSL terminal or the Docker image (paulgauthier/aider). Native PowerShell still has rough edges on file paths.

Which model should you run in Aider?

Anything with a decent context window and strong tool use. As of 2026 the popular picks are Claude Sonnet 5, GPT-5-class models, and DeepSeek for budget work.

Two settings matter:

  • Main model does the editing. Use the strongest one you can afford.
  • Weak model handles summaries and commit messages. A cheap model here cuts cost a lot with no quality loss.

Run aider --model deepseek/deepseek-chat --weak-model deepseek/deepseek-chat for a cheap setup, or --model sonnet when accuracy matters more than the bill.

A 200-line change on a mid-tier model costs a few cents. On a top-tier model, expect roughly 5-15 cents.

How much of a large repo can it actually handle?

Less than the marketing suggests. Aider’s repo map is clever — it summarises structure instead of dumping every file — but it still hits context limits around a few hundred files.

Practical rules:

  • Add only the files relevant to the change. /add is cheap, context is not.
  • Use /tokens to see current usage. If you are past 60% before you have typed anything, remove files.
  • For a monorepo, run Aider from the subpackage directory, not the root.

If your task needs deep understanding of 50 files, that is a review job, not an Aider job.

What are the commands you will actually use?

Command What it does
/add file Add file to the chat context
/drop file Remove it again
/run pytest -q Run a command and feed output back to the model
/undo Revert the last commit
/diff Show pending changes
/architect Plan first, then edit with a second model

/architect mode is worth trying on anything bigger than a single function. The model designs, then a second pass implements. It costs more tokens and produces fewer blind alleys.

If you want an editor with an agent bolted on instead, Builder.io covers the visual side of things. Different workflow, same goal.

Is Aider good for production code?

Only with a test suite. Aider will happily commit code that passes nothing because nobody ran anything.

Wire /run into your loop, or add --auto-test with a lint command in .aider.conf.yml. Treat the git commits as a review queue, not as accepted work. Read them the way you would read a junior developer’s pull request.

People who skip that step get 40 commits of plausible-looking code and a broken build.

Quick Summary

  • Aider is free and open source; install with pip install aider-chat and run inside a git repo.
  • Every change is a git commit, so review is git log and rollback is git revert.
  • Use a strong model for edits and a cheap one for the weak model to keep costs at cents per change.
  • Context is the real limit, not file count. Keep /tokens under 60% before you start.
  • Without a test runner wired in, expect plausible code that does not actually work.
Tags: