Playbooks Workflow Jun 07, 2026

Aider: AI Pair-Programming in Your Terminal With a Local Model

A coding agent that reads your repo, edits files, runs commands, and commits with clean messages, all from a chat prompt in your terminal and answered by a model on your own machine. Here is the exact setup we run.

Aider: AI Pair-Programming in Your Terminal With a Local Model

Some AI tools suggest code. Aider edits it. Open it inside a git repository, tell it what you want, and it reads the relevant files, proposes a diff, asks for your approval, applies the change, and commits with a clean, descriptive message. It is the mature, terminal-first answer to “I want an AI to actually work on my code, not just hint at it.”

Aider is also model-agnostic, which is the part that matters here. It works with cloud models, but it works just as happily with a model running on your own machine. Point it at a local model and you get an autonomous-feeling pair programmer with no API bill and no code leaving your laptop. We use this setup for refactoring, scripting, building small tools, and (yes) maintaining the Atlas these articles draw from. Here is how to run it.

What you will end up with

  • Ollama serving a capable coding model locally.
  • Aider installed and running in your terminal.
  • A git-aware agent that edits your repo and commits its work, answered by a model on your disk.

No API keys. No per-token cost. No code round-tripping to anyone.

Before you start

You need three things. First, comfort in a terminal: Aider lives there by design. Second, git, because Aider is built around a git repo and expects one. Third, a local LLM backend, which Step 1 covers.

You also want to set expectations on the model. Model choice matters a lot for an agent that writes real edits. A weak model produces bad changes you then have to clean up. For local work, a strong coder model is the floor, not a nicety. More on that in the gotchas.

Step 1: Install Ollama and pull a strong coding model

Ollama serves the model. On a Mac:

brew install ollama

On Windows: winget install Ollama.Ollama. On Linux: curl -fsSL https://ollama.com/install.sh | sh. Or take the installer from https://ollama.com/download. Ollama runs as a background service on http://localhost:11434.

For an agent that writes edits, reach for a strong coder model rather than a small one:

ollama pull qwen2.5-coder:32b

That is a large model. It wants real RAM (32GB or more is the comfortable zone). If your machine cannot hold it, a 7B coder model still works for smaller, well-scoped tasks; just expect to review its edits more closely. Browse tags at https://ollama.com/library. Confirm what you have:

ollama list

Step 2: Install Aider

The cleanest install is in a Python virtual environment. On a Mac or Linux:

python3 -m venv aider-env
source aider-env/bin/activate
pip install aider-chat

On Windows, the activate step differs:

python -m venv aider-env
aider-env\Scripts\activate
pip install aider-chat

If you would rather have Aider available everywhere without activating a venv, install it with pipx instead:

brew install pipx
pipx install aider-chat

Step 3: Launch Aider against your local model

Move into a git repo and start Aider with the local model. The model name uses Ollama’s prefix:

cd ~/my-project
aider --model ollama_chat/qwen2.5-coder:32b

If you launched bare with just aider, it falls back to a cloud default that expects an API key, so always pass the --model flag for local work. No environment variable is needed for the local path; the flag is the whole story.

Aider opens a chat prompt. From here you talk to it.

Step 4: Prove it works

At the prompt, give it a small, concrete task:

> Add a function to utils.py that takes a list and returns the sum.

Aider reads the file, proposes a diff, and asks you to confirm. Look at the diff. Confirm it. Aider applies the edit and commits to git with a descriptive message. Check the result:

> /git log

The first commit message Aider writes is the moment the mental model clicks: clean, descriptive, conventional. It did not just suggest code; it read your repo, made the edit, and recorded it with reasoning.

Then iterate to prove it holds context:

> Also add a test for that function.

A handful of slash commands run the rest of the workflow:

  • /add path/to/file.py adds a file to the context explicitly.
  • /drop path/to/file.py removes one when context gets crowded.
  • /architect switches to planning mode, which thinks through a change without editing.
  • /code switches back to executing the plan.
  • /run pytest runs a shell command.
  • /help lists everything.

The architect and code split

The single habit worth forming: use /architect before /code on anything non-trivial. Architect mode plans the change in plain terms without touching files. Code mode then executes that plan. The separation forces clearer thinking about what is about to happen, and it gives you a checkpoint to redirect before any edit lands. On a local model especially, where you are reviewing edits more carefully anyway, planning first saves cleanup later.

Gotchas

  • Aider expects a git repo. It will offer to init one if you are not in a repo, but the whole experience is designed around git. Start inside one.
  • Model choice makes or breaks it. Weak models produce bad edits. Use a 32B-class coder model locally if you can hold it; below that, scope tasks tightly and review every diff.
  • Context fills up. Aider sends only the files it thinks are relevant, but large codebases still hit the model’s context limit. Use /drop to clear files you are done with.
  • Commits happen automatically by default. Handy for review via git log, occasionally surprising. Disable it with --no-auto-commits if you would rather stage changes yourself.
  • Watch the diff before you confirm. Aider proposes and you accept. Do not blindly approve a large change; the approval step is the safety, so use it.

The honest trade-off with going local is the same one that runs through all of this: the model is the ceiling. A local coder model is strong enough for refactors, fixes, tests, and small builds, and it costs nothing per token. For the genuinely hardest problems, the best cloud models are still ahead, and Aider makes switching trivial, the same --model flag pointed at a cloud provider for one job. Even there, Aider’s careful habit of sending only relevant files keeps cloud costs reasonable. For sustained heavy use, point it at the local model and pay nothing at all.

Where to go next

You now have the whole local AI coding loop. Aider reuses the same Ollama backend as an editor assistant and a chat UI, so the model you pulled here is the model those tools use too. The natural companion is in-editor completion for the moment-to-moment typing, with Aider reserved for repo-wide changes that deserve a plan and a commit. That editor setup is its own Playbook.

You have an AI pair programmer in your terminal that reads your repo, edits it, and commits its work, answered by a model on your own machine, with no subscription and no code leaving your laptop. Curious about these things. You should be too.

Harness your curiosity.

— Stridenote · № 005