Open-source AI pair programmer in your terminal · edits your files & auto-commits to Git · bring your own LLM key · 100+ languages · macOS / Windows / Linux
Aider turns your terminal into an AI coding session. You point it at one or more files, describe a change in plain English, and it edits those files and immediately commits the change to Git with a descriptive message — so every AI edit is a clean, reversible commit and nothing is silently overwritten. It is free and open-source (Apache 2.0); you pay only your chosen LLM's token cost (bring your own key). Terminal-only — there is no GUI, so basic command-line confidence helps.
1 · Start a session on a file
# needs an LLM API key (here, Claude Sonnet)
aider --model sonnet analysis.py
2 · Type a request in plain English
Read data.csv and print the mean ± SD for every numeric column.
Aider writes analysis.py, prints the diff, then auto-commits the change to Git with a sensible message — the change is saved and reversible from the very first edit. Aider itself is free; you only pay the model's per-token cost.
| Command | What it does |
|---|---|
aider --model sonnet file.py | Start a session with a chosen model on one or more files |
/add | Add files to the chat so aider can edit them |
/drop | Remove files from the chat to free up context space |
/read-only | Add files for reference only (or make added files read-only) |
/ask | Ask questions about the code base without editing any files |
/code | Ask for changes to your code |
/architect | Enter architect/editor mode using 2 different models |
/undo | Undo the last git commit if it was done by aider |
/diff | Display the diff of changes since the last message |
/lint | Lint and fix in-chat files (or all dirty files) |
/test | Run a shell command, add output to the chat on non-zero exit |
/run | Run a shell command and optionally add the output to the chat |
/tokens | Report tokens used by the current chat context (live spend) |
/model | Switch the main model to a new LLM |
/models | Search the list of available models |
/web | Scrape a web page, convert to markdown, send it in a message |
/voice | Record and transcribe voice input |
/paste | Paste an image / text from the clipboard into the chat |
/map | Print out the current repository map |
/clear | Clear the chat history |
/reset | Drop all files and clear the chat history |
/commit | Commit edits to the repo made outside the chat |
/help | Ask questions about aider |
Add files & context
# start on several files at once aider --model sonnet analysis.py helpers.py # or add / drop during the session /add utils.py /read-only schema.sql /web https://example.com/api-docs /paste # image or text from clipboard
Aider maps your codebase (/map), so the model reasons about callers and definitions in files it isn't directly editing — no need to paste every file in.
Chat modes
code | Default — makes changes to your code edits |
ask | Discuss code, answer questions, never changes files |
architect | An architect model proposes, an editor model applies edits |
help | Answers questions about aider itself |
/ask · /code · /architect · /help switch for one message; /chat-mode <mode> switches persistently; or launch with --chat-mode <mode> (--architect is a shortcut). The prompt shows the mode, e.g. ask>.
aider --model sonnet # Claude Sonnet (frontier) aider --model o3 / o4-mini # OpenAI reasoning models aider --model gpt-4.1 # OpenAI GPT-4.1 aider --model gemini-2.5-pro # Google Gemini 2.5 Pro aider --model deepseek # DeepSeek R1 / V3 (cheaper)
Aider works with virtually any LLM, and can run free local models via Ollama for zero token cost on routine edits. Consult Aider's public polyglot leaderboard (225 Exercism exercises across C++, Go, Java, JavaScript, Python and Rust) — it reports each model's success rate alongside its cost, so you can pick a cheaper model that still does the job. Switch live with /model.
| What | Cost |
|---|---|
| Aider itself | Free & open-source (Apache 2.0) — no subscription, no lock-in |
| Your LLM tokens | You pay your model provider per token — cost depends on the model you pick (a frontier model like Claude Sonnet costs more; a small or local model costs little to nothing) |
| Local models via Ollama | $0 token cost |
/undo & lint/test passes | Free — /undo is a Git revert; lint/test run locally on your machine |
You bring your own LLM API key and pay the provider directly. Aider reports the token count and dollar cost of each interaction in the terminal — use /tokens to see the running total for the current context, so you can watch spend live whatever model you choose.
Every edit is a Git commit — so /undo cleanly reverts the last AI commit and every experiment is safe to try; keep changes small so each commit is easy to review. It's a code editor, not a writing tool — less useful for lab reports or literature reviews. Cost is real — a heavy session on a frontier model adds up, so pick an economical model from the leaderboard for routine work and keep image / web-page context focused (larger context = more tokens per request). Windows: WSL2 gives the smoothest experience.