contenox

What is an AI coding harness? Harness vs agent vs model

Updated

BASICS What is a harness?

An AI coding harness is the program around a language model that turns it into a coding agent. The model only predicts text. The harness runs the loop, gives the model its tools, decides what goes into its context, writes its system prompt, and enforces permissions and the sandbox. Claude Code, Codex, OpenCode and DeepSeek Harness are all harnesses.

The short version, as LangChain puts it: agent = model + harness. Swap the harness and the same model behaves differently, sometimes by a lot.

Same model, different harness: the numbers

Terminal-Bench 2.0 is a benchmark of hard terminal tasks, and its leaderboard lists the agent and the model separately. The published submission files for one model, Claude Opus 4.6, show:

HarnessModelTasks solved
Terminus 2 (the benchmark’s own minimal agent)Claude Opus 4.6about 63%
GitHub Copilot CLIClaude Opus 4.6about 60%
Terminus-KIRA (KRAFTON AI)Claude Opus 4.6about 74%

Same model, same tasks, a gap of more than 10 points between the best and the worst wrapper.

Others found the same:

  • LangChain moved its coding agent from the top 30 to the top 5 on Terminal-Bench 2.0 by changing only the harness.
  • A paper at an ICML 2026 workshop (“How good is your harness?”) separated the two effects statistically and found that picking the best harness gains about as much as picking the best model.
  • Anthropic gave the same Claude model the same prompt, a retro game maker, twice. Alone, it ran 20 minutes, cost $9, and the core feature didn’t work. Inside a harness with a planner, a builder and a separate tester, it ran 6 hours, cost $200, and produced a working game.

Model vs harness vs agent vs framework

People search for these as if they were rivals. They are layers.

What it isExamples
ModelThe LLM. Takes text in, returns text or a tool request. Never touches your disk.Claude Opus 5.5, GPT-6.1 Sol, DeepSeek V4.1 Flash
HarnessThe program that runs the model in a loop with tools, context, rules and a sandboxClaude Code, Codex, OpenCode, DeepSeek Harness
AgentModel and harness together, working on your task”Claude Code with Opus 5.5”
Framework or SDKParts for building your own harnessLangGraph, the OpenAI Agents SDK, LangChain’s deepagents

The line between the last two is blurry, and vendors cross it on purpose. Anthropic calls its Claude Agent SDK “a general-purpose agent harness”: it is Claude Code’s loop, tools, permissions and context handling as a Python or TypeScript library. OpenAI’s Codex exposes its harness to other apps through the Codex App Server, the same engine behind the Codex CLI, IDE extension and desktop app. A framework hands you pieces; a harness is the assembled machine, often with the pieces for sale too.

What’s inside a harness

Everything that isn’t the model. For a coding harness, that means:

  • The agent loop. Send the task, get a tool request, run it, send back the result, repeat until the model answers with text. See what is an AI coding agent for one turn of it in JSON.
  • The tools, and how they’re described. Which tools exist (read, edit, run, search, fetch), how an edit is expressed (whole file, search and replace, a diff), and how long each description is. A model that fumbles one edit format can be fine with another.
  • Context management. Which files get read up front, when old turns are summarized (“compaction”), whether a subagent gets a fresh context for a side task, and which instruction files load, such as AGENTS.md or CLAUDE.md.
  • The system prompt. The instructions the harness sends before your task: how to plan, when to run tests, when to stop.
  • Permissions. What runs without asking, what asks first, what is blocked. See AI agent permissions.
  • The sandbox. Whether commands can write outside the project or reach the network. See how to sandbox AI coding agents.
  • The interface. A terminal UI, an editor panel, a desktop app, a web page, or a protocol such as ACP that lets other apps drive it.

Why does the harness change the score so much?

Because most agent failures aren’t the model being unable to write the code. They are the loop going wrong around it:

  • The agent stops too early. It declares victory after the first passing check. A harness that makes it run the full test suite, or hands the result to a separate checker, catches that. Anthropic found that a model judging its own work praises it, and that a separate tester tuned to be skeptical is much easier to build.
  • The context fills up. On long tasks, early instructions get crowded out. Anthropic’s long-running harness has the agent work one feature at a time, commit to git, and keep a progress file, so a fresh session can pick up where the last one stopped.
  • Tools return too much or too little. A test run that dumps 5,000 lines buries the one error. A harness that trims output, or a linter whose error message says how to fix the problem, gives the model what it needs.
  • Timeouts and retries. A harness that kills a slow build, or never retries a flaky command, fails tasks the model could have solved.

Vendor harnesses are tuned for their own models, and the reverse is true too. That’s part of why “best harness” has no single answer: it depends on which model you put in it.

What is harness engineering?

Harness engineering is improving everything around the agent instead of rewriting your prompt: every time the agent makes a mistake, you change its environment so it can’t make that mistake again. The term spread in early 2026:

  • Mitchell Hashimoto, in February 2026, made “engineer the harness” a step in his own workflow: when the agent gets something wrong, add a line to AGENTS.md or write a small tool, such as a script that takes a screenshot or a test runner that filters output.
  • OpenAI published “Harness engineering: leveraging Codex in an agent-first world” the same month. A small team built an internal product of about one million lines over five months with no hand-written code. The engineers’ job became designing the repository so agents could work in it: docs as a map, enforced architecture layers, linters and structural tests.
  • Birgitta Böckeler of Thoughtworks wrote it up on martinfowler.com for people who use agents rather than build them. Her split is useful: guides steer the agent before it acts (AGENTS.md, conventions, examples), sensors check it after (tests, linters, type checkers, hooks, AI review). Deterministic sensors like tests are cheap and reliable; AI review is slower and less certain.
  • Anthropic has published two engineering posts on harness design for long-running coding work, and calls harness design “key to performance at the frontier of agentic coding”.

“Claude harness engineering”, in searches, usually means those Anthropic posts.

What it looks like in your own repo:

  1. Write the rules down once. An AGENTS.md with the build command, the test command and the things the agent keeps getting wrong. See AGENTS.md explained.
  2. Make the checks fast and loud. A test command that finishes in seconds and prints only failures. A linter rule for the mistake the agent made twice.
  3. Put the check in the loop. A hook or instruction that runs the linter after every edit, so the agent sees the error before you do.
  4. Add the fix where the mistake happened. Each repeated mistake becomes a rule, a test or a script, not a longer prompt.

Which AI coding harnesses exist?

The ones people compare most, as of November 2026:

  • Built by a model company: Claude Code (Anthropic, Claude models), Codex (OpenAI; open source; OpenAI models plus configured providers), Antigravity CLI (Google; replaced Gemini CLI for personal accounts in June 2026), DeepSeek Harness (DeepSeek; open source, MIT; the dsh command with a web UI on localhost; a developer preview), GitHub Copilot CLI (GitHub; Copilot’s models, your own keys or local models).
  • Independent, open source, any model: OpenCode, Kilo Code, Cline, goose, Pi, Hermes Agent, Aider.
  • Built into an editor: Cursor’s agent, which also ships as a CLI.
  • Research and benchmark harnesses: Terminus 2, the minimal agent from the Terminal-Bench team that only uses a terminal, built as a neutral baseline for comparing models.

The full matrix, with licenses, models, sign-in, Windows support and sandboxes, is in the AI coding harness comparison.

Codex vs Claude Code vs OpenCode vs DeepSeek Harness: what actually differs?

The question behind “codex harness vs opencode” or “deepseek harness vs claude code” is usually: if I use the same model, which wrapper is better? Four differences matter more than benchmark points:

ModelsOpen sourceSandboxInterface
Claude CodeClaude onlyNomacOS, Linux, WSL2Terminal, IDE, desktop, web
CodexOpenAI, plus providers you configure, plus local through Ollama or LM StudioApache-2.0macOS, Linux, native WindowsTerminal, IDE, ChatGPT desktop app, cloud
OpenCodeAny providerMITNone; the docs recommend Docker or a VMTerminal, desktop (beta), web
DeepSeek HarnessDeepSeek, plus Anthropic, OpenAI, Kimi, GLM and custom endpointsMITLinux, macOS; Windows partialWeb UI, CLI, ACP

Claude Code is built for Claude. DeepSeek documents pointing it at DeepSeek’s Anthropic-compatible API, but Anthropic doesn’t support Claude Code with non-Claude models. DeepSeek Harness goes the other way: it can run Claude Code and Codex as subagents.

“Copilot harness vs local” usually asks whether GitHub Copilot runs on your machine or in the cloud. Both: Copilot CLI and VS Code run the harness locally on your files, and the Copilot cloud agent runs it on a copy of your repo on GitHub’s machines. Since April 2026, Copilot CLI can also use local models through Ollama, vLLM or Foundry Local.

The name trap: not everything called “harness” is a coding agent. EleutherAI’s lm-evaluation-harness is a tool for running benchmarks on models. AWS AgentCore has a managed “Harness” for building agents (see Bedrock Agents Classic to AgentCore). Harness is also a CI/CD company. And “DeepSeek Harness” is a product name: DeepSeek’s own coding agent, not a generic term.

Does the harness matter more than the model?

Not always, and benchmark numbers overstate it in both directions.

  • Model generations still move the most. On the Terminal-Bench 4.0 leaderboard, Claude Code’s own entries range from 12.4% with Sonnet 5 to 64.8% with Opus 5.5. Same harness family, a 50-point spread.
  • The current leaderboards rarely test one model in many harnesses. Terminal-Bench 4.0 lists mostly each vendor’s model in its own harness. The cross-harness comparisons above come from Terminal-Bench 2.0’s open submissions.
  • Benchmark harnesses are tuned for benchmarks. A harness that tops Terminal-Bench may have no permission prompts, no sandbox and no interface you’d want to use daily.
  • Your repo is the real benchmark. Good tests, a short AGENTS.md and a fast build help every harness. That’s harness engineering you can do today without switching tools.

For how the benchmarks work and which to trust, see AI coding benchmarks.

Contenox

Contenox is a desktop app for Windows (with macOS and Linux builds) that works as the window around coding agents. It runs its own agent with the provider you pick, including a ChatGPT subscription, API keys or local models through Ollama, and it can host Claude Code and other ACP agents from its Agents page. Whichever agent runs, the same visible permission rules apply: Allow, Ask me first or Block, for reading files, changing files and running commands. Download it here.

Related

Esc to close