How to Use Aider: Atomic Git Commits & Architect Mode (2026 Guide)
Aider is a terminal-based AI pair programmer that edits code directly in your local Git repository. While Cursor, Windsurf, and Cline live inside an editor, and Claude Code and Warp ship as their own terminal experiences, Aider is the small, fast, vendor-agnostic CLI that turns any shell — Vim over SSH, tmux on a build server, the iPad Terminus app — into a pair-programming session. It supports OpenAI's GPT-5 family, Anthropic's Claude 4.x and 4.6 series, Google's Gemini 2.5 Pro, DeepSeek V3.2 and R1, xAI Grok 4, Ollama, and dozens of other providers. Every change Aider makes is an atomic Git commit with a descriptive message — and that single design decision is what makes it pair so cleanly with DeployHQ's automated Git deployments.
This guide walks through installing Aider in 2026, configuring it for serious deployment work, and using its signature features — atomic commits, architect/editor mode, watch mode with AI! and AI? comments, prompt caching, and /web /voice /paste integrations — alongside DeployHQ to turn AI-assisted coding into a clean Git-to-production pipeline.
Why Aider Matters for Web Developers in 2026
Most AI coding tools are tied to a specific editor. That is fine until you're SSH'd into a Linode box trying to fix a config drift issue, pairing with a colleague in Neovim, or wiring AI-assisted refactors into a CI step that doesn't have a graphical environment at all. Aider sidesteps every one of those constraints by doing its work in plain stdin/stdout against your local filesystem.
Four properties set it apart in the 2026 AI coding landscape:
- Editor-agnostic by design: Aider does not care whether you use VS Code, JetBrains, Vim, Emacs, or a basic terminal over SSH. It modifies files on disk and commits to Git; your editor picks up the changes through normal file-watching. Pair it with JetBrains tooling on one screen and a Vim split on another and the workflow stays identical.
- LLM-agnostic: Aider's leaderboard tracks 70+ models. You can run GPT-5 (high reasoning) for the hardest refactors, switch mid-session to a much cheaper editor model with
/model, or point everything at a local DeepSeek-Coder via Ollama for offline work. Mid-session model swaps are a single slash command away. - Git-native, not Git-adjacent: every change is one atomic commit with a written-by-the-LLM commit message. No more bundled "wip: a bunch of stuff" commits — your
git log --onelinereads like a changelog. - Open source and self-hostable: Aider is Apache 2.0 (
github.com/Aider-AI/aider) and writes a measurable share of its own code each release — recent releases credit upstream Aider for 62-88% of the diff. There is no proprietary backend; the only network calls are to the LLM providers you configure.
That last point — the atomic-commit design — is the lever that pairs Aider with deployment automation. Because every AI change is already a clean commit, a continuous deployment platform can pick up exactly what changed, when, and why, with no manual staging or commit-message clean-up. The result is a code-to-production loop where "describe the change" and "deployed in production" are separated by git push and a green build.
Step 1: System Requirements
Aider is small, but it has a few hard prerequisites.
- Python 3.9 to 3.13 — most modern OSes ship something compatible. Aider does not yet support Python 3.14.
- Git installed and configured with your name and email (Aider commits in your identity unless you explicitly enable
--attribute-author). - An LLM API key for at least one provider, or a locally-running model (Ollama, LM Studio, or a self-hosted vLLM/TGI endpoint).
- A working repository. Aider operates inside a Git repo. If you point it at a non-Git directory, it offers to
git initfor you, or you can disable Git integration entirely with--no-git.
Verify Python first:
python3 --version
# Python 3.11.9 (or any 3.9-3.13)
On macOS the system Python is often outdated — brew install python or pyenv install 3.12 resolves it. On Windows, install from python.org or use winget install Python.Python.3.12.
Check your Git identity:
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
If you plan to run a local model, also budget GPU/RAM for the model size. A 7B coding model fits comfortably in 16 GB; 32B Qwen3-Coder or DeepSeek-Coder-V2 wants 32-48 GB.
Step 2: Install Aider
The Aider team's current recommendation is the aider-install bootstrap, which handles Python isolation for you. There are five viable methods — pick the one that matches your stack.
Option A: aider-install (recommended in 2026)
aider-install is the official one-liner. It downloads a tiny installer that uses uv under the hood to set up Aider in an isolated Python environment, regardless of your system Python:
python -m pip install aider-install
aider-install
The installer prints the install path; if it isn't on $PATH, it tells you the line to add to your shell profile.
Option B: One-liner script (curl / PowerShell)
For a no-Python-prereq install:
# macOS / Linux
curl -LsSf https://aider.chat/install.sh | sh
# Windows (PowerShell)
powershell -ExecutionPolicy ByPass -c "irm https://aider.chat/install.ps1 | iex"
Both scripts install uv if needed and then put a self-contained aider binary on your $PATH.
Option C: uv (Astral's fast Python tool manager)
If you already use uv:
uv tool install --python python3.12 aider-chat@latest
uv tool install keeps Aider isolated from your system packages and lets you uv tool upgrade aider-chat cleanly.
Option D: pipx
pipx is the older isolated-CLI manager. It still works:
pipx install aider-chat
If you don't have pipx:
# macOS
brew install pipx && pipx ensurepath
# Linux / WSL
python3 -m pip install --user pipx && python3 -m pipx ensurepath
Option E: Homebrew
brew install aider
Convenient, but the Homebrew formula sometimes lags upstream by 1-2 weeks. If you need a recent feature (watch mode improvements, GPT-5 reasoning support, new model defaults), prefer aider-install or uv.
Verify the installation
aider --version
You should see something like aider 0.86.1 or higher. If aider is not found, the install path isn't on $PATH — re-run the bootstrapper or source ~/.bashrc.
Step 3: Configure Your AI Model
Aider authenticates to LLM providers through environment variables. The 2026 landscape:
OpenAI (GPT-5 family — current leaderboard leader)
export OPENAI_API_KEY=sk-proj-...
aider --model gpt-5
# or for the Aider-recommended high-reasoning variant:
aider --model gpt-5 --reasoning-effort high
GPT-5 (high) sits at the top of Aider's polyglot leaderboard at 88.0% on the 225-exercise benchmark. The medium variant at 86.7% costs roughly 40% less per run.
Anthropic (Claude Sonnet / Opus 4.x)
export ANTHROPIC_API_KEY=sk-ant-...
aider --model sonnet # Claude Sonnet (latest)
aider --model opus # Claude Opus (highest quality)
Aider ships short aliases (sonnet, opus, haiku) that always resolve to the latest version of each tier, so you don't have to chase model-name suffixes.
Google Gemini
export GEMINI_API_KEY=...
aider --model gemini/gemini-2.5-pro
Gemini 2.5 Pro with 32k thinking tokens benchmarks at 83.1% — within striking distance of the leaders at meaningfully lower cost.
DeepSeek (the value pick)
export DEEPSEEK_API_KEY=...
aider --model deepseek/deepseek-reasoner # V3.2 reasoning model
aider --model deepseek/deepseek-chat # V3.2 chat model
DeepSeek V3.2 Reasoner scores 74.2% on the polyglot benchmark at roughly $1.30 per benchmark run — over twenty times cheaper than the frontier models. For routine work, it's hard to beat.
xAI Grok
export XAI_API_KEY=...
aider --model xai/grok-4
Local models via Ollama or LM Studio
ollama pull qwen2.5-coder:32b
aider --model ollama/qwen2.5-coder:32b
Local models work well for boilerplate, refactors, and offline work. Anything that requires multi-file reasoning or precise diff-format adherence still benefits from a frontier model.
Persisting API keys
Avoid exporting keys in every shell. Either drop them in your shell profile:
# ~/.bashrc or ~/.zshrc
export OPENAI_API_KEY=sk-proj-...
export ANTHROPIC_API_KEY=sk-ant-...
export DEEPSEEK_API_KEY=...
Or use a .env in your project root (and add it to .gitignore):
OPENAI_API_KEY=sk-proj-...
ANTHROPIC_API_KEY=sk-ant-...
Aider auto-loads .env from the project root when it starts.
Step 4: Start Using Aider
Navigate to a Git repository and launch Aider:
cd ~/projects/my-webapp
aider
You'll get an interactive prompt. From here you can either type natural-language requests or use slash commands.
Adding files to the chat context
Aider deliberately does not dump your entire repo into the prompt. You add files explicitly:
aider src/app.py src/models/user.py tests/test_user.py
Or interactively during a session:
/add src/routes/auth.py
/add tests/test_auth.py
A practical heuristic: 1-3 files for a focused task, up to 6-8 for cross-cutting refactors. Use /read-only when you want a file in context but never modified:
/read-only src/types/database.ts
/read-only docs/architecture.md
The repo map (Step 5) gives Aider awareness of files you haven't added, so it can ask for them when needed.
Asking for changes
Describe the change in plain English. Be specific about acceptance criteria:
Add sliding-window rate limiting to the /api/login endpoint:
- 5 attempts per minute per IP address
- Return HTTP 429 with a Retry-After header on limit exceeded
- Use an in-memory store for now; we'll add Redis later
- Cover with a unit test in tests/test_auth.py
Aider proposes changes as a diff, applies them to your files, and commits with a descriptive message:
feat: Add sliding-window rate limiting to /api/login
Implements 5 attempts/min per IP with Retry-After header.
Adds test coverage for limit-exceeded path.
Reviewing and undoing
Because every change is a commit, your standard Git tools work:
git log --oneline -5 # see recent Aider commits
git diff HEAD~1 # what changed
git revert HEAD --no-edit # undo the last AI change cleanly
git reset --hard HEAD~1 # nuke the last commit (no revert record)
Inside Aider, /undo is the safe shortcut for "revert the last change." /diff shows the working-tree diff against the last commit.
Step 5: Core Features
Architect mode (the underrated lever)
Aider's most consequential feature for hard problems is the architect/editor pair: a strong reasoning model plans the change, and a fast/cheap editor model emits the actual file edits in Aider's diff format. This split exists because frontier models reason brilliantly but sometimes mangle structured diff output, while cheaper models are precise about diffs but weaker at planning.
# Recommended 2026 pair: GPT-5 architect + cheaper editor
aider --architect --model gpt-5 --editor-model gpt-5-mini
# Alternative: Claude Opus architect + Sonnet editor
aider --architect --model opus --editor-model sonnet
# Auto-accept architect plans (skip the per-step prompt)
aider --architect --auto-accept-architect
The two-pass approach measurably reduces errors on multi-file refactors compared to running a single model at high cost. The cost math is also favourable: architect-mode runs typically cost 30-50% less than the same task done by the architect model alone, because the editor model handles the bulk of the token-heavy diff emission.
Chat modes
Aider has three interaction modes you switch between mid-session:
/code— the default. Aider edits files directly in response to your requests./ask— ask questions about the codebase without making changes. Useful for "explain how the auth middleware works" or "what does this regex do."/architect— engage architect mode for the next prompt, even if you launched without--architect.
Use /chat-mode <mode> to set the default for the rest of the session.
Atomic auto-commits
By default, every Aider change is its own Git commit with a generated message:
git log --oneline -5
a3f1c2d feat: Add input validation to registration form
b7e4a1f refactor: Extract email parsing into utility module
c9d2e3a fix: Handle null case in user profile serialization
d1a5b7c feat: Add rate limiting middleware to auth routes
e8f3c4d test: Add unit tests for rate limiting logic
That's the signature feature people search for as "aider atomic commits" — the commit-per-change discipline turns AI-assisted work into a reviewable, revertable Git history rather than an opaque blob.
If you'd rather review before committing:
aider --no-auto-commits # apply changes, leave uncommitted
aider --attribute-author # tag commits as "aider (model-name)"
aider --commit-prompt "..." # custom message-generation prompt
The --attribute-author flag is worth turning on for teams: it sets the Git author to aider (claude-opus) or similar, so AI commits are visible in git blame and pull-request diffs without obscuring who prompted the change.
Slash commands (39 total in 2026)
The slash-command surface is wide. The ones you'll use daily:
| Command | Purpose |
|---|---|
/add <file> |
Add a file to chat context |
/drop <file> |
Remove a file from context |
/read-only <file> |
Add as immutable reference |
/ls |
List files in the session |
/ask <question> |
Switch to ask mode for one prompt |
/architect |
Switch to architect mode for one prompt |
/code |
Back to code mode |
/diff |
Show working-tree diff |
/undo |
Revert the last change (git revert) |
/clear |
Clear conversation history (keep files in context) |
/reset |
Clear everything, including files |
/tokens |
Show token usage and cost so far |
/model <name> |
Switch model mid-session |
/editor-model <name> |
Switch the editor model in architect mode |
/run <cmd> |
Run a shell command and share output with Aider |
/test <cmd> |
Run tests; on failure Aider tries to fix |
/lint <cmd> |
Run a linter; Aider fixes any issues |
/web <url> |
Scrape a URL and add the markdown as context |
/paste |
Paste clipboard contents (text or image) into chat |
/voice |
Dictate a prompt via Whisper |
/copy |
Copy the last LLM response to clipboard |
/copy-context |
Copy the entire chat context as markdown |
/load <file> |
Load a saved conversation/state |
/save <file> |
Save current state to a file |
/map |
Show the current repo map |
/map-refresh |
Force-rebuild the repo map |
/reasoning-effort <level> |
Set GPT-5/o1-style reasoning depth |
/think-tokens <n> |
Set Gemini/Anthropic thinking-token budget |
/ok |
Shortcut for "go ahead and apply the change" |
/help |
Full command list |
Two commands worth highlighting:
/web https://example.com/docs— scrapes a URL, converts to markdown, drops it into the chat context. Lifesaver for "implement against this third-party API spec" without manual copy-paste./paste— when you copy an image to your clipboard (a screenshot of a design mockup, an error screenshot, a stack trace photo),/pasteadds it to the chat for vision-capable models to reason over.
Voice coding
aider --voice
# or mid-session:
/voice
/voice records audio, transcribes it via OpenAI Whisper, and inserts the transcription as your prompt. Useful when you're describing complex changes while looking at code in a separate window — particularly on a laptop where typing 200-word prompts is friction.
Repo map
Aider auto-builds a structural map of your repository — file names, top-level functions and classes, signatures, import relationships — without sending the full content of every file. This map is what lets Aider make sensible suggestions about files you haven't explicitly added with /add.
You control the map's token budget:
aider --map-tokens 2048 # more detail, more tokens
aider --map-tokens 512 # leaner map, less context
aider --map-tokens 0 # disable the map entirely
A larger map is helpful for novel codebases; once you know your project's shape, lower it to save tokens. /map prints the current map; /map-refresh rebuilds it after a large refactor.
Watch mode and AI comments (AI!, AI?)
Watch mode is one of Aider's quietly powerful 2026 features. Run Aider in the background:
aider --watch-files
Then, in any file in the repo, drop an inline comment ending in AI! (do it) or AI? (answer it):
def calculate_tax(price, rate): # add input validation, raise on negative values. AI!
return price * rate
Save the file. Aider detects the marker, reads the surrounding context, makes the change (or answers the question), commits it, and clears the marker. You stay in your editor; Aider works in the background.
Comment markers work across syntaxes — # for Python/Bash, // for JS/TS/Java/Go, -- for SQL, <!-- for HTML/Markdown. Plain AI (no ! or ?) marks a multi-line instruction without triggering action, so you can compose long prompts inline.
This is the closest Aider gets to the AI?/AI!-style comment workflow of editor-bound agents — but it's still your editor, your terminal, and your Git repo doing the work.
Prompt caching (cost cutter for Anthropic and DeepSeek)
If you're hitting Claude Sonnet/Haiku or DeepSeek Chat repeatedly within a session, enable prompt caching:
aider --cache-prompts --cache-keepalive-pings 12
Aider organises chat history so the system prompt, repo map, read-only files, and editable file content can be cached on the provider side. Anthropic's cache TTL is 5 minutes by default; --cache-keepalive-pings N sends a ping every 5 minutes so the cache stays alive for N × 5 minutes after each message. Combined cost savings on long sessions are typically 30-70%.
Note: caching stats only print when streaming is off (--no-stream).
Aider auto-commits every change to Git with a descriptive message. DeployHQ auto-deploys every push — building, testing, and shipping to your servers via SSH, SFTP, S3, or your cloud provider of choice. Together they create a code-to-production pipeline where AI-generated changes hit production in seconds. Sign up free at the end of this guide.
Step 6: Advanced Features
Configuration: .aider.conf.yml
Drop a .aider.conf.yml in your repo root (or ~/.aider.conf.yml for global defaults) so the whole team shares the same Aider behavior:
# .aider.conf.yml — committed to the repo
# Models
model: claude-sonnet-4-5
editor-model: gpt-5-mini
weak-model: claude-haiku
architect: false
# Git behaviour
auto-commits: true
dirty-commits: false
attribute-author: true
attribute-committer: false
# Context
map-tokens: 1024
subtree-only: false
read: docs/architecture.md # always include this as read-only
# IO
dark-mode: true
pretty: true
stream: true
# Quality gates
auto-lint: true
lint-cmd: "eslint --fix"
auto-test: false
test-cmd: "npm test"
# Cost control
cache-prompts: true
cache-keepalive-pings: 12
Commit this file. Now everyone on the team gets the same defaults, and changes to AI-coding policy are visible in pull requests like any other config change.
.aiderignore and .aider.model.metadata.json
.aiderignoreuses.gitignoresyntax to keep Aider away from sensitive or generated files (.env,dist/,node_modules/,secrets/). Aider already respects.gitignoreby default;.aiderignoreis for files you want in the repo but not in AI context..aider.model.metadata.jsonlets you override Aider's per-model defaults — context window size, cost-per-token, capability flags. Useful when you're using a self-hosted endpoint or a brand-new model Aider doesn't know about yet.
Linting integration
Aider can run your linter after every change and fix anything it broke:
aider --auto-lint --lint-cmd "eslint --fix src/"
# Python:
aider --auto-lint --lint-cmd "ruff check --fix ."
# Go:
aider --auto-lint --lint-cmd "gofmt -w . && go vet ./..."
When the linter reports a violation, Aider reads the message, modifies the code to satisfy the rule, and re-runs until the linter is happy or it gives up after a sensible number of tries.
Test integration (the implement-test-fix loop)
aider --auto-test --test-cmd "npm test"
After every code change, Aider runs your test suite. If anything fails, it captures the output, reads the failing test and the changed code, and proposes a fix — then re-runs. This creates a tight feedback loop similar to TDD, except Aider is the one writing the implementation and you're the one specifying the test.
For best results, also point Aider at your test files:
/add tests/test_auth.py tests/test_users.py
So it can amend tests that are genuinely wrong rather than over-fitting the implementation to a broken test.
Reasoning effort and thinking tokens
Frontier models in 2026 expose explicit reasoning controls:
# OpenAI GPT-5 / o1 / o3 family
aider --model gpt-5 --reasoning-effort high
aider --model o3 --reasoning-effort medium
# Gemini 2.5 / Anthropic with thinking
aider --model gemini/gemini-2.5-pro --think-tokens 32000
aider --model claude-opus-4-1 --think-tokens 16000
Higher reasoning is meaningfully better on architectural and multi-file work, and meaningfully worse on cost. A reasonable default: --reasoning-effort medium for the architect, off (or low) for the editor model.
Working with multiple files
For cross-cutting changes — renaming an interface used in 30 places, splitting a 2,000-line file, migrating from CommonJS to ESM — the repo map plus a clear instruction is usually enough:
/add src/types/user.ts
Rename the `User` interface to `UserProfile` everywhere in the repo.
Update all imports and type references. Keep behaviour unchanged.
Aider lists the files it plans to modify and asks for confirmation before applying. If a file is missing from the chat context, it asks you to add it rather than silently editing it.
Browser interface
If you prefer a GUI:
aider --browser
Opens a Streamlit-based chat window in your default browser, with the same Git integration and file editing as the CLI. The terminal interface is faster and more keyboard-friendly; the browser interface is useful when you want to share an Aider session over screen-share without the noise of a terminal.
Server mode and SSH workflows
Aider can be run on a remote machine over SSH and used as a normal interactive session — practically useful when your repo lives on a build server, a Linode, or a developer VM with stronger LLM-cost discounts. The pattern:
ssh dev@build.example.com
cd /var/www/app
aider --model gpt-5
Combined with tmux or screen, you get persistent Aider sessions you can reattach to from any client. There is no separate "server mode" daemon — Aider is just a CLI, and the existing remote-shell tools handle the rest.
Step 7: Best Practices
Be deliberate about context
Aider works best with a small, focused set of files in chat. Adding your whole src/ tree dilutes the model's attention and burns tokens. Start with 1-3 files, add more as the model asks for them or as the repo map suggests.
Use the architect/editor split for hard problems
If the change touches more than two files or involves architectural decisions, run architect mode. The two-pass design measurably improves quality on real-world refactors and usually saves money over running a single frontier model end-to-end.
Review diffs before pushing
Aider auto-commits, but git push is still your call. A 30-second git log --oneline -5 && git diff HEAD~5..HEAD before pushing catches the rare case where the model misread your intent. AI-generated code is generally correct; security implications and project-specific conventions still deserve human eyes.
Combine with your editor, not against it
A productive layout:
- Open the project in your editor (VS Code, Neovim, JetBrains).
- Open a terminal alongside it (a tmux split, an iTerm pane, the editor's integrated terminal) and run
aider. - Ask Aider to make changes — your editor refreshes from disk automatically.
- Review the diff in the editor's source-control panel.
- Iterate.
Aider's --watch-files mode (Step 5) is the natural extension of this: now you're not even switching to the terminal — you drop AI! into a comment and let Aider react.
Use /run and /test for tight feedback loops
Instead of switching between Aider and another terminal:
/run npm run build
/test npm test
/lint eslint --fix src/
Aider sees the output and proposes a fix if anything fails. This compresses the change-build-test-fix loop into a single chat turn.
Use prompt caching on long sessions
--cache-prompts --cache-keepalive-pings 12 saves real money on Anthropic and DeepSeek for any session that runs more than 5-10 minutes. Turn it on by default in .aider.conf.yml.
Commit a .aider.conf.yml to the repo
A team-shared config file makes AI behaviour reproducible across machines and developers. Linters, tests, model defaults, and read-only context (architecture docs, ADRs) become part of the repo's contract, not tribal knowledge.
Step 8: Pair Aider with DeployHQ for Git-to-Production
Aider's atomic-commit design is what makes the integration with deployment automation feel almost frictionless. There is no manual staging, no forgotten files, no "wip: stuff" commits to clean up. Each AI change is a discrete, message-tagged commit ready to be deployed.
How the workflow fits together
flowchart LR
A[Describe change to Aider] --> B[Aider edits files]
B --> C[Auto-commit with message]
C --> D[git push]
D --> E[DeployHQ detects push]
E --> F[Build pipeline runs]
F --> G[Atomic deploy + zero-downtime cutover]
G --> H[Production]
Step by step:
- Aider makes atomic commits: each change ships as one well-scoped commit with an LLM-generated message. No human staging required.
- Push triggers deployment:
git pushto your configured branch lands on DeployHQ's webhook. If automatic deployment is enabled for the branch, the build kicks off immediately. - DeployHQ runs your build pipeline:
npm ci && npm run build,composer install,pip install -r requirements.txt, or whatever your stack needs. Builds run on DeployHQ's infrastructure, so your local machine is free to keep coding. - Atomic deploy with zero downtime: atomic file transfers and zero-downtime cutover ensure the switch from old to new is instant. No half-deployed states.
- One-click rollback if something breaks: revert the deployment in seconds, then
git revert HEADand push the fix on top.
Setting up auto-deploy for an Aider workflow
In DeployHQ:
- Connect your repository: GitHub, GitLab, Bitbucket, or any Git remote.
- Enable automatic deployments on your target branch (
main,production, or a per-environment branch). - Configure build commands for your stack:
# Node.js
npm ci
npm run build
# Laravel/PHP
composer install --no-dev --optimize-autoloader
php artisan config:cache && php artisan route:cache
# Python/Django
pip install -r requirements.txt
python manage.py collectstatic --noinput
- Set up server connections — SSH/SFTP to your VPS, S3 + CloudFront, DigitalOcean, AWS Lightsail, or any of the supported deployment targets and integrations.
Now every git push after an Aider session triggers a full deployment pipeline.
Example: end-to-end workflow
# Start an Aider session
cd ~/projects/my-webapp
aider src/components/Header.jsx src/styles/header.css
# Ask Aider for the change
> Add a dark-mode toggle to the Header. Use a CSS class toggle
> with prefers-color-scheme as the default. Cover with a snapshot test.
# Aider edits the files and commits:
# "feat: Add dark-mode toggle with prefers-color-scheme default"
# Verify and push
git log --oneline -1
git push origin main
# DeployHQ detects the push, runs `npm ci && npm run build`,
# then atomic-deploys to production. Total time: under 90 seconds.
Why this beats manual deployment
- No forgotten changes — Aider commits everything it touches. You won't push a half-finished state.
- Granular history in deployment logs — DeployHQ shows commit messages alongside each deployment, so you can see exactly which AI-generated change is live.
- Instant rollback — if an Aider commit breaks something, DeployHQ swaps back to the previous deploy in seconds;
git revert HEAD && git pushlands a permanent fix on top. - Branch-based environments — feature branch → staging server,
main→ production. DeployHQ supports per-branch deployment targets, so an Aider feature branch can run through QA before merging.
For a deeper look at running AI coding agents directly inside CI/CD pipelines (how Claude Code, OpenAI Codex, and Gemini CLI compare), see Running AI Coding Agents in CI/CD. For a broader take on how AI is reshaping deployment workflows, How AI Coding Assistants Are Changing the Way We Deploy Code is the recommended read.
Step 9: Troubleshooting
Authentication errors or "no model found"
Verify the API key is actually set in the shell Aider is running in:
echo $OPENAI_API_KEY # or $ANTHROPIC_API_KEY, $DEEPSEEK_API_KEY, etc.
If it's empty, re-export it or check your .env file is in the project root (Aider only auto-loads .env from the directory it was launched in).
For Anthropic specifically, double-check the key is for the API (not Claude.ai) and hasn't hit its monthly cap.
Aider isn't seeing my files
Aider only operates inside Git repositories. If your project isn't initialised:
git init
git add .
git commit -m "Initial commit"
Then re-run Aider. Confirm files are added with /ls — if a file isn't in the list, /add it explicitly.
Changes aren't being committed
If Aider modifies files but doesn't commit:
- Check whether
--no-auto-commitsis set in your CLI args or.aider.conf.yml. - If your working tree was dirty before the change, Aider refuses to commit by default. Either commit/stash existing changes, or pass
--dirty-commitsto allow Aider to commit alongside other changes. - If commits seem to disappear, check
git reflog—--no-attribute-authorplus an unusual commit message may have made them harder to spot.
High token usage or slow responses
- Lower the repo map:
--map-tokens 512or--map-tokens 0. - Drop unused files from chat with
/drop. - Switch the editor model to something cheaper:
/editor-model gpt-5-minior/editor-model claude-haiku. - Enable prompt caching:
--cache-prompts(saves 30-70% on long Anthropic/DeepSeek sessions). - Check
/tokensmid-session — Aider prints the current cost and token budget.
Watch mode (--watch-files) is missing changes
- Confirm Aider is running in the foreground and
--watch-filesis in the launch command. - Filesystem events on macOS Spaces or Windows shared folders can be unreliable — try
--watch-files-poll(polling fallback) or run Aider on the same physical filesystem as the repo. - The marker must end the comment line:
// fix this. AI!works;// AI! fix thisdoes not. - Some editors (auto-format-on-save with prettier/black) can race with Aider's writes — disable format-on-save while watch mode is active, or move formatting to
--auto-lint.
Diff-format errors ("could not apply edit")
Some models, particularly older or smaller ones, occasionally produce malformed diffs. Aider retries automatically; if errors persist:
- Switch to a model with better diff-format adherence: GPT-5, Claude Sonnet 4.x, or Gemini 2.5 Pro.
- Use architect mode with a stronger architect and a precision-focused editor model (
gpt-5-miniis reliable on diff format). - For local models, ensure you're using a code-tuned variant (
qwen2.5-coder,deepseek-coder-v2) rather than a general chat model.
Aider edited files I didn't want changed
/undo reverts the last change. For more selective reversal:
git diff HEAD~1 # see what changed
git checkout HEAD~1 -- path/to/file # revert one file
git commit -m "Revert unintended change to path/to/file"
To prevent it next time, use /read-only on files that should never be modified, and be explicit in your prompts about which files are in scope.
"MCP servers" — Aider doesn't have them yet
If you're coming from Claude Code, Cursor, Cline, or Warp, you may be looking for Model Context Protocol servers in Aider. As of v0.86.x, Aider does not natively support MCP — there's an open RFC (issue #4506) and a closed exploratory PR (#3937), but no shipped integration. For Aider, the closest equivalents are /web (URL scraping), /run (arbitrary shell tools), and /read-only (file context). If MCP is a hard requirement for your workflow, Claude Code or Warp are the closer fits today.
Conclusion
Aider in 2026 is not a flashier product than the one that launched in 2023 — it's a more refined one. The bet is the same: a tiny, vendor-agnostic, terminal-first CLI that treats Git as the source of truth and atomic commits as the unit of AI change. Around that core, the team has shipped the architect/editor pair, watch-mode AI! comments, prompt caching, /web and /voice, GPT-5 and Claude 4.x and Gemini 2.5 Pro support, the polyglot leaderboard, and a configuration model (.aider.conf.yml) that turns AI-coding policy into version-controlled team practice.
For developers who already think in commits and pushes, Aider's design matches the way they work. Pairing it with DeployHQ closes the loop: Aider takes "describe the change" to a clean commit; DeployHQ takes that commit to production with build pipelines, atomic deployments, zero-downtime cutover, and rollback if anything goes sideways. The full pipeline — terminal prompt to production server — runs in well under two minutes.
Sign up for a free DeployHQ account and connect Aider to the repo where you ship real code.
If you have questions about pairing Aider with your DeployHQ deployment workflow, reach out at support@deployhq.com or find us on Twitter/X at @deployhq.