Aider

AI pair-programmer CLI · by aider.chat · official site

What it does

Aider is an open-source CLI tool that turns any large language model into a pair-programmer for your git repository. You describe a change in natural language, and Aider parses the request, reads relevant files, proposes edits, applies them to your working tree, and commits the result with an auto-generated message. It supports multiple models -- closed-source (OpenAI, Anthropic, Google) and local (Ollama, vLLM) -- and handles single-file or multi-file edits. The tool uses a high-level "architect" mode for planning and a "editor" mode for implementation, and it can automatically add files to the context based on your request.

Under the hood, Aider works by treating each LLM session as a conversation over the full repository context. It uses a map of your project's structure (repo map) to help the model understand which files exist and where to make changes. Edits are applied as unified diffs, and the tool will retry if the model produces invalid syntax or fails to follow the instruction. All changes are staged and committed, making it easy to review or roll back.

Who it's for

Aider is for developers who live in the terminal and want AI assistance without leaving their existing workflow. It targets people who already use git religiously and prefer git diff over a visual diff viewer. It's well-suited for:

It is less suitable for beginner programmers who need hand-holding or for projects that require heavy visual feedback (e.g., UI layout design, data visualization).

What works

Aider's strongest feature is its git integration. Every session generates a clean commit chain: each AI modification is captured in a distinct commit with a meaningful message that includes the original prompt. This makes reviewing changes trivial -- you can cherry-pick, squash, or revert individual AI steps.

The tool handles common coding tasks reliably: adding functions, renaming symbols, writing test cases (pytest, Jest), generating documentation strings, and fixing syntactic errors. Its "architect" mode produces a plan before editing, which helps avoid misinterpretation on complex multi-file requests.

Support for local models via Ollama is mature. With a sufficiently large local model (e.g., 70B parameters), you can get adequate code generation without sending data to a third party. The tool also caches repository maps to speed up future sessions.

Performance is acceptable: model inference time dominates the latency, not Aider itself. For typical single-file edits, response time is comparable to direct API calls.

What breaks

Aider is not a magic bullet. Its biggest limitation is context management. Even with the repo map, large projects (100k+ lines) can overwhelm the model's context window. The tool truncates output intelligently, but you will lose nuance on sprawling codebases. This leads to hallucinations: the model may reference non-existent functions, use incorrect imports, or forget to update related files.

Vague or ambiguous prompts produce chaotic edits. If you say "optimize this function," the model will likely rewrite it without respecting your local conventions or performance constraints. The tool provides no sandboxing -- it directly modifies your working tree. A bad prompt can mess up multiple files before you notice. (Fortunately, git revert is still your safety net.)

Aider cannot execute or test code. It only generates text. So it will happily write tests that don't compile or introduce runtime errors. You must run linters, tests, and manual checks yourself. Multi-file changes that depend on cross-file logic are especially risky; the model may apply changes that are individually correct but collectively inconsistent.

Finally, pricing for API-based runs can still catch you off guard. A long conversation with GPT-4o or Claude Opus can cost several dollars per hour, even for small projects. The tool does not give a cost estimate before executing.

Pricing reality

Aider itself is completely free and open-source under the MIT license. You pay only for the LLM API tokens consumed. As of early 2026, typical per-million-token costs are:

Average simple edit might consume 1,000–5,000 total tokens, costing less than $0.10. A complex multi-file session that goes for 20+ turns could use hundreds of thousands of tokens and cost $1–$5. There is no subscription or metered plan for Aider itself. For exact provider pricing, check each API's latest rate card -- prices vary by region and rate tier.

Honest comparison

*Cursor* is a full IDE with deep AI integration. It offers inline suggestions, multi-line refactoring, and chat context. Cursor is easier for newcomers and has better visual feedback. Aider wins on portability (works in any terminal) and git-first approach.

*GitHub Copilot Chat* (CLI version) provides inline completions and chat. It is less autonomous -- it does not commit changes or plan multi-file edits. Aider is better for tasks that require the model to reason across the whole project.

*Sweep AI* is a more agentic alternative: it can create pull requests, run tests, and fix CI failures. Sweep is less manual but also less predictable. Aider gives you more control and direct editing.

*src (Sourcegraph Cody)* offers codebase-aware chat in the terminal but generally acts as a Q&A tool, not an editor. Aider focuses on making actual changes.

When to use

Use Aider when you want AI to make surgical, trackable modifications to an existing project. It shines for:

Avoid Aider for greenfield project creation, visual prototyping, or when you need automated testing and code execution. It's also not ideal for very large codebases where the model's context window is a hard limit.

Aider is a honest, capable tool for the developer who values precision, auditability, and terminal-tethered workflows. Use it as a power-up, not a replacement for your own judgment.

Last verified: 2026-06-08 by kernel.