Before chat-based agents took over, there was Aider: an open-source AI pair programmer that lives in your terminal and treats git as a first-class citizen. Aider edits your files and automatically commits every change with a descriptive message, so the AI’s work shows up in your history as clean, reviewable, reversible commits. It connects to almost any large language model — cloud or local — and has quietly become the tool many Linux developers reach for first. This Aider tutorial covers installation, the git workflow, chat modes, and the settings that make it effective.
What Is Aider? – Aider Tutorial
Aider is a command-line pair programming tool written in Python and released under the Apache 2.0 license. You start it inside a git repository, tell it which files a task involves, and chat: “add a retry to the HTTP client”, “refactor this function to use the new logger”, “write a test for the edge case we just discussed”. Aider edits the files directly and commits the result.
Three design choices set it apart. First, it is git-native: every change becomes a commit with a sensible message, so git diff, git blame, and git reset all work as your review and undo mechanisms. Second, it builds a repository map — a concise, tree-sitter-based index of your codebase’s classes, functions, and signatures — so it understands large projects without stuffing every file into the context window. Third, it is model-agnostic: Aider works with OpenAI, Anthropic, Gemini, DeepSeek, and many other providers, and can even drive local models through Ollama.
Install Aider on Linux – Aider Tutorial
The official installer sets Aider up in its own isolated Python environment, which avoids the classic pip dependency mess:
python -m pip install aider-install
aider-install
If you already use uv or pipx, those work just as well:
uv tool install aider-chat
# or
pipx install aider-chat
Now move into a repository, provide a model API key, and start a session. Model aliases keep the flags short:
cd ~/projects/my-app
export ANTHROPIC_API_KEY="your-key"
aider --model sonnet
# or, with OpenAI
aider --model gpt-4o
Aider also reads keys from a .env file and stores persistent preferences in .aider.conf.yml, so your usual model and options do not need re-typing every session.

The Aider Workflow: Files, Chat Modes and Commits
The core loop is simple. You add the files a task touches to the chat, then describe the change:
/add src/api/client.py tests/test_client.py
Add exponential backoff to the retry logic in client.py,
and extend the tests to cover a 503 response.
Aider edits only the files in the chat (plus anything it asks to add), applies the change, and commits it. Use /drop to remove files and keep the context lean. Four chat modes shape how it behaves:
- Code mode (default): makes the edits you ask for.
- Ask mode: answers questions about the code without changing anything — ideal for exploring an unfamiliar repo.
- Architect mode: a strong reasoning model plans the change first, then an editor model applies it. Excellent for multi-file refactors.
- Help mode: answers questions about Aider itself.
Switch with /chat-mode or launch flags such as aider --architect. Aider can also watch your editor: with --watch-files running, you write AI! in a code comment and Aider implements it, or AI? to ask a question inline. Pair that with automatic linting and testing — --lint-cmd and --test-cmd with --auto-test — and Aider will fix the problems its own changes create, in the same session.
Aider is also scriptable. Anything you can do interactively can run non-interactively with aider --message "your instruction", which makes it handy in shell scripts and CI jobs: draft a changelog from recent commits, apply a mechanical refactor across a branch, or generate boilerplate for a new module. You can also paste images and web pages into the chat, so a screenshot of a UI bug or a page of documentation gives the model exactly the context you are looking at.
Tips for Better Results with Aider
Keep the chat focused: a handful of relevant files beats half the repository, even with the repo map helping. Commit your own work before starting, so Aider’s commits stay separate and easy to revert. Use ask mode liberally at the start of a task — five minutes of questions saves a bad refactor. For repetitive work, save your flags in .aider.conf.yml and record conventions in a read-only conventions file you add to every session. Finally, treat Aider’s commits like a colleague’s pull requests: read the diff before you build on top of it.
Aider also pairs nicely with the AI workflows elsewhere on this site, such as AI code review for Terraform and Ansible in CI pipelines: Aider writes the change locally, and an automated reviewer gives you a second opinion before it merges.
Conclusion
Aider remains one of the most practical AI coding tools for terminal users: free and open source, model-agnostic, and built around the git workflow you already trust. If you want an agent whose every move is a commit you can inspect and undo, install it and run your first session today. The official Aider website and documentation has full installation options, model comparisons, and configuration references.