Sources and scope
  • Anthropic engineering, "Raising the bar on SWE-bench Verified with Claude 3.5 Sonnet", 2025-01-06. States that the benchmark evaluates a whole agent system — a model plus the software scaffolding around it — rather than a model in isolation.
    https://www.anthropic.com/engineering/swe-bench-sonnet
  • Anthropic engineering, "Effective harnesses for long-running agents", 2025-11-26. Describes the Claude Agent SDK as a general-purpose agent harness, then documents failure modes and a two-part fix for work spanning many context windows.
    https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents
  • SWE-bench official leaderboards. The "Bash Only" view notes that every model runs in the same mini-SWE-agent environment; site news also records how a minimal harness performed.
    https://www.swebench.com/
This is our own explanation and commentary, not a translation or reprint of those articles. The analogy, comparison tables, judgements, experiment and wording were written here; we cite only published first-party facts and links, and no unverified scores. Sources checked 2026-11-15. If you quote this post, please credit the originals as well. If you are an original author who would rather not be cited, contact us.

A result that is hard to explain

Keep the model and the test set fixed, replace only the software that runs the model, and the score can move substantially. This shows up often enough in coding-agent evaluation that Anthropic made it explicit in a January 2025 SWE-bench post: the benchmark measures a whole agent system — the model plus the scaffolding around it — not a model on its own. The same underlying model can perform very differently under different scaffolding, and the post notes that outside developers improved results around an unchanged model by working on that layer.

The official SWE-bench leaderboards make an even plainer point. They include a "Bash Only" view whose description says every model runs inside the same mini-SWE-agent environment. You only need to pin that environment if it is a variable in the outcome — which is a quiet official admission that the runtime matters.

So what does that layer actually do for us?

A one-line definition: the model decides, the harness makes it happen

Strip a large language model down and it does one thing: read text, produce text, stop. It cannot open a file, run a command, or find out whether its last edit broke the tests. Ask it to fix a bug and it will describe the fix fluently — but "open the file, edit, run tests, read the error, try again" is a chain it cannot carry out by itself.

An agent harness is the ordinary software wrapped around the model. It assembles the task, system prompt and tool definitions into this turn's input; catches the structured tool request the model emits and executes it; feeds the result — error messages included — back into the context; and starts the next turn, until the job is done or a stopping rule fires.

Think of a restaurant kitchen. The model is a head chef who can see the ticket and speak, but has no hands. The harness is the stove, the fridge, the runners, the timer, and the shift log that says where the previous crew stopped. Without them, even an excellent decision never becomes a dish.

The point everything else hangs on The model never executes anything itself. It emits a request — "I want this tool, with these arguments" — while execution stays with the harness. Which tools exist, how calls are validated, how results return, and when the loop is allowed to end are all decisions made in code.

What a harness actually owns

Products differ in the details, but nearly all of them end up responsible for the same five areas. The right-hand column is the easier way to remember them.

PartWhat it doesWhat breaks without it
The loop and its exit rules Build the input, parse the action, execute it, append the observation, repeat. Also set turn caps, timeouts, retries and early-exit conditions. The model answers once and stops, or spins on the same error until the budget is gone.
Tool registry and execution Declare available tools (file read/write, shell, search, browser, test runner), validate call shapes, run them in a defined environment. The model can only describe what should be done; nothing lands on disk.
Context and compaction Choose what the model sees each turn; summarise and restart a window when it fills up. Long tasks lose their own history halfway through and quietly drop earlier decisions.
State across sessions Leave progress notes, commit history and feature lists so a fresh session with no memory can pick up the work. Every new session re-guesses the current state, or sees existing files and assumes the job is finished.
Boundaries and traces Permissions, sandboxes, human approval for risky actions, call logs, cost and step limits. Files get deleted, "done" gets claimed without verification, and there is no way to replay what happened.

None of these five live inside the prompt. The prompt is one part of the input; the rest is engineering. That is why writing the instruction more forcefully rarely fixes an agent that keeps declaring victory too early.

Three claims we can back up

1. A score belongs to the combination, not the model alone

Anthropic's SWE-bench post says performance can vary significantly with the scaffolding even when the underlying model is unchanged. Add the official "Bash Only" view, which pins one environment for every model, and the reading is clear: when you see "model X scored Y%", the first question is which harness produced that number. Comparing model strength without naming the runtime invites bad conclusions.

2. On long tasks the bottleneck is often the shell, not the intelligence

The November 2025 Anthropic post is more concrete. It calls the Claude Agent SDK a general-purpose agent harness with context management such as compaction — and then says plainly that compaction is not enough. Even a frontier model, looped across multiple context windows with only a high-level request such as "build a clone of this app", fell short of a production-quality result. Two failure modes it describes: trying to one-shot the whole application, and a later session seeing some progress and declaring the project complete.

3. Fixing the shell is cheaper than replacing the model — and it works

Every part of that post's remedy lives in the harness; no weights change. A first session prepares the ground: a start-up script, a progress file, an initial commit, and a feature list with every entry marked failing. Later sessions read the notes and commit log, advance exactly one feature, finish with a commit and a progress update, and verify through browser automation before flipping a feature to passing. Those are artefacts, process rules and checks — not a smarter model.

One more easily missed data point: SWE-bench site news from July 2025 records a minimal harness of roughly a hundred lines of Python posting a strong Verified result. It does not prove that simpler is always better, but it does show heavier is not automatically stronger. Predictability and honest verification tend to pay more than an ever-growing feature list.

Where the other terms fit

We have separate guides on agents, Skills, MCP and coding tools. Put them in one table and the harness has an obvious place.

TermLayerWhat you change when you change it
ModelReasoning and generationWeights, provider, context length.
AgentModel + harness togetherWhen people say "I used an agent", they usually mean this combination, not the model alone. See AI Agents.
HarnessThe runtime that closes the loopTool set, loop and exit rules, context policy, state artefacts, verification steps, permissions.
SkillTask instructions loaded on demandContent telling the model how to handle a class of work — not an execution environment. See Agent Skills.
MCPProtocol for reaching toolsWhich external systems and data the harness can connect to. See MCP.
Coding agent productsA harness implementation eachMuch of what separates Claude Code, Codex and WorkBuddy is in the shell: tools offered, context handled, permissions drawn. See Coding Agents and Claude Code setup.
One line to keep A Skill says how to do it, MCP decides what you can reach, and the harness is what makes sure it actually got done. The first two can live in text. The last one has to execute and check.

An experiment with no model change

Concepts stick better once you have felt the difference. This one touches only the shell — no training, no new provider.

Pick a task with an objective finish line. For example, "add unit tests to a small script and make them all pass". Avoid goals like "improve the code", which nothing can verify.
Fix the model and the task text, run once, and take notes. Record whether tests were actually executed, whether the error output came back, and whether the run finished or merely claimed to finish.
Add exactly one hard check at the harness level. Require the test command to run before the loop may end; only a zero exit code permits a "done" message, and any other result returns the raw error to the context for another attempt. Do not touch the prompt or the model.
Run again and compare completion rate, rework turns, and false "done" claims. Repeat the task several times; a single run is noisy.

Why is this a harness change? Because running the test, feeding the result back, and deciding what counts as a valid exit are powers held by the runtime — the model can only request them. You added one gate, and it often outperforms another round of prompt polishing.

To push the same idea across days, layer on the practices from the Anthropic post: a start-up script, a progress file, a commit at the end of every session, and one feature per session. Plain as they sound, they address a structural problem — a new session has no idea what the previous one did.

Three common misreadings

"A harness is just a prompt template"

The prompt is one part of each turn's input. Tool execution, observation replay, retries, permissions and logs live in code the model cannot alter or bypass. Confusing the two leads people to keep tightening the wording for problems that only a runtime guard can solve.

"Using an agent framework means I have a harness"

Frameworks lean towards orchestration: roles, message passing, several agents cooperating. Getting one agent to act on an environment and close the feedback loop is the harness's job. There is also a naming trap: an evaluation harness is the rig that runs tasks, grades outcomes and records trajectories afterwards, which is a different thing from the runtime that does the work. When a source says "harness", check which one it means.

"Simpler shells are better" / "more features are stronger"

The minimal-harness result only shows that complexity is not the same as effectiveness; it does not show that simpler always wins. What actually matters: is the information given to the model accurate, is the outcome verified independently, and can the system recover to a clean state after a mistake? Get those right and either style works. Get them wrong and extra modules just bury the uncertainty deeper.

Caveats and checks

  • The vocabulary is unsettled. Scaffold, scaffolding, runtime and harness are used interchangeably across official docs and community writing — sometimes for the whole runtime, sometimes only for prompt and workflow structure. Read for context rather than policing the word.
  • The two Anthropic posts cited here are dated 2025-01-06 and 2025-11-26. Product capabilities and leaderboard definitions move, so this article rests on the layering idea rather than on any score or version number.
  • No cross-source performance comparisons. Test conditions differ, and lining the numbers up creates a false picture. If you need a comparison, run it on your own tasks with your own model-and-harness combination.
  • Checked 2026-11-15. All external links point to official sites; if those pages change, the current official wording wins.

Further reading

Primary sources:

Continue on this site: AI Agents · Coding Agents · Agent Skills · MCP · All posts.