The pairing session started with the wrong question. A developer asked which coding model the team should standardize on. The senior developer did not answer. She asked to see the last three pull requests instead.
An hour later, the session had produced no model ranking. It produced a review budget, an estimator script, and a rule about how much of the repository the free tier is allowed to touch. The session is a composite of recent onboarding calls; the numbers are illustrative, and the script is the reusable part.
The context we started from
The team had just received access to MonkeyCode's free tier, the open-source project's offering: free model access, a free server option for trying the models, and a 10 million token allowance at the time the session was prepared. Disclosure: This article was prepared as part of MonkeyCode's product outreach.
Everyone wanted to switch immediately. Nobody had defined what switching meant. The community discussions that week kept circling the same two observations: benchmark numbers drifting further from real outcomes, and the human half of the AI coding loop going untested. The session was heading toward both mistakes, so the senior developer redirected it. No leaderboards, no hype. Only the repository.
False start #1: comparing leaderboard tables
The first 40 minutes went to public benchmarks. Each table disagreed with the one from the previous week. Model names shifted positions, context windows changed, and the argument kept moving.
The dead end was not the data. It was the question. Asking which model is best is undefined without a workload, a review process, and a failure definition. The senior developer's reframe: pick the task first. The model choice becomes a footnote.
False start #2: trusting the token math
The second mistake was more subtle. The team estimated the token cost of a real migration and proved it fit inside the 10 million allowance. Then they assumed the experiment was free.
The target was a legacy assertion style across 80 test files, about 12,400 changed lines. The estimator looked like this:
#!/usr/bin/env python3
"""review_budget.py — estimate token load for a range of commits."""
import subprocess
import sys
# Heuristics, not contracts. Code averages roughly 3.5 chars per token;
# a model re-reads surrounding context, so multiply the raw diff by ~3.
CHARS_PER_LINE = 40
CHARS_PER_TOKEN = 3.5
CONTEXT_MULTIPLIER = 3.0
def main(base: str, head: str) -> None:
out = subprocess.run(
["git", "diff", "--numstat", base, head],
capture_output=True, text=True, check=True,
).stdout
files = added = deleted = 0
for line in out.splitlines():
a, d, _ = line.split("\t")
files += 1
added += int(a)
deleted += int(d)
naive = (added + deleted) * (CHARS_PER_LINE / CHARS_PER_TOKEN)
realistic = naive * CONTEXT_MULTIPLIER
print(f"files touched: {files}")
print(f"lines changed: {added + deleted}")
print(f"naive token estimate: {naive:,.0f}")
print(f"realistic estimate: {realistic:,.0f}")
if __name__ == "__main__":
main(sys.argv[1], sys.argv[2])
Run against the migration branch:
python review_budget.py main feature/legacy-assertions
# files touched: 80
# lines changed: 12,400
# naive token estimate: 141,714
# realistic estimate: 425,143
425,000 tokens against a 10 million allowance. The quota was not the constraint. Everyone nodded, closed the laptop, and let the model generate all 80 files over the weekend.
That was the dead end. The token bill was fine. The attention bill was not.
The measurement that changed the plan
Monday morning produced 46 draft pull requests. Careful review of each patch took about 15 minutes in this team's workflow; the senior's rule is that AI patches get the same review as human patches, or the experiment is debt with extra steps. 46 patches at 15 minutes is 11.5 hours of review attention. The team had four hours available that week.
The useful measurement was not tokens per patch. It was review minutes per patch, multiplied by the patch count, compared against real review capacity. That number, not the quota, decided the shape of the experiment.
The senior also applied her standing rule: before trusting the model with a new slice, replay three historical patches from the repository's own git history. The team reproduced the before-state, asked the model to perform the same mechanical change, and diffed the output:
#!/usr/bin/env bash
set -euo pipefail
sha="$1" # example: 7f3a1c9
work="/tmp/replay-$sha"
git worktree add "$work" "$sha^" >/dev/null
git diff "$sha^" "$sha" > "/tmp/expected-$sha.patch"
cd "$work"
echo "1. Reproduce the change described by this commit:"
git log -1 --format='%s%n%b' "$sha"
echo "2. Let the model perform the same change, then compare:"
echo " git diff > /tmp/model-$sha.patch"
echo " diff -u /tmp/expected-$sha.patch /tmp/model-$sha.patch"
git worktree remove "$work" --force
Two of the three replays were close. The third drifted on formatting and renamed an import the team wanted untouched. That single failure justified the review rule better than any leaderboard could.
The decision that stuck
The session ended with one decision, and the team kept it:
- The free tier gets a bounded slice. It touches one directory, the legacy test assertions. It never touches the payment module or any code path with a pending data migration.
- Every generated patch lands as a draft pull request. No auto-merge, no "it compiles" shortcut.
- The weekly review capacity is the budget. If the draft queue exceeds the hours the team can actually review, the experiment pauses.
- The replay rule runs before any new slice is added. Three historical patches must match before the model earns a new directory.
None of this required a better model. It required a better definition of done.
Limitations: who should not copy this workflow
The workflow fails in three situations. Teams with no automated tests around the target slice will find the replay diff has nothing to verify against. Teams assigning greenfield design to a free model tier will collect confident nonsense for a vague spec, and review time will not fix the spec. Teams whose bottleneck is compute rather than attention should not force an interactive, reviewed-patch workflow onto long-running jobs.
The token estimate is approximate by design. Tokenizers count differently, and the context multiplier of 3.0 is a starting point, not a measurement. Tune it against your own diffs.
The one thing worth copying
Skip the leaderboards. Measure the review budget first, slice the repository second, and spend the free tier last. The numbers in this walkthrough are illustrative; the script and the rule are the artifact.
If the workflow looks useful, run the replay command against your own last three merged patches. MonkeyCode's free tier is enough for that experiment. The cost is an afternoon, not a credit card.
Top comments (0)