← GUIDES

GUIDE / SETUP NOTE

Aider vs OpenCode on the Same Local Model

Aider 0.86.2 and OpenCode 1.19.5 on the same local qwen2.5:3b, two one-line bugs, two runs each: Aider fixed 3 of 4 and committed them, OpenCode fixed 1.

16 Nov 2026Checked 2026-10-31
Aider 0.86.2 and OpenCode 1.19.5 on the same local qwen2.5:3b with two one-line bugs and two runs each: Aider fixed 3 of 4 and committed each fix, OpenCode fixed 1 of 4 and left it uncommitted

Aider 0.86.2 from PyPI on Python 3.12 and OpenCode 1.19.5 from npm, each installed into a row folder one at a time, both pointed at the same qwen2.5:3b weights with a 16384-token context on Ollama 0.40.13, given the same two one-line bug fixes in fresh git repos in two test.sh runs per tool on 2026-10-31 PYT, after one development run per tool on the harder task, with a script printing the git log, git status, the diff and a check after each attempt, plus the Aider and OpenCode docs read the same day.

Aider and OpenCode are both open-source coding agents that run in a terminal and can use a model on your own machine through Ollama. We gave them the same small local model, the same two one-line bugs and the same prompts, twice each. Aider fixed 3 of 4 and committed every fix. OpenCode fixed 1 of 4 and left the change uncommitted.

The human step: a person sets the git identity, decides whether the agent may commit on its own, and reviews each diff before it is kept. In our test nothing was approved by hand; a script printed the git log, git status, the diff and a check after every attempt.

Based on Aider, by the Aider contributors, under the Apache 2.0 licence, checked with version 0.86.2, and OpenCode, by the OpenCode contributors, under the MIT licence, checked with version 1.19.5, both with Ollama 0.40.13. Checked 2026-10-31.

The setup

Aider came from PyPI as aider-chat, which needs Python older than 3.13, so we installed Python 3.12 into the project folder first. The Aider environment took 583 MB plus 110 MB for Python. OpenCode came from npm as opencode-ai and took 409 MB. Together that is over 1 GB, so we installed one, ran it, deleted it, then installed the other.

Both used qwen2.5:3b, already on the box, through a copy with a 16384-token context.

The qwen2.5:3b weights are under the "Qwen RESEARCH LICENSE AGREEMENT", for non-commercial use only; check the model card before any commercial use.

Aider talks to Ollama directly. Its Ollama page says to set OLLAMA_API_BASE and use an ollama_chat/ model name, and that Aider sets Ollama's context window large enough for each request plus 8k tokens for the reply. OpenCode needs a provider entry. We followed the local model example on the providers page and put this opencode.json in each repo:

text
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "ollama": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Ollama (local)",
      "options": {
        "baseURL": "http://127.0.0.1:11434/v1"
      },
      "models": {
        "qwen2.5-3b-16k": {
          "name": "qwen2.5:3b with a 16384-token context"
        }
      }
    }
  }
}

There were two tasks. In calc.py, add() returned a - b. In prices.py, a discount function treated 10 percent as 10 times the price, so a 10 percent discount on 30.00 came out as -270.0. A separate check file printed PASS or FAIL for each. This is the whole test script:

text
# Same bugs, same prompts, same local model for Aider and OpenCode. Usage: sh test.sh aider|opencode
TOOL=$1
for TASK in calc prices; do
  if [ "$TASK" = calc ]; then
    FILE=calc.py
    PROMPT='calc.py has a bug: add() subtracts. Fix it in calc.py. Do not change check_calc.py.'
  else
    FILE=prices.py
    PROMPT='prices.py has a bug: total_with_discount takes percent as a whole number like 10 for 10 percent, but treats it as a fraction. Fix the function in prices.py. Do not change check_prices.py.'
  fi
  rm -rf "work-$TOOL-$TASK"
  cp -r "seed-$TASK" "work-$TOOL-$TASK"
  cd "work-$TOOL-$TASK"
  git init -q && git add . && git -c user.name=t -c user.email=t@t commit -q -m seed
  echo "== $TOOL $TASK output"
  if [ "$TOOL" = aider ]; then
    ../venv/bin/aider --version
    OLLAMA_API_BASE=http://127.0.0.1:11434 TERM=dumb timeout 900 ../venv/bin/aider \
      --model ollama_chat/qwen2.5-3b-16k --no-check-update --analytics-disable \
      --no-pretty --no-stream --message "$PROMPT" "$FILE" < /dev/null 2>&1
  else
    ../tools/node_modules/.bin/opencode --version
    timeout 900 ../tools/node_modules/.bin/opencode run -m ollama/qwen2.5-3b-16k "$PROMPT" < /dev/null 2>&1 | sed 's/\x1b\[[0-9;]*m//g'
  fi
  echo "== $TOOL $TASK exit $?"
  echo "== $TOOL $TASK git log --format='%an | %s'"
  git log --format='%an | %s'
  echo "== $TOOL $TASK git status --short"
  git status --short
  echo "== $TOOL $TASK diff from the seed commit"
  git diff "$(git rev-list --max-parents=0 HEAD)" -- calc.py prices.py check_calc.py check_prices.py
  echo "== $TOOL $TASK check"
  python3 check_*.py
  cd ..
done

Results

AttemptAiderOpenCode
Run 1, calcFixed and committedFixed, not committed
Run 1, pricesFixed and committedTwo failed edits, then stopped
Run 2, calcFixed and committedRead the file, then stopped mid-reply
Run 2, pricesUnchanged, no commitAsked us to run its read tool

Runs took 1m41s and 29s for Aider, and 1m52s and 1m32s for OpenCode, on one machine.

What Aider did

Aider sends the files you name to the model and asks for the edit in a set format. With this model it used the "whole" format, which the edit formats page describes as the model returning a full copy of each file that changes. In run 1 the calc task took four replies: three times Aider said "The LLM did not conform to the edit format" and retried on its own, and the fourth was accepted.

Aider commits its own edits, as its git page says. All three fixes came with a commit message from the model, such as "fix: add() returns sum instead of difference". The run 2 calc commit, the one we inspected in full, also carried a Co-authored-by line naming aider and the model. One message was misleading: the run 1 prices fix was committed as "handle percent as decimal fraction in total_with_discount", while the fix treats percent as a whole number and divides it by 100.

In run 2 the prices task printed "Applied edit to prices.py", but the model had sent the file back unchanged. There was no commit, and the check still printed FAIL 2. Our two development runs of the prices task ended the same way.

Three things happened without a question to us. With no git identity set, Aider wrote the placeholder name "Your Name" and you@example.com into each repo's config, and its commits used them. It answered Yes to adding .aider* to a new .gitignore, which it left uncommitted. And it answered Yes when asked to add the check file to the chat; in run 1 calc it then rewrote check_calc.py with identical content.

What OpenCode did

OpenCode works through tools: the model calls read, edit and others, and OpenCode runs them. In run 1 calc the model read the file, called edit with the right change, and the check passed. OpenCode does not commit, so the fix stayed as an uncommitted change.

The other three attempts ended with no change:

  • Run 1 prices: two edit calls failed with "Could not find oldString in the file", then a read asked for line 217 of a four-line file. The reply ended there.
  • Run 2 calc: after reading the file, the reply ended with "I will run this script to modify calc.py:" and no tool call.
  • Run 2 prices: it started its Explore subagent, then asked us to run the read tool on prices.py.

Our two development runs of the prices task also failed. We saw no approval prompt. The permissions page says most permissions default to "allow", with external_directory and doom_loop set to "ask".

What this test does not show

  • A coding model. A larger coding model may change the result; we did not download one.
  • Interactive use. We used one-shot prompts only.
  • Other tasks. Two one-line bugs are a narrow test, and four attempts per tool is a small sample.

What to set up

  • Set your git identity before using Aider, or its commits carry a placeholder name.
  • Decide on auto-commits. Aider commits by default; --no-auto-commits turns that off. Read each commit message, since one of ours was misleading.
  • Give OpenCode a provider entry for Ollama's /v1 endpoint, as in the file above.
  • Raise the model's context before you start; we used 16384 tokens for both.
  • Judge every attempt by git and a test, not the reply. "Applied edit" and "I will fix it" both appeared with no change.

Takeaway

On the same small local model, Aider fixed 3 of 4 one-line bugs and committed each one, while OpenCode fixed 1 and stalled on the rest. Aider's fixed edit format and retries appear to suit a weak model better than OpenCode's tool calls. Both still need a person reading the diff, and Aider needs a real git identity first.

Next step: run the same script with the model you plan to use, and read the git log and your tests after every attempt.

How we check the tools we list is on our verification page.

Good setups, worth keeping. Request email updates on the home page, then confirm by email. No subscription starts until you confirm. Or find an agent for the job.

Your privacy choices

Choose optional tools. Rejecting them keeps the setup library available. Advertising consent stays off.

Choices stay in this browser for 90 days. You can change them using Privacy settings. Privacy and cookie details