Harnesses compared
How Claude Code, Codex CLI, Aider, OpenHands, SWE-agent and mini-SWE-agent make each choice, from their docs, and the same task under a policy imitation of each.
Check yourself ↓ three questions and what to remember, at the end
Loading the animation…
Concept
Every mechanism in this site is a choice a real harness makes: how tool calls are written, what needs a person's approval, whether there is a sandbox, what happens when the context fills, whether there are sub-agents and hooks. The matrix below records how six public coding-agent harnesses make those choices, from their own documentation; the animation replays one task under a policy imitation of each: the simulator's settings closest to that harness's documented defaults.
A policy imitation, not the product. The model is the same scripted policy in every row, so it takes the same 10 turns everywhere, and the price is the same list price. What changes is only what the harness does around the model. That isolates the harness, and it also means the rows say nothing about how good each product is: the products differ far more in their prompts, their tools and the models they are used with than any of this shows.
What the imitation does show:
- Approvals dominate the time. The imitations that ask before shell commands or edits (Claude Code's default mode, Aider, mini-SWE-agent's confirm mode) spend most of the run waiting for the human: mini-SWE-agent asks 9 questions and takes 1 min 10 s, against 13.9 s for the SWE-agent imitation, which asks nothing. OpenHands' risk-based confirmation asks only about the deletes (2 questions).
- The sandbox stops what the questions would have let through. With no prompts inside its workspace sandbox, the Codex CLI imitation is as fast as the no-approval one, yet it is the only row in which the install and the home-directory delete are stopped (2 calls), because the simulated human approves everything.
- The tool-call format changes the tokens, a little, and the cache decides what that costs. The text-parsing imitations (Aider, mini-SWE-agent) send 7,773 tokens against 8,714 tokens for native calls, because a ReAct prompt describes the tools more briefly. At Sonnet 5.5's prices both are read from the cache (512-token minimum) and they cost about the same: $0.00815 against $0.00789. Switch the prices to the earlier Sonnet 4.6, whose minimum is 1,024, and the shorter ReAct prompts stay under it, so none of them is read from the cache and the gap widens to $0.0287 against $0.026. The ranking of two formats by cost is a property of the model's cache rules as much as of the formats.
The matrix has two more columns than the animation: the Claude Agent SDK and the OpenAI Agents SDK, the libraries many teams build their own harness with. They make the same six choices, but as options you set rather than defaults you inherit: the Claude Agent SDK is Claude Code's loop, tools, permission order and hooks as a Python or TypeScript library; the OpenAI Agents SDK gives you function tools, per-tool approval that pauses the run, guardrails, and two ways to delegate (an agent as a tool, or a handoff). Whichever you pick, the score you measure depends on these choices too: Agent Evals Explained runs one model under many harnesses and shows how far the score moves.
| Choice | Claude Code | Codex CLI | Aider | OpenHands | SWE-agent | mini-SWE-agent | Claude Agent SDKagent SDK | OpenAI Agents SDKagent SDK |
|---|---|---|---|---|---|---|---|---|
| Tool calls | Native tool use: named tools such as Read, Edit and Bash[1] | Native function calls (the API it is built on)inferred[2] | No tool calls: the model writes edits in a text edit format (diff, whole file …)[3] | Function-calling toolsinferred[4] | Configurable parsers; FunctionCallingParser recommended for models with function calling, ThoughtActionParser for text[5] | Bash only, without the tool-calling interface: commands are parsed from the model's text[6] | Claude Code's built-in tools as a library (read, write and edit files, run commands, search the web), plus your own and MCP tools[7] | Function tools from Python functions with generated schemas; hosted tools (web search, file search, code interpreter, hosted MCP); tool search over deferred tools[8] |
| Approvals | Manual (default) mode asks on first use of each tool; file reads and read-only commands need no approval; deny, then ask, then allow rules[1] | Recommended for version-controlled folders: on-request approvals with workspace-write[9] | Asks before running suggested shell commands (--yes-always says yes to all); edits are applied and auto-committed[10] | Confirmation policies AlwaysConfirm, NeverConfirm, ConfirmRisky; a security analyser rates each action's risk[11] | No approval step: runs autonomously in its environmentinferred[12] | confirm mode (the default) asks before every action; yolo runs them at once[13] | Hooks, then deny rules, ask rules, the permission mode, allow rules, and last your canUseTool callback; modes default, dontAsk, acceptEdits, bypassPermissions, plan, auto[14] | Opt in per tool with needs_approval; a pending call comes back as an interruption, approved or rejected on the RunState, then the run resumes[15] |
| Sandbox | Optional OS sandbox around shell commands, off by default; writes to the working directory, network through an allow-list; file tools stay outside it[16] | read-only, workspace-write or danger-full-access; network off by default in workspace-write[9] | None described: commands run in your shellinferred | A Docker sandbox is the recommended default: the agent's commands run in a container[17] | Commands run in a separate execution environment (a container)inferred[12] | Each action is an independent subprocess.run; no sandbox of its own by defaultinferred[6] | Permission rules are "a permission gate, not a sandbox"; the deployment guide layers a sandbox runtime, containers, gVisor or VMs[18] | Sandbox agents get a workspace; the Unix-local client "adds no OS-level confinement" on Linux, so use Docker or a hosted sandbox for untrusted commands[19] |
| Context | Auto-compaction summarises older history near the limit; /compact on demand[20] | Auto-compaction at model_auto_compact_token_limit; tool_output_token_limit caps each stored tool output[21] | A ranked repository map within --map-tokens; chat history summarised past a token limit[22] | LLMSummarizingCondenser summarises older events past max_size[23] | LastNObservations elides all but the last n tool observations[24] | A completely linear history: every step appends to the messages[6] | Claude Code's context management; sessions keep context across exchanges and can be resumed or forked[7] | Sessions keep working context across runs; a Responses compaction session compacts automatically[25] |
| Sub-agents | Each runs in a fresh context window and returns only its result[26] | On by default; the parent receives summaries, not raw intermediate output[27] | None in the pages readinferred | A task tool delegates to a sub-agent with its own conversation, which returns its response[4] | None in the pages readinferred | Noneinferred | Each runs in its own conversation, starting fresh unless it is a fork; only its final message returns to the parent[28] | Agents as tools (a manager keeps control) or handoffs (the specialist takes over the conversation)[29] |
| Hooks and checks | PreToolUse can deny a call or replace its input; PostToolUse can replace the result[30] | PreToolUse can deny a call or return updatedInput; PostToolUse can add context[31] | Lints after each edit (and tests, with --auto-test); errors go back to the model[32] | PreToolUse hooks can stop a tool call; PostToolUse, Stop and session hooks[33] | Re-queries the model up to max_requeries (3) after a format error or a blocked action[34] | A cost limit ($3 by default) and an optional step limit[13] | Hooks run before every other permission step; a PreToolUse deny applies even in bypassPermissions[14] | Input, output and tool guardrails; a triggered tripwire raises a TripwireTriggered exception for you to handle[35] |
| Imitated as | native · parallel · mode default (git status allowed) · summarising · no sandbox | native · parallel · no prompts inside the sandbox · workspace sandbox, no network · summarising | text parsing (ReAct) · one call per turn · edits allowed · shell asks · summarising | native · parallel · auto, rm asks (risky) · summarising · container not drawn (its deletes hit the container) | native · one call per turn · no prompts · clipping old results | text parsing (ReAct) · one call per turn · ask every time · no compaction | not run: a library, so its defaults are what you configure (closest: the Claude Code column) | not run: a library, so its defaults are what you configure |
The last row is a policy imitation, not the product: the engine's settings closest to each harness's documented defaults. The products do much more than these rows say, and change often.
- Claude Code: configure permissions (accessed 2026-10-07)
- OpenAI: function calling (accessed 2026-10-07)
- Aider: edit formats (accessed 2026-10-07)
- OpenHands SDK: task tool set (accessed 2026-10-07)
- SWE-agent: action parsers (accessed 2026-10-07)
- mini-SWE-agent: overview (accessed 2026-10-07)
- Claude Agent SDK: overview (accessed 2026-10-16)
- OpenAI Agents SDK: tools (accessed 2026-10-16)
- Codex: approvals and security (accessed 2026-10-07)
- Aider: options reference (accessed 2026-10-07)
- OpenHands SDK: security and confirmation mode (accessed 2026-10-07)
- Yang et al. (2024), SWE-agent, arXiv:2405.15793 (accessed 2026-10-07)
- mini-SWE-agent: the mini command (accessed 2026-10-07)
- Claude Agent SDK: configure permissions (accessed 2026-10-16)
- OpenAI Agents SDK: human-in-the-loop (accessed 2026-10-16)
- Claude Code: the sandboxed Bash tool (accessed 2026-10-07)
- OpenHands: sandboxes (accessed 2026-10-07)
- Claude Agent SDK: securely deploying AI agents (accessed 2026-10-16)
- OpenAI Agents SDK: sandbox agents (accessed 2026-10-16)
- Claude Code: manage costs (auto-compaction) (accessed 2026-10-07)
- Codex: configuration reference (accessed 2026-10-07)
- Aider: repository map (accessed 2026-10-07)
- OpenHands SDK: context condenser (accessed 2026-10-07)
- SWE-agent: history processors (accessed 2026-10-07)
- OpenAI Agents SDK: sessions (accessed 2026-10-16)
- Claude Code: subagents (accessed 2026-10-07)
- Codex: subagents (accessed 2026-10-07)
- Claude Agent SDK: subagents (accessed 2026-10-16)
- OpenAI Agents SDK: agents (multi-agent patterns) (accessed 2026-10-16)
- Claude Code: hooks reference (accessed 2026-10-07)
- Codex: hooks (accessed 2026-10-07)
- Aider: linting and testing (accessed 2026-10-07)
- OpenHands: hooks (accessed 2026-10-07)
- SWE-agent: agent configuration (accessed 2026-10-07)
- OpenAI Agents SDK: guardrails (accessed 2026-10-16)
Maths
Split a run's time into the model's calls, the tools and the human:
where is the number of questions harness asks and the mean wait for an answer (6 s here). With the same model and the same steps, is the same in every row (less the calls a sandbox stops at once), and moves only with the prompt format; ranges from 0 to 9, so it decides the ranking. The asking rows spend 38.4 s (Claude Code imitation) and 56.1 s (mini-SWE-agent imitation) waiting for the human.
Code
Each imitation is a policy for the same engine; the permission decision every row runs, cut from the vendored engine (harness.ts):
if (hits.has("deny")) return ["deny", hits.get("deny")!];
if (mode === "read_only" && !spec.read_only) return ["deny", "mode: read-only"];
if (mode === "ask") return ["ask", "mode: ask every time"];
The six policies are in chapter_configs.json (chapter harnesses), and the matrix's sources in harnesses.ts.
Check yourself
Commit to an answer before you reveal it: a wrong guess you can explain teaches more than a right one you skimmed. Every number in the answers comes from the same tested model as the chapter’s.
Reveal the answer
Answer: 9 (counted right within 10%)
It asks before each command, so it waits 56.1 s for answers, against none for the SWE-agent imitation. The number of questions decides the ranking.
Commit to a number, then reveal.
Reveal the answer
Answer: Codex CLI
Codex CLI: its workspace sandbox stops them (2 calls) without asking anything. The simulated human approves every question, so asking alone stops nothing.
Pick one, then reveal.
Reveal the answer
Answer: The Claude Code imitation
The Claude Code imitation, $0.026 against $0.0287: the shorter ReAct prompts stay under Sonnet 4.6's 1,024-token minimum and are never read from the cache.
Pick one, then reveal.