Pi, agent harnesses, and how to benchmark them
What a coding-agent harness is, why Mario Zechner built the minimal Pi harness, and why every coding benchmark score is really a model + harness pair.
TL;DR: A coding agent is a model inside a harness. Mario Zechner built Pi, a deliberately tiny harness with four tools, because bigger harnesses kept quietly changing what the model sees. And when you try to rank harnesses, you find that every benchmark score is really a model + harness pair. You can't grade the kitchen without also tasting the chef.
1. What even is a harness?
A model on its own is a brilliant chef locked in an empty room. It can tell you how to make pasta, but it can't boil water. The harness is the kitchen we build around it:
Claude Code, Codex, OpenCode, Amp, and Cursor's agent are all harnesses.
2. What was going wrong
The harness makes lots of decisions for you, invisibly, and those decisions change what the model sees. More features means more hidden text, and you can't tell why the model got confused.
3. So how would you fix it?
If the hidden stuff is the disease, what's the cure?
Have less stuff, and make every addition visible and chosen by you.
But won't a stripped-down agent be dumb?
No. Frontier models have been heavily RL-trained on coding, so they already know what a coding agent is. The chef already knows how to cook and doesn't need a 50-page manual.
So what's the smallest set of tools that still does everything?
Read, write, edit… and bash. Bash can run any program, so every other capability can be a tiny CLI script.
A minimal terminal coding harness. It has a small, stable core, and every extra capability is something you explicitly add.
4. The four tools
Click each one:
What it leaves out, and how you get it back
| Left out | The Pi way |
|---|---|
| sub-agents | spawn another pi session through bash and read its output |
| plan mode | ask Pi to build it, or install a Pi package |
| big MCP servers | small CLI tools plus a README the agent reads when needed |
| huge system prompt | skills: only a one-line description sits in context, and the full instructions load on demand |
Pi can also modify itself, so you can grow a custom harness for a specific job. Mario sees that as a preview of self-modifying software.
pi-ai // one API across LLM providers, with token + cost tracking pi-agent-core // the loop: run tools, validate, stream events pi-tui // terminal UI with differential rendering // or embed it as an SDK const { session } = await createAgentSession({ ... }); await session.prompt("What files are in this directory?");
5. So which harness is best?
Easy: give each one the same tasks and count wins?
But which model is running inside each one? A harness never works alone. Terminal-Bench says it outright: it grades the model and the harness together.
So how do benchmarks untangle the chef from the kitchen?
Hold one of them fixed:
6. How much does the kitchen matter?
Sometimes a lot:
Shortening old tool results as the context fills up. Complete SWE-bench Verified solutions under a tight context window:
That's a 23.8-point gap between harnesses.
…and sometimes barely at all. In one bug-fixing study, Claude Code and GitHub Copilot running the same model showed no significant difference, but changing the model did matter.
7. The benchmarks worth knowing
- Terminal-Bench is the big one for terminal agents. Version 4.0 (Aug 29, 2026) has 66 hard tasks, and the official leaderboard lists the harness for each entry. You can run it yourself with Harbor:
harbor run -d terminal-bench/terminal-bench@4.0.0 - SWE-bench Verified / Pro has agents fix real GitHub issues and grades only the final patch. Be wary of vendor numbers: Opus 4.5 scored about 45.9% in Scale's standardized run and about 50–52% in a harness vendor's own comparison.
- Harness-Bench is built specifically to compare harnesses: fixed tasks, sandbox, budget, timeout, and grader, with only the harness changing.
Terminal-Bench 4.0, official leaderboard (as of late Sep 2026)
Notice a pattern? The top entries run in the model maker's own harness. Labs train their models while using their own harness, so the chef is used to that kitchen.
- Every score is a model + harness pair. Read the harness first.
- Scores from different versions (2.0 / 2.1 / 4.0) aren't comparable.
- Vendor-run comparisons tend to put the vendor's own agent on top.
- Benchmark-tuned models can crash on a harder refresh ("benchmaxxing").
8. So what should I actually do?
- Pick the model first.
- Start with its native harness (Claude Code for Claude, Codex for GPT).
- Reach for a minimal harness like Pi when you want control, no hidden behavior, or model-agnostic setups. I found no clean head-to-head score for Pi against the big harnesses, so don't assume it wins or loses.
- The benchmark that matters most is your own repo: take five tasks you've already done and run them through two harnesses.
Sources
Pi
- What I learned building an opinionated and minimal coding agent — Mario Zechner
- @mariozechner/pi-coding-agent — npm README
- Building Pi, and what makes self-modifying software so fascinating — The Pragmatic Engineer
- Slop, Speed, and Discipline: Hard Truths About AI Coding Agents — ML Notes (AI Engineer talk)
- agent-tools — minimal CLI tools vs MCP token costs
Benchmarks and leaderboards
- Terminal-Bench — official site and leaderboard
- Terminal-Bench 4.0 and 2.1 — Snorkel AI
- Terminal-Bench 4.0 — Artificial Analysis
- Terminal-Bench 4.0 leaderboard 2026 — CodingFleet
- Terminal-Bench 4.0 exposes inflated AI scores — Flowtivity
- Meta-Harness — 76.4% on Terminal-Bench 2.0
- Harness-Bench community leaderboard — GitHub
Research on harness effects
- Same Model, Different Harness: Different Coding-Agent Results — arXiv 2608.26218
- Harness-Bench: Measuring Harness Effects across Models — arXiv 2605.27922
- BC-Bench: Evaluating Agentic Engineering in a DSL for ERP — arXiv 2608.20851
- Coding Agent Harness Benchmarks: Why the Harness Changes the Score — Future AGI
✦