Back to terminal directory

AI coding agents · AI coding

Aider

Git-native terminal pair programmer that works with your own API keys.

Open sourcePython
Official site
Short answer

Aider is a free, open-source AI pair programmer that runs in your terminal. You start it in a git repository, add the files you want changed, and describe the change in plain language. Aider sends a map of your codebase plus those files to the model you choose, applies the edits, and commits each change to git with a descriptive message so you can review or undo it. It works with OpenAI, Anthropic, Gemini, DeepSeek, OpenRouter and many other providers, and with local models through Ollama or LM Studio. The tool costs nothing. You pay your model provider for the tokens it uses.

License
Apache 2.0
GitHub, Aider-AI/aider
Created by
Paul Gauthier, first release 2023
GitHub
Top score on Aider's polyglot benchmark
88% (GPT-5, high reasoning)
aider.chat leaderboards
Cost of the tool
Free. You pay for model tokens
aider.chat

Updated October 21, 2026How we evaluate tools

Aider guide: install, models, git workflow and costs

Aider is one of the oldest AI coding agents still in wide use. Paul Gauthier released it in 2023, before most of the big labs had their own terminal tools, and it has stayed independent and open source under the Apache 2.0 license. The repository has close to 50,000 GitHub stars.

Its design has two ideas at the center. The first is that git is the safety net: every change Aider makes becomes a commit you can inspect or undo. The second is that you decide which files the model sees. That keeps costs predictable and makes Aider a good fit for people who want a capable assistant without handing a whole repository to an autonomous agent.

How Aider works

You start Aider in a git repository and add the files you want to work on, either on the command line (aider app.py tests/test_app.py) or inside the session with /add. Then you describe the change.

Aider sends the model three things: your request, the full contents of the files you added, and a repository map. The map is a compact summary of the rest of the codebase: the important classes, functions and their signatures. Aider builds it by parsing your code and ranking symbols with a graph algorithm, so the most referenced parts of the code make the cut. The default budget for the map is about 1,000 tokens, adjustable with --map-tokens. The map lets the model understand how your files relate to the rest of the project without paying to send everything.

The model replies with edits in one of several formats, such as search-and-replace blocks or unified diffs. Aider applies them to your files and commits the result. If you have configured a linter or test command, Aider can run it after each change and send failures back to the model to fix.

Installing Aider

Aider is a Python program. The project recommends its own installer, which puts Aider in an isolated environment:

MethodCommand
Recommendedpython -m pip install aider-install then aider-install
uvuv tool install --python python3.12 aider-chat
pipxpipx install aider-chat
Dockerdocker pull paulgauthier/aider

Then give it a key for your model provider and start it inside a repository:

cd my-project
aider --model sonnet --api-key anthropic=sk-...

You can store keys and default options in a .env file or a .aider.conf.yml file in your home directory or project, so you do not need to pass them each time.

Connecting a model

Aider supports most hosted providers and local servers. The documented list includes OpenAI, Anthropic, Gemini, Groq, xAI, Azure, Cohere, DeepSeek, OpenRouter, Amazon Bedrock, Google Vertex AI, GitHub Copilot, Ollama and LM Studio, plus any endpoint that speaks the OpenAI API format.

Aider keeps its own polyglot benchmark: 225 of the hardest Exercism exercises in C++, Go, Java, JavaScript, Python and Rust. It measures how often a model solves the exercise and how often it produces edits in the right format. On the last published leaderboard, GPT-5 with high reasoning effort led at 88%, at a cost of about $29 for the full run. Frontier models from Anthropic, Google and DeepSeek scored in the same range, with DeepSeek's models costing a small fraction of the others. The board had not been updated for several months at the time of writing, so treat it as a guide to relative strengths and costs, and check newer models yourself.

A common setup pairs a strong reasoning model as the "architect" with a cheaper model as the "editor", using Aider's architect mode described below.

Chat modes

Aider has four modes, switched with slash commands:

  • code (default): the model edits files to make the change you asked for.
  • architect: one model plans the change and a second model turns the plan into file edits. This often improves results on hard tasks, and lets you use an expensive model for thinking and a cheaper one for editing.
  • ask: the model answers questions about the code without editing anything. Useful for learning a new codebase before changing it.
  • help: answers questions about Aider itself.

You can prefix a single message with /ask or /architect without switching modes for the whole session.

Git as the undo button

Aider's git workflow is what sets it apart from many newer agents.

  • Before editing, Aider commits any uncommitted changes in the files involved, so your work and the model's work stay in separate commits.
  • After each edit, it commits with a message written in the Conventional Commits style, and marks itself in the author name with "(aider)".
  • /diff shows what changed since your last message. /undo reverts the last Aider commit. /commit commits outstanding edits, and /git runs any git command.

This makes it cheap to experiment. If a change goes wrong, /undo and try a different instruction. You can turn auto-commits off with --no-auto-commits, or ask Aider not to touch git at all with --no-git.

Other features

Watch mode. Run Aider with --watch-files and it watches your project for comments ending in AI! or AI?. Write a comment such as # add input validation AI! in your editor, save, and Aider makes the change. This lets you use it from any IDE without a plugin.

Voice. /voice records speech and transcribes it into a request.

Images and web pages. You can add screenshots and images to the chat for models that accept them, and /web fetches a page and adds it as context, which helps when you point the model at documentation.

Lint and test. --lint-cmd and --test-cmd tell Aider how to check its work, and --auto-test runs the tests after every change.

Scripting. aider --message "..." file.py runs a single instruction and exits, so you can call Aider from shell scripts.

Costs in practice

Your bill depends on three things: the model's price per token, how many files you add, and the size of the repository map. Aider prints the token count and cost after each message, and /tokens shows what is in the current context.

Ways to keep costs down:

  1. Add only the files the change needs, and drop them with /drop when you are done.
  2. Use a cheaper model for routine edits and switch with /model for hard problems.
  3. Use architect mode with a cheap editor model.
  4. Enable prompt caching with --cache-prompts on providers that support it, such as Anthropic and DeepSeek.

Limits and risks

You manage context. Aider does not explore a codebase on its own the way Claude Code or Codex CLI do. If you forget to add a file the change depends on, the model may guess. The repository map helps, and Aider will ask to add files the model mentions, but you stay in charge of what the model sees.

Model quality varies. Small local models can produce malformed edits. Aider's leaderboard reports edit-format accuracy separately for this reason.

Commands are limited. Aider can run shell commands you approve, along with your lint and test commands, but it is less oriented to long autonomous loops than newer agents. Some people see that as a feature.

Privacy depends on the provider. Aider itself collects no analytics unless you opt in. Your code goes to whichever model provider you configure, under that provider's terms.

Aider compared with other terminal agents

ToolModelsLicenseHow it handles context
AiderAlmost any provider or localApache 2.0You add files, plus a repo map
Claude CodeClaude onlyProprietaryExplores the repo itself
Codex CLIOpenAI modelsApache 2.0Explores the repo itself, sandboxed
OpenCode75+ providersMITExplores the repo itself
PiMany providersMITMinimal tools, you extend it

Choose Aider if you want to pick your own model, keep a clean git history of every AI change, and control costs by choosing what the model reads. Choose Claude Code or Codex CLI if you want an agent that works through a task with less direction. For local models, pair Aider with Ollama. For more tools, see the terminal tools guide.

Frequently asked questions

Is Aider free?

The software is free and open source under the Apache 2.0 license. Running it costs whatever your model provider charges for the tokens Aider sends and receives. Light use with an efficient model can cost a few cents per task. Long sessions with a top model on a large repository cost more. If you run a local model through Ollama or LM Studio, the only cost is your own hardware and electricity.

How do I install Aider?

Aider's recommended method is python -m pip install aider-install followed by aider-install. That sets up Aider in its own isolated Python environment so it does not conflict with other packages. You can also install it with uv, pipx or Docker. Then set an API key for your provider, for example with --api-key anthropic=your-key, change into a git repository and run aider.

Which model works best with Aider?

Aider publishes its own leaderboard based on 225 hard coding exercises in six languages. On its last published results, GPT-5 with high reasoning scored 88% and other frontier models from OpenAI, Anthropic, Google and DeepSeek scored close behind, with large differences in cost per run. DeepSeek models score well for a fraction of the price. Check the leaderboard date before relying on it, because new models appear faster than the board is updated.

Does Aider commit changes automatically?

Yes, by default. Each time Aider edits files it makes a git commit with a descriptive message, and it commits any uncommitted changes you had first so your work and its work stay separate. You can review commits with the /diff command and roll back the last one with /undo. Turn auto-commits off with --no-auto-commits if you prefer to commit by hand.

Can Aider run local models?

Yes. Aider connects to Ollama, LM Studio and any server that offers an OpenAI-compatible API. Local models keep your code on your machine, but smaller models make more editing mistakes. Aider's documentation notes that a model needs to follow its edit formats reliably, so test a local model on a small task before trusting it with a large change.

How is Aider different from Claude Code or Codex CLI?

Aider works with almost any model provider, while Claude Code runs only Claude models and Codex CLI is built around OpenAI's models. Aider also uses git as its undo system and asks you to choose which files are in the conversation, which keeps token use predictable. Claude Code and Codex CLI explore the repository on their own, run commands in loops and offer richer permission and sandbox controls.

Sources

  1. Aider documentation
  2. Aider installation guide
  3. Aider git integration
  4. Aider repository map
  5. Aider LLM leaderboards
  6. Aider chat modes
  7. Aider on GitHub