The fair way to compare AI coding assistants on your own repo is to replay 6–10 real, already-solved tasks from your git history against each tool, with the same prompt, the same context file and hidden tests that decide pass or fail. Score the results on correctness, review effort and cost, then repeat the run once.

The sharpest pitfall: most "comparisons" quietly compare plans, not tools. Cursor's $8 Plus tier is described as Grok models only, so testing it tells you nothing about Cursor running a Claude or GPT model, and a free tier tells you even less.

This guide covers the setup, the exact commands where a tool has a scriptable mode, a scorecard, and the places the method leaks.

What you need before the first run

You need a repo with a decent history, a working test suite, and a throwaway budget of roughly $80–$120 for one month of subscriptions plus a small API allowance. Pick one person to run everything. Three people prompting three tools in three styles will measure the people.

You also need to decide what "assistant" means. Cursor and GitHub Copilot are editor-centred, with agent modes inside the IDE. Claude Code and OpenAI Codex are agent-first, with a CLI as the primary interface. Codex also has web, IDE and iOS surfaces on paid plans. Comparing them is still reasonable, but you will be driving two of them by hand and scripting the others.

Why not just read SWE-bench? The public leaderboards (Full, Verified, Multilingual, Multimodal, Lite) are useful for a rough sense of model capability. But the site's front page says nothing about how tasks were built or whether training data overlaps with them. Your repo, with its odd build step and house conventions, is exactly what no leaderboard has seen.

Step 1: Pick tasks from your own git history

Open your closed issues and merged pull requests. Choose 6–10 that were solved in a single PR, have a clear written description, and touch code that has tests. Aim for a spread:

  • two small bug fixes (one-file, clear reproduction)
  • two feature additions that touch 3–6 files
  • one refactor with a stated goal, such as "extract this logic into a service"
  • one task that requires reading unfamiliar code, like a bug in a module nobody has touched in a year
  • optionally, one deliberately vague issue, because real tickets are vague

Skip anything that depends on production data, secrets, or a human decision that lives in someone's head. Skip tasks where the PR description gives away the fix.

For each task, write a prompt file that contains only what a developer would have had at the time: the issue text and nothing else. Save it as prompts/task01.md. Do not polish it per tool.

Step 2: Freeze each task in its own git worktree

For every task and every tool, create a clean checkout at the commit before the fix landed:

git worktree add../bench/task03-claude <parent-sha>
git worktree add../bench/task03-codex <parent-sha>
git worktree add../bench/task03-cursor <parent-sha>
git worktree add../bench/task03-copilot <parent-sha>

Worktrees keep runs isolated without four full clones. Then pull the tests from the real fix commit into a separate folder, outside the worktree. These are your hidden tests. The assistant never sees them, and you copy them in only after the run ends.

If the original PR changed or added tests, those are your gold standard. If it did not, write two or three assertions yourself before running anything, and do it blind to the tools' output.

Step 3: Write the scorecard before you run anything

Decide how you will judge results while you are still neutral. Once you have seen a pretty diff, you will rationalise it.

Metric How to record it
Hidden tests pass Yes / no / partial (count of passing assertions)
Existing tests still pass Yes / no, run the full suite
Review effort Minutes you spent reading and fixing the diff before you would merge
Diff size Lines changed versus the human PR
Turns or interventions How many times you had to nudge, correct or re-prompt
Wall-clock time Prompt sent to "done"
Cost Credits, usage-pool change, or dollars, depending on the tool

Review effort is the metric that matters most and the one nobody publishes. An assistant that passes the tests with a 400-line diff full of unrelated rewrites can cost you more than one that fails the tests with a clean 12-line patch you finish by hand.

Keep a rule for interventions: one nudge allowed per task, and it must be a plain statement like "tests fail with this error." No hints about the solution.

Step 4: Give every tool the same context file

Agents behave very differently with and without project instructions, so control for it. The cleanest option is an AGENTS.md at the repo root: a plain-Markdown "README for agents" with no required fields, stewarded by the Agentic AI Foundation under the Linux Foundation. The AGENTS.md site lists OpenAI Codex, Cursor, the GitHub Copilot coding agent, Gemini CLI, Windsurf, Aider, Zed and JetBrains Junie among supporting tools.

Claude Code is the gap. We could not confirm from the vendor material we reviewed that it reads AGENTS.md natively. Don't assume it does. Instead, tell it explicitly in the prompt: "Read AGENTS.md before starting." Adding that sentence to every tool's prompt keeps the test symmetrical.

Keep the file honest and short: how to install dependencies, how to run the test suite, the three conventions that reviewers actually enforce. Do not write it as a prompt for the task at hand.

Freeze it too. Use the same AGENTS.md content across every worktree and every run.

Step 5: Run each tool with the same prompt

The scriptable tools are easy to run uniformly. The IDE tools need discipline.

Claude Code. Use the non-interactive mode, which Anthropic documents as claude -p "prompt":

cd../bench/task03-claude
claude -p "$(cat../../prompts/task03.md) Read AGENTS.md first." \
 --bare \
 --output-format json \
 --max-budget-usd 2 >../../results/task03-claude.json

Two details matter here. --bare skips auto-discovery of hooks, skills, MCP servers and CLAUDE.md, which Anthropic recommends for scripted calls and which keeps your test clean. But --bare also ignores subscription login and needs ANTHROPIC_API_KEY, so this path bills at API rates, not against your Pro or Max plan. Without --bare, -p loads the project's CLAUDE.md, hooks and .mcp.json, which is closer to how people really use it but less controlled. Pick one and apply it to every task.

--max-budget-usd is your safety net. The JSON output includes total_cost_usd and a per-model breakdown, which Anthropic describes as client-side estimates that can differ from the bill. Treat it as a good relative measure, not an invoice.

OpenAI Codex. Use the Codex CLI in its non-interactive mode against the matching worktree. The plan matters: Plus and standard Business limits are expressed as local messages per five-hour window, estimated by model, and cloud tasks can draw more allowance. If you want clean per-run costs, the API Key option is pay-per-API-pricing with CLI, SDK and IDE extension, though without cloud features. If you want to test what a Plus subscriber gets, use a Plus login and record how much of the window each task burned.

Cursor. Open the worktree in Cursor, start a fresh agent chat, paste the prompt, and pick the model explicitly. Note which model, because Cursor's paid tiers differ: Plus at $8/month is a shared pool described as Grok models only, while Premium ($30/month, 4x Plus usage), Super ($100, 15x) and Ultra ($200, 50x) raise the allowance. Third-party models are billed separately at API list price, and allowances refresh weekly. If you want to compare underlying models fairly, run the same model across tools where you can.

GitHub Copilot. Use agent mode in your editor on the matching worktree. Copilot's free tier gives 2,000 completions a month with limited chat and agent usage, which will not survive a bake-off. Pro is $10/user/month with unlimited completions and $15 in monthly AI credits; Pro+ is $39 with $70 in credits. One credit is $0.01, and agent mode, code review, Copilot in the cloud and Copilot CLI consume credits while completions don't. Check the credit balance before and after each task to get your cost figure.

Run each task in a fresh session. A chat that already read half the repo for task two is not a fair starting point for task three.

Step 6: Capture the diff, then judge it blind

After each run, save the output before you evaluate anything:

git -C../bench/task03-claude diff > results/task03-claude.patch

Copy the hidden tests into the worktree, run the full suite, and write down pass or fail. Then strip tool names from the patches, shuffle them, and review them in random order, logging your review-effort minutes. Brand bias is real: people rate the output of the tool they paid more for as better.

If a colleague can do the blind review while you handle the test runs, even better.

Step 7: Repeat once, then compare distributions

Agents are non-deterministic. A single run per task can flip on luck. Run every task twice. If a tool passes a task once and fails it once, record that as unstable rather than averaging it into a flattering 50%.

With 8 tasks, 4 tools and 2 runs each, you will have 64 runs. That is a few days of part-time work, not a weekend. If that is too much, drop to 3 tools and 6 tasks. Fewer tasks done carefully beat more tasks done sloppily.

When you tally, look at three things: pass rate on hidden tests, median review minutes on the passes, and cost per accepted task (total spend divided by tasks you would actually merge). The last figure is the one that matches your budget in practice.

Where the comparison breaks and how to fix it

Plan tier confounds. The most common failure. Free tiers, limited pools and model-restricted plans change the answer. Fix: record the plan and model for every run, and compare tools at the tier you would genuinely buy.

Rate limits mid-test. Codex's five-hour windows and Cursor's weekly refresh can throttle you halfway through. Fix: spread runs across days and log when you hit a limit, since that is also a finding.

Prompt leakage. If your issue text names the file and function to change, you are testing typing speed. Fix: strip hints, or deliberately include one vague task so you see how each tool explores.

Context-file asymmetry. One tool reading AGENTS.md and another ignoring it gives the first an unearned edge. Fix: put the instruction in the prompt for everyone, as in Step 4.

Flaky tests. A test that fails randomly will be blamed on the assistant. Fix: run the hidden tests against the human solution three times before the bake-off starts, and drop any task that isn't stable.

Overfitting to one repo. Your results describe your stack, language mix and test culture. A tool that wins on a Python monolith may lose on a TypeScript monorepo. Fix: if you run several codebases, run a smaller version of this on each.

What it costs to run

For one month, a sensible kit is Claude Pro at $20/month billed monthly, Codex Plus at $20/month, Copilot Pro at $10/user/month and Cursor Premium at $30/month, so about $80 in subscriptions. All are cancellable. Add API spend for the scripted Claude Code runs: with --max-budget-usd 2 and 16 scripted runs, the worst case is $32, and typical runs usually land well below the cap.

Teams evaluating for several developers should price the seat tiers they would really deploy. Claude's Team Standard seat is $25/month billed monthly ($20 annual) and Premium is $125 monthly ($100 annual). Codex Business is $20/user/month billed annually ($25 monthly). Cursor Teams starts from $30+/user/month with pooled usage. Copilot Pro+ and Max ($39 and $100/user/month) add larger credit pools. Heavy agent users burn allowance faster than the headline price suggests, which is why cost per accepted task beats sticker price.

The real cost is your time: figure on 15–25 hours including blind review. That is still cheaper than a year of the wrong seat for five people.

Frequently asked questions

How many tasks are enough? Six to ten is the practical range. Below six, one lucky or unlucky task decides the result; above ten, the effort rises faster than the insight. Repeat each twice instead of adding more tasks.

Should I test autocomplete too? Only if inline completion is a big part of your workflow. It is a different product from agentic task completion and is hard to score with hidden tests. Copilot's completions don't consume credits, so judge them by feel over a week of normal work, separately from this bake-off.

Can I include Gemini CLI or Windsurf? Yes, both are listed as AGENTS.md-supporting tools, so the same method applies. We could not confirm their current pricing, so check their pricing pages and apply the same plan-versus-tool rule before comparing.

How often should I rerun the comparison? Every four to six months, or when a vendor changes models or plan structure. Keep your task folder and scorecard so a rerun takes a day, not a week.