DEV Community

A Two-Model Bake-Off on Your Own Repo: Isolating Runs With Git Worktrees

Most model comparisons I read have the same flaw: the models never touch the same problem under the same conditions. One gets a carefully groomed prompt, the other gets a sloppy one. One runs against a clean checkout, the other inherits half-finished edits from the previous attempt. The conclusion tells you more about the harness than the models.

I wanted a comparison I could actually trust for my codebase, so I built a small bake-off harness around git worktree. It runs two coding models against the identical task, in identical isolated checkouts, and reduces the result to a table: did the tests pass, how big was the diff, did it touch files it was told not to touch. This post is that harness, plus the judgment calls that make the results meaningful.

This pairs naturally with a free tier: a bake-off is bursty, short-lived work, so it is a good fit for zero-cost compute. I ran mine using MonkeyCode's free model access on their free server option, which meant the whole experiment cost nothing and left nothing running afterward.

Disclosure: This article was prepared as part of MonkeyCode's product outreach. The harness itself is plain git, shell, and your test runner - swap in any two models or agents and it works the same.

Why worktrees instead of branches or clones

The isolation requirement is strict: both models must see byte-identical starting state, and neither run may contaminate the other or your working copy. Three options:

Approach Disk cost Contamination risk Cleanup
Two fresh clones Full repo ร—2 Low rm -rf ร—2
Branches + stash juggling None High (shared working dir) Fiddly, error-prone
git worktree add One checkout per run Low (separate dirs, shared object store) git worktree remove

Worktrees win: each run gets its own directory backed by the same object store, your main checkout is

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.