Aider vs Claude Code: Git-First Pair Programmer or Agent Loop

Aider is an open-source pair programmer for the terminal that commits every edit to Git and works with almost any model. Claude Code is Anthropic’s agent that searches, edits, runs and checks on its own. How they differ on context, commands, undo, models and extensions, when each wins, and where OpenCode and Codex fit.

7 min read

Aider and Claude Code both run in a terminal and edit your code, but they divide the work differently. Aider is an open-source pair programmer: you add the files it should change, it edits them and commits each change to Git with a descriptive message, and it works with almost any model you have a key for. Claude Code is Anthropic’s agent: you describe the goal, and it finds the files, edits them, runs commands and tests, and keeps going until it thinks the job is done, within the permissions you set. Choose Aider if you want tight control of context, a Git commit for every edit, and free choice of model. Choose Claude Code if you want to hand over a whole task, including the searching and the test runs, and you are happy on Claude models.

How Aider works

Git is the centre of Aider. Its Git integration page (opens in a new tab) says that whenever Aider edits a file it commits the change with a descriptive message, and that before editing files you have changed yourself it commits your changes first, separately, so your work and its work never share a commit. /diff shows what changed since your last message, /undo discards the last Aider commit, and commits it authored carry “(aider)” in the author name. You can turn auto-commits off with --no-auto-commits, though the docs do not recommend it.

Context is explicit. You /add the files Aider may edit and /read-only the ones it should only consult. To see the rest of the project, Aider sends a repository map (opens in a new tab): a concise list of files with their key classes, functions and signatures, trimmed to the most relevant parts by a graph ranking so it fits the model’s context window. When the model needs a file you did not add, Aider offers to add it and asks you first.

Aider has four chat modes (opens in a new tab). Code, the default, edits files. Ask discusses the code without changing anything. Help answers questions about Aider itself. Architect sends your request to a main model that proposes a solution, then to an editor model that turns the proposal into file edits. That is two requests, so it is slower and uses more tokens, but it lets a strong reasoning model plan while a model that is good at edit formats writes the changes. A lighter version of the same idea is to discuss in /ask and then say /ok to have Aider go ahead.

Models are your choice. Aider’s model documentation (opens in a new tab) says it can connect to most LLMs, with guides for OpenAI, Anthropic, Gemini, DeepSeek, OpenRouter, Amazon Bedrock, Vertex AI and local models through Ollama or LM Studio. You pay the provider directly. The same page warns that weaker models may reply with code but fail to produce edits Aider can apply, and its leaderboards show which models edit reliably.

Checks are opt-in and automatic once set. Aider lints the files it edits with built-in linters or your own --lint-cmd, and with --test-cmd and --auto-test it runs your tests after each edit and tries to fix failures. Coding conventions go in a Markdown file you load read-only with --read CONVENTIONS.md, or list under read: in .aider.conf.yml so it loads every time. It can suggest shell commands, and runs one only when you agree or use /run.

How Claude Code works

Claude Code runs an agent loop. Anthropic’s page on how Claude Code works (opens in a new tab) describes three blended phases, gathering context, taking action and verifying results, with tools that read and edit files, search the codebase, run commands and fetch from the web. Asked to fix a bug, it searches for the relevant files itself, reads what it needs, edits across files and runs the tests, and it commits the changes if you ask it to.

The loop is governed by permission modes. From version 2.1.283, terminal and VS Code sessions start in auto, where a classifier reviews each action; Manual asks before most edits and commands, and plan reads without editing. Undo is by checkpoint: Claude Code saves one before each prompt and /rewind restores the files it edited, but its checkpointing page (opens in a new tab) says changes made by shell commands are not tracked. Around the loop sit MCP servers, hooks, subagents, skills, and CLAUDE.md or AGENTS.md for instructions. It runs Claude models, with Opus 5.5 the default on most plans. New to it? Start with Claude Code for beginners.

The difference is who drives

  • Context: in Aider you choose the files and the repo map fills in the outline. Claude Code decides what to read, which saves you effort and spends tokens on searching.
  • Commands: Aider suggests shell commands and runs your lint and test commands; anything else waits for you. Claude Code runs commands itself when its permission mode allows.
  • Undo: Aider’s undo is Git, one commit per edit, so history shows exactly what the model wrote. Claude Code’s undo is checkpoints plus whatever Git habits you keep; it does not commit unless asked.
  • Models: Aider takes almost any provider or a local model. Claude Code takes Claude, through Anthropic or a cloud provider.
  • Extensions: Claude Code is an MCP client with hooks, subagents and skills. Aider’s documentation does not describe MCP support; it extends through scripting, /web to pull a page into the chat, and watching your files for AI comments.
  • Licence: Aider is Apache 2.0, so you can read and change it. Claude Code is distributed under Anthropic’s terms.

When Aider wins

  • You want every AI edit as its own commit, reviewable and revertible with ordinary Git tools.
  • You know which files a change should touch and would rather not pay for the agent to search.
  • You want to use a model Claude Code cannot run: a local model, a cheap model for small edits, or a pairing of a reasoning model and an editor model in architect mode.
  • You need an open-source tool you can audit or run where proprietary binaries are not allowed.

When Claude Code wins

  • The task is vague at the file level, “find why checkout fails and fix it”, and you want the agent to do the finding.
  • The work needs many commands in a row, build, test, read the error, try again, without you approving each one.
  • You want the agent connected to other systems through MCP, such as your issue tracker, a database or a task board.
  • You want the same agent in your editor, a desktop app, the web and CI, not only a terminal.

Where OpenCode and Codex fit

OpenCode sits between the two: an MIT-licensed agent with a loop like Claude Code’s that runs models from many providers, so you keep Aider’s model freedom without choosing files yourself; see OpenCode vs Claude Code. Codex is OpenAI’s agent, with an open-source CLI, an OS-level sandbox, AGENTS.md instructions and cloud tasks; against Aider it trades model choice for autonomy, and against Claude Code it is covered in Claude Code vs Codex.

Keeping the task list out of the chat

Both tools forget the plan when the session ends. fenbs keeps it on a board: each task has a note saying what and why, a plan, and a test status, in lanes To Do, Next Up, In Progress and Completed. Claude Code connects over MCP, reads the next task, moves it and comments with what it changed, and History records each change under the assistant’s name. Aider cannot call the board itself, so with Aider the rhythm is manual: open the task, paste its note into the chat, and when you are done add a comment with the commit hashes Aider made and move the task yourself.

Two terminals, one board
# Aider: conventions loaded read-only, every edit becomes a commit
aider --read CONVENTIONS.md src/billing/invoice.py

# Claude Code: connect the board once, then ask for the next task
claude mcp add --transport http fenbs https://fenbs.ai/api/mcp

Related

Connect Claude Code: the Claude Code integration and the MCP docs. IDE-based comparisons: Windsurf vs Claude Code and Cline vs Claude Code. Delegating instead of pairing: Devin vs Claude Code. Every agent side by side: the best AI coding agents.

Questions people ask.

Is Aider open source?

Yes. Aider is published under the Apache 2.0 licence. The tool itself costs nothing; you pay whichever model provider you connect, or run a local model.

Can Aider use Claude models?

Yes. Aider’s Anthropic guide uses an Anthropic API key, and Claude models are also reachable through OpenRouter, Vertex AI or Amazon Bedrock. Claude Code, by contrast, can also sign in with a Claude subscription.

Does Aider support MCP?

Aider’s documentation does not describe MCP support. It pulls outside context in with commands such as /web for a web page and /read for reference files, and you can script it from the command line.

Aider vs Codex: which is more autonomous?

Codex. It runs commands and iterates inside a sandbox, and can take whole tasks in the cloud. Aider edits the files you give it, commits each change and waits for you, which is slower but easier to follow.

Start with one thing.

There is nothing to set up first. Write one line and you’ve started.