JWhoIsJaneTurner Research ← All articles
Field guide

Agent harness comparison

What a harness is, which ones people actually use, how they differ from the libraries they are built on, and the new layer of tools that wrap harnesses to run them in loops, in parallel and in the cloud.

October 6, 2026Version 1.4~25 min read

What a harness is

A model by itself only turns text into text. A harness is everything wrapped around it that lets it act: the agent loop, tool definitions (read, write, edit, shell), context management, the system prompt, permissions and the interface a person works through. One survey puts it plainly: a wrapper around an LLM that gives it tools to read and write files, run commands and iterate on code autonomously.

The vocabulary is still settling, so it helps to separate four layers. The lower two are used to build agents. The upper two are run as tools.

The boundary is blurry on purpose. Some products ship as a library and a harness: the Claude Agent SDK exposes the same loop Claude Code runs, and Pi is a monorepo of reusable packages with a CLI on top. The test applied here: a product counts as a harness if work can be started on a task without the loop first being written or the tools first being chosen.

Substrate libraries: what harnesses are built from

LangChain's own taxonomy is the clearest found. It splits the space into frameworks (abstractions that make building easier), runtimes (production infrastructure such as durable execution and persistence) and harnesses (opinionated, batteries-included agents built on top). Under that scheme, most of the names people call “agent frameworks” belong below the harness line.

NameRoleCore abstractionReach for it when
LangChainFrameworkStandard components for models, tools and chains; v1.0 is built on LangGraphA common interface across providers and tools is wanted
LangGraphRuntime + frameworkStateful graph of nodes and transitions, with persistence and human-in-the-loopExplicit control over branching, looping and recovery is needed in production
CrewAIFrameworkRole-based crews of agents working through tasksFast prototyping of multi-agent workflows
OpenAI Agents SDKFrameworkAgents, handoffs and guardrailsQuick onboarding on OpenAI's stack
Google ADKFrameworkAgent Development Kit for composing agentsWork is built on Google's models and cloud
AutoGenFrameworkConversational agents exchanging structured messagesResearch on agent-to-agent dialogue
Vercel AI SDK, LlamaIndexFrameworkModel and retrieval abstractions for application codeAn agent embedded in a product, not run as a standalone tool
Temporal, InngestRuntimeDurable workflow executionLong-running agents must survive crashes and retries
Deep Agents, Claude Agent SDKHarness as libraryPlanning, filesystem and sub-agents packaged as a programmable agentA Claude Code-style agent is wanted inside an existing application
A note on CrewAI. It is often listed beside Claude Code and Cursor, but by the definition above it is a framework: the roles, tasks and tools are defined by the developer. It sits one layer down from the products in the next section.

Harness comparison

These are the harnesses that recurred across independent comparisons. The table can be filtered by licence or model strategy and scrolls sideways on small screens.

HarnessLicenceModelsWhat sets it apartExtensionCost (as reported)
Claude CodeAnthropic · CLI, IDE, webProprietaryClaude only (Anthropic, Bedrock, Vertex, Azure)Deepest feature set: sub-agents, agent teams, hooks, scheduling, cloud sessionsMCP, skills, plugins, hooks, mods (TypeScript, Oct 2026)$20/mo Pro; heavy use often $100–200/mo. Alternatively billed per token through an Anthropic API key, or through Bedrock, Vertex or Azure by setting provider environment variables (for example CLAUDE_CODE_USE_BEDROCK or CLAUDE_CODE_USE_VERTEX)
Codex CLIOpenAI · CLI, IDE, web, desktopApache 2.0GPT-5 family by default; Ollama supported; community routes to othersRust core; OS-level sandboxing; one harness behind every Codex surfaceApp Server (JSON-RPC), MCP server, codex exec, TypeScript SDKIncluded with ChatGPT plans; BYOK free
Cursor 3Anysphere · IDE / agent workspaceProprietaryMulti-model plus its own Composer 2Agents Window to run many agents; /best-of-n across models in worktrees; cloud agents on VMsSelf-hosted cloud agents for Enterprise; design-mode browserFree; $20 Pro; $60 Pro+; $200 Ultra
PiMario Zechner / Earendil · CLIMIT15+ providersDeliberately minimal: four tools, a system prompt under 1,000 tokens, branching JSONL sessions. No built-in sub-agents or plan modeTypeScript extensions, skills, prompt templates, npm/git packages; MCP via Codemode since Pi 1.0 (Oct 2, 2026)Free; provider billed directly
OpenCodeAnomaly · CLI, desktopMIT75+ providers; optional managed “Zen” modelsClient/server design: sessions survive disconnects and can run remotely or in DockerDocker sandboxing; phone and browser remote accessFree BYOK; $10/mo Go plan
Gemini CLIGoogle · CLIApache 2.0Gemini onlyConsumer free and Pro access ended June 18, 2026; repository remains Apache 2.0 with public prompts and memory logic. Successor: Antigravity CLI (closed source)None to speak of (Gemini-only)Paid API keys or enterprise licences only
AiderPaul Gauthier · CLIApache 2.0100+ via LiteLLMGit-first: every AI edit becomes a commit. Closer to pair programming than autonomyCommunity forks; any LiteLLM providerFree; provider billed directly
GooseBlock · CLI, desktopApache 2.015+ providers, local modelsMCP-native with a large extension catalogue and sub-agents70+ MCP extensionsFree; provider billed directly
AmpAmp Inc. (from Sourcegraph) · CLIProprietaryClaude, GPT and Gemini via modes (Smart, Deep, Oracle); no direct BYOKMode-based model routing; went CLI-only in Feb 2026JetBrains, Neovim, Zed integrationsPass-through at cost; free daily allowance
FactoryFactory AI · cloud, IDE, CLIProprietaryClaude, GPT, Gemini, open models, BYOKEnterprise “Droids” for code, review, docs and tests on persistent cloud machinesGitHub, GitLab, Jira, Linear, Slack, PagerDuty$20/mo; enterprise by model multiplier
Command CodeCommandCodeAI · CLIProprietaryClaude, GPT, Gemini, Grok, DeepSeek, Qwen, Kimi, open modelsLearns personal taste from accepts and rejects, stored as readable markdown. Very early (first release May 2026)IDE extensions (early)$1/mo open models; $15/mo frontier models
Prices and star counts are snapshots. Plans, free tiers and model routing changed repeatedly during 2026, so figures should be confirmed on the vendor's page before being relied on.

Limitations of each harness

Every harness above trades something away. The table groups the documented limitations into access and cost, capability gaps, and operational or safety concerns. Several entries rest on one reviewer's test or one report, and those are worded as such. Where a limitation has since been fixed, only the current state is listed.

HarnessAccess, cost and lock-inCapability gapsOperational and safety
Claude CodeClaude models only; closed source. The $20 Pro tier was described as limited, with sustained use typically needing the $100+ tier; the subscription is not the only billing route, since cloud-provider and API-key billing are also supported. Subscription access was restricted to the official client in January 2026, so third-party harnesses cannot draw on it.Model choice is limited to Claude. Project instructions (CLAUDE.md) must be kept accurate by hand to stay useful.Highest token use in one four-harness test (741k tokens per task) and called the heaviest spender in another comparison. One CLI process per invocation: about 230 MB resident and 73–94 MB of private memory per concurrent child in a mock-model test, with public reports of memory leaks and idle processes that never exit.
Codex CLIDefault models are OpenAI's; other providers depend on community routes. The VS Code extension is closed. Usage is subject to rolling five-hour limits on subscription plans.Described as less consistent on longer task chains (a single author's impression, not a measurement).Slowest median run in one test (245 s against 123 s for Claude Code). The sandbox ships with network access off, so web access needs workarounds.
Cursor 3Closed source. Usage-based pricing was described as confusing, and a public apology was issued over earlier pricing changes.Agents still require developer review; the agent-first workspace does not remove the verification step.Cloud-agent reliability problems and environment-setup failures are documented.
PiMIT licensed, with the provider billed directly.Four built-in tools. Sub-agents and plan mode are absent by design (the oh-my-pi fork adds them). MCP arrived only with Pi 1.0 on October 2, 2026, through a Codemode sandbox. Long-running support is a separate experimental package (Pi Durable). TypeScript only.No permission prompts and full system access by default. No turn, deadline or budget limit setting was found in the SDK documentation. Cache hit rates were variable in a community benchmark.
OpenCodeMIT licensed. Claude Pro and Max subscriptions cannot be used after the January 2026 enforcement, so an API key is required. The supported billing method depends on the provider.Quality depends entirely on the model behind it. Lowest pass rate in one four-harness test (46.7%).No OS-level sandbox. Heavier resource use than expected in one review.
Gemini CLI and Antigravity CLIGemini CLI stopped serving free, AI Pro and Ultra users on June 18, 2026. It remains available through paid API keys and enterprise licences, and the repository stays Apache 2.0. The successor, Antigravity CLI, is closed source and billed by consumption.Gemini models only. The successor adds subagents, hooks and skills, but community feedback reported missing functionality compared with its predecessor.The successor was reported to consume quota quickly with no cost controls. Roughly 432K tokens per task was reported for the earlier tool.
AiderApache 2.0; provider billed directly.An edit-centred, git-first workflow, not broad agent orchestration. Automatic testing only runs when the test command and auto-test option are configured.Pair-programming style keeps a person in the loop, so it is a weak fit for unattended runs.
GooseApache 2.0; provider billed directly.Not zero-config: providers and models must be set up before the tool is productive. IDE support (VS Code, JetBrains) trails Claude Code, and the desktop interface is secondary to the terminal.Reliability drops on long tool chains with smaller local models. A vendor red-team exercise showed a poisoned shared recipe compromising a laptop. Permission settings need care because of autonomous shell access. No authoritative benchmark exists.
AmpClosed source. No direct bring-your-own-key option; models are reached only through modes. Enterprise use carries a 50% markup on pass-through pricing.CLI only since February 2026: the VS Code and Cursor integrations were removed.Not documented in the sources read.
FactoryClosed source. Pricing is by model-dependent multipliers at enterprise level.Aimed at enterprise software-lifecycle automation (Droids for code, review, docs and tests) rather than individual use.Not documented in the sources read.
Command CodeClosed source; a very young product (first release May 2026).IDE extensions were early, with some non-functional at release. Personalisation depends on the vendor's own learned model.Little operating history to judge reliability from.
Limitations that cut across harnesses. Answer quality was not measured in any of the sources, so speed and cost comparisons say nothing about correctness. Generation is no longer the bottleneck; verification of the output is. Subscription plans are increasingly tied to the vendor's own client, so a harness that works on an API key may not work on a consumer plan. Vendor policies and pricing changed several times in 2026, and an entry here can age within months.

Where harnesses actually differ

The same model can feel very different in two harnesses. A small hands-on test of Claude Code, Codex, OpenCode and Pi found large differences in speed, token use and cost per successful task on the same work, which supports a point several authors make: the harness, not just the model, decides how fast, safe and expensive the result is. The figures are illustrative, since they came from one reviewer's run.

Axis 1

Model strategy

Locked harnesses (Claude Code, Gemini CLI, Codex by default) are tuned to one vendor's models. Open ones (OpenCode, Pi, Aider, Goose) trade tuning for freedom to switch.

Axis 2

Prompt and tool surface

Pi ships four tools and a tiny published prompt. Claude Code ships ten or more tools plus sub-agents and hooks. Less surface means fewer tokens and more transparency; more means more built-in capability.

Axis 3

Safety posture

Codex leans on OS-level sandboxing (Seatbelt, seccomp). Pi runs with full system access and no prompts by default. OpenCode has no OS sandbox. The choice depends on where the agent will run.

Axis 4

Extensibility

Claude Code: skills, plugins, hooks, MCP. Pi: TypeScript extensions and packages. Codex: an embeddable App Server protocol that JetBrains and Xcode use.

Axis 5

Where it runs

Local terminal, IDE, desktop app, or a cloud VM to which work is handed. Cursor 3, Codex and Claude Code all now offer a cloud mode.

Axis 6

Embeddability

Whether it can be driven from code. Codex (SDK, exec, App Server), Claude (Agent SDK) and Pi (SDK) can; this is what makes the next layer possible.

Axis 7

Process footprint

A CLI call starts a full runtime each time. In a mock-model test, each concurrent Claude Code CLI child added about 73–94 MB of private memory, while each concurrent Pi session in a shared process added about 0.1–4 MB. See the next section.

Axis 8

Cache discipline

Where the harness places prompt-cache breakpoints and how stable it keeps the prefix. See the caching section.

Process footprint: CLI versus library

Most of the harnesses above are Node or similar runtimes wrapped as a command-line tool. Each time one is invoked as a command, a new process is started with its own runtime, loaded tool definitions, session state and any MCP servers it launches. For one person in one terminal this is invisible. For a script, a CI job, an orchestrator or a service that invokes a harness many times at once, the memory cost accumulates quickly. The question measured here was narrow: what does each additional concurrent request cost in memory when a harness runs as a subprocess, compared with when it runs as a session inside the host process?

Subprocess per request

73–94 MB of new memory per concurrent request

Claude Code CLI children, launched one per request, each added about 73 MB with a trivial reply and about 94 MB when the request had read twelve large files. The figure grows with the context a child holds.

Sessions in one process

About 0.1–4.0 MB per concurrent session

Pi sessions hosted in a single Node process grew the process from about 133 MB to 200 MB at 600 trivial concurrent requests, and to 2,510 MB at 600 requests that each read the twelve files.

Reading the numbers

Resident size misleads

Each child reported 226–251 MB resident, but most of that is one binary image shared between children. At 28 children the resident figures sum to 6.2 GB while the machine actually used 2.0 GB.

How it was measured, and why

  • A mock model. A local server that imitates the Anthropic Messages API stood in for the model. This isolates harness overhead from model behaviour, avoids credentials and paid calls, and lets every reply be held open for 30 seconds so that all N requests are provably in flight at the same moment. The mock’s own counter was required to equal N before each sample was taken, and it did at every level. One level (400 sessions with file reads) was re-run after the measurement script’s own polling request to the mock failed; the re-run completed with no errors.
  • Subprocess side. The Claude Code CLI (version 2.1.292, the binary bundled with the Claude Agent SDK) was started once per request in the way the SDK starts it, with streaming JSON over stdin and stdout, a clean environment and only the Read tool enabled. Levels ran from 1 to 28 concurrent children.
  • In-process side. The Pi coding-agent SDK (version 1.0.4) created N sessions inside one fresh Node process per level, with in-memory session storage, compaction off, no resource discovery and only the read tool, against the same mock. Levels ran from 1 to 600.
  • Two workloads. In the trivial workload the model returned one short streamed reply. In the tool workload the model first asked to read twelve text files of about 117 KB each (about 1.4 MB of tool output) and then replied, so the harness had to hold real tool results in memory.
  • Three memory readings. Resident size (RSS) counts a shared page once in every process that maps it, so it overstates the total when children share a binary. Proportional size (PSS) divides each shared page among the processes sharing it. Private anonymous memory is what one more process adds that no other process holds. System memory used (total minus available, read before and after the children started) gives an independent cross-check, and its slope against N is the marginal cost per child.
  • Environment. One Linux sandbox with 2 vCPUs and 8 GB of RAM on x86-64. One run per level; the per-child values were stable across levels, which is the evidence that the readings are not noise.

Result: one process per request

Concurrent childrenRSS per childPSS per childPrivate per child (trivial)System memory used (trivial)Private per child (12 file reads)System memory used (12 file reads)
1232 MB230 MB80 MB67 MB97 MB88 MB
2231 MB154 MB79 MB154 MB96 MB208 MB
5232 MB109 MB79 MB374 MB96 MB570 MB
10228 MB91 MB76 MB750 MB93 MB1,078 MB
20228 MB82 MB74 MB1,470 MB94 MB1,864 MB
28226 MB78 MB72 MB2,034 MB94 MB2,700 MB

Memory with all N requests in flight. System memory used is the increase over the machine’s memory before the children started.

  • Resident size is flat and large. It stayed between 226 and 251 MB per child at every level. This is the figure a process monitor shows, and it is what a naive estimate would multiply by N.
  • Most of that is shared. About 154 MB of each child is the executable image (the bundled binary is 240 MB on disk), mapped from the same file by every child, so it is paid for once. PSS therefore falls from 230 MB per child with one child to 78 MB with 28.
  • The marginal cost is the private part. The slope of system memory against N is 72.7 MB per child in the trivial workload and 94.3 MB in the tool workload. An idle, initialised child with no request yet added 61.2 MB, so a trivial request in flight added about 11.6 MB more and twelve large file reads added about 33.1 MB more.
  • Sizing follows from that. By linear extrapolation, 100 concurrent children would need roughly 7.1 to 9.2 GB beyond the shared image, and more as conversations lengthen. These figures are floors for this version and workload, not constants.

Result: sessions inside one process

Concurrent sessionsProcess RSS (trivial)Growth over empty process (trivial)Process RSS (12 file reads)Growth over empty process (12 file reads)
1137 MB2.9 MB141 MB8.8 MB
10135 MB3.9 MB190 MB55.1 MB
50142 MB8.3 MB388 MB248.3 MB
100146 MB10.1 MB636 MB509.7 MB
200158 MB21.4 MB1,116 MB981.7 MB
400179 MB44.9 MB1,976 MB1,844.1 MB
600200 MB68.8 MB2,510 MB2,382.5 MB

Memory of the single host process with all N sessions in flight. The empty process (Node plus Pi loaded, no sessions) was about 133 MB in every run.

  • A fixed base, then slow growth. Loading the runtime and Pi cost about 133 MB once. In the trivial workload each additional in-flight session added about 0.1 MB; at 600 sessions the whole process was 200 MB.
  • Tool output is the dominant cost. With twelve file reads per session, growth was about 4.1 MB per session, because each session holds roughly 1.4 MB of tool results as strings in the same heap. At 600 sessions that came to 2,510 MB. A session is a message array, a stream parser and an open HTTP request The code and the runtime are shared by all sessions.
  • Memory is released only partly and lazily. In the trivial run, resident size fell by 15 MB once the replies finished and the sessions were disposed; a JavaScript runtime does not always hand freed heap back to the operating system at once.
  • No errors. Every one of the 2,722 sessions completed without error.
What the comparison does and does not establish. At 28 concurrent requests the subprocess approach had used 2.0 GB with trivial replies and 2.6 GB with the file reads, against 142 MB and 388 MB for 50 sessions in one process in the same two workloads. The mechanism is the difference between duplicating a runtime per request and sharing one. It says nothing about model latency, number of turns, token cost or answer quality, because the model was a mock; those need a real model and a fixed task. The in-process sessions also share fate: a crash, a memory leak or a blocked event loop in the host affects all of them, which separate processes would contain. The Pi runs used a minimal configuration, so a default product install that discovers skills, extensions and MCP servers would add to the base. One run was made per level on one machine.

Ways to call a harness, and what each costs in processes

HarnessProgrammatic routeProcess modelMany callers
PiCLI, or library: createAgentSession() from @earendil-works/pi-coding-agentIn-process as a library; one process per call as a CLIThe library route was the one measured above. One AgentSessionRuntime can create, switch and fork sessions inside a single process, and SessionManager.inMemory() avoids session files. The CLI was not measured separately; as with any Node CLI, one runtime is started per call. In the SDK, the MCP, codemode and tool-search extensions are not loaded unless added explicitly.
Claude Codeclaude -p in scripts; Claude Agent SDK (Python, TypeScript)Subprocess either way: the SDK spawns the CLI and communicates over stdin/stdoutThe SDK does not remove the per-process cost. Its one-shot query mode starts and stops a process per call; client mode keeps one process across several queries. Pooling and reusing clients is preferable to spawning per task.
Codex CLIApp Server (JSON-RPC), codex exec, MCP server, TypeScript SDKLong-lived server via App Server; one process per call via execOpenAI describes the App Server as a long-lived process hosting many Codex threads, the shape suited to concurrency. It is preferable to repeated exec calls. Its footprint was not measured here.
OpenCodeClient/server: clients attach to a running serverLong-lived serverThe server keeps sessions alive across disconnects, so many clients share one runtime. Its footprint was not measured here.
Managed AgentsREST APIRemoteNo local process. The provider carries the footprint and bills session time instead.
Rule of thumb. The measurements point to a simple sizing rule. A subprocess harness costs its shared image once plus a private share per concurrent request, which here was roughly 70 to 95 MB and rises with the amount of tool output held. An in-process session costs a base process once plus about 0.1 MB to 4 MB per concurrent session in these workloads. Where a harness will be invoked more than a few times at once, a shared runtime is therefore advisable: a library call in the host process, a long-lived server, or a hosted service. Spawning a CLI per task is best reserved for low concurrency, with an idle timeout so that abandoned processes do not accumulate.

Prompt caching and cache breakpoints

An agent resends nearly the same prompt on every step: tool definitions, system prompt, project instructions, then a conversation that grows with each tool result. Prompt caching lets the provider reuse its work on the unchanged beginning of that prompt, so that only a fraction of the normal input price is paid for it and the wait for the first token is shorter. A cache breakpoint is a marker on a block of the prompt that says “cache everything up to and including here”. For a long-running coding agent, the difference between good and bad breakpoint placement is often the largest line in the bill.

How breakpoints work on Anthropic's API

Cached prefix, left to right. Each marker is a breakpoint; the new turn is always processed fresh.

  • Prefix order is fixed: tools, then system prompt, then messages. A change at any point invalidates everything after it. Edit one tool definition and the whole cache goes cold.
  • Up to four explicit breakpoints per request. Automatic placement can also be requested, where the breakpoint sits on the last cacheable block and moves forward as the conversation grows; that uses one of the four slots.
  • Writes only happen at breakpoints, and a lookup checks about 20 blocks back from each one. In a long agent turn with many tool calls, an old entry can fall outside that window, so long sessions need a second breakpoint further back.
  • Lifetime: five minutes by default, refreshed each time the entry is read; one hour at a higher write price. Pricing as published: writes cost 1.25× the base input price (2× for the one-hour option) and reads cost a small fraction, 0.1× on most models and lower on some.
  • Minimum size: a prefix below the model's minimum (512 tokens on the current Sonnet and Opus models, more on older and smaller ones) is silently not cached.
The classic mistake. Putting the only breakpoint on a block that contains something that changes every request, such as a timestamp or the user's newest message. The prefix hash differs each time, so the write premium is paid and no read ever occurs. Breakpoints belong on the last stable block.

Why it matters when choosing a harness

The harness decides what goes in the prefix, in what order, and where the markers go. Two harnesses on the same model can differ several-fold in cached share and in total tokens processed. Things to look for:

  • Static content first, dynamic content last; dates and file status injected into messages rather than the system prompt.
  • A tool list that stays fixed for the session. Adding one MCP tool mid-conversation invalidates the cached history, which is why Claude Code defers unused tools as lightweight stubs.
  • No model or reasoning-level switching mid-session; caches are per model.
  • Breakpoints anchored on the stable head (tools and system prompt) as well as the growing tail.
  • Cache read and write token counts exposed in usage output, so that it can be verified whether caching works.

What each harness does, as far as is documented

HarnessApproach to breakpointsNotes
Claude CodeExplicit cache_control layered static to dynamic: system prompt, tool definitions, project instructions (CLAUDE.md), then conversationTools are locked at session start. Changing tools, switching model or editing CLAUDE.md breaks the cache. Dynamic details travel as system reminders inside messages. Compaction reuses the cached prefix.
Claude Agent SDKInherits Claude Code's loopNo separate documentation was found; the same layout and pitfalls are assumed.
OpenCodeAnthropic-style providers: markers on the first two system messages and the last two non-system messages. OpenAI-style providers: a cache key set to the session IDOpt-in setCacheKey option for providers that do not cache automatically. Its larger stable prefix (about 6,300 tokens in one benchmark) warms the cache early.
PiHistorically anchored on the last one or two messages only, a rolling window; the stable head did not get its own markerThe oh-my-pi fork reported hit rates well below competitors for this reason and fixed it in version 18.2.1 by anchoring on the system prompt and last tool definition. The version in use should be checked. Pi's very small prefix (about 1,100–1,400 tokens) also leaves little to cache. Pi 1.0 (October 2, 2026) added cache warming for Anthropic models, which postdates these findings.
Codex CLINo manual markers on OpenAI models: prefix matching is automatic, with a session-level cache key for routingNewer OpenAI models add an optional explicit mode and a configurable lifetime. Current OpenAI documentation should be checked for the model in use.
Gemini CLIAutomatic caching on the provider sideNo breakpoint control is exposed.
Cursor, Amp, Factory, Aider, GooseNot publicly documentedCache read and write tokens can be measured through a proxy.
Cache-hit percentage is a poor efficiency metric on its own. In one head-to-head benchmark OpenCode reached an 84.8% cache hit rate against Pi's 48.9% on the same task, yet Pi sent far fewer input tokens overall (about 27,000 versus 70,000 across a two-turn task), so its total cost was still lower. A large, stable boilerplate prompt inflates the hit rate without making anything cheaper. Uncached input tokens and dollars should be compared rather than percentages. That benchmark was a single community run on OpenAI-style automatic caching, so it is illustrative.

Caching and the harness of harnesses

The wrapper layer can help or hurt. A loop that restarts the agent with fresh context every iteration, as ralph-orchestrator does by design, pays a cold prefix on each pass unless the next iteration begins inside the cache lifetime and rebuilds the same prefix byte for byte. A fleet of N parallel agents on the same repository writes N separate cache entries unless they share an identical prefix. Hosted runtimes manage this but cannot be tuned. This is an inference from how the mechanism works, not a measured result, so cache read counts should be checked on real runs before it is relied upon.

Practical habits include keeping the prefix identical across runs (same tools, same order, same instructions), using the one-hour lifetime for work that pauses between steps, placing volatile content at the end, and logging cache read and write counts on every call.

The harness of harnesses

Once a harness can be driven programmatically, the next step is obvious: write something that starts it, watches it and restarts it. These tools do not replace Claude Code or Codex; they treat them as workers. They are grouped here by what they add.

1

Loop wrappers: keep one agent going until it is done

ralph-orchestrator is the clearest example. It implements the “Ralph Wiggum” technique: run the same agent again and again against a task until it reports completion or hits an iteration limit. It is a Rust tool (MIT) that wraps whichever CLI is already in use: Claude Code, Codex, Gemini CLI, Amp, Copilot CLI, OpenCode, Pi, Kiro and others. It adds hats (specialist personas that hand off through events), backpressure gates (tests, lint and type checks that reject unfinished work), persistent memories and tasks, and a Telegram channel for asking a human.

The design idea worth noting is backpressure: instead of trusting the agent's claim that it is finished, the wrapper makes the environment say no.

Also here: hand-rolled while true loops around claude -p or codex exec.
2

Parallel fleets: many agents, isolated worktrees

A human assigns several tasks; the tool gives each agent its own git worktree so they do not collide, then shows status and diffs for review. Three to ten agents is the range commonly reported as workable on one machine. The bottleneck moves from generating code to verifying it.

Examples: Claude Squad (MIT, Claude Code, Codex, Aider, Gemini), Conductor (proprietary, Claude and Codex), dmux (MIT, 11 backends), Vibe Kanban, amux, Kilo Code's Agent Manager. Cursor's Agents Window and /best-of-n are the same idea built into a harness.
3

Hierarchies: roles, supervisors and merge queues

Gas Town (MIT) models an engineering org: a Mayor coordinates, Polecats do the work, a Witness and Deacon watch for stuck agents, and a Refinery runs a merge queue. State lives in git-backed hooks and a structured issue tracker called Beads so work survives crashes. Heavier than a fleet manager, aimed at running many agents continuously.

Also here: Claude Code Agent Teams (experimental; teammates share a task list and message each other) and Factory's multi-Droid setup.
4

Hosted runtimes: hand over the sandbox too

The provider runs the harness, the sandbox and the session log. Work is assigned, and a pull request or result is returned later. This is where vendors are putting the most effort in 2026.

Examples: Claude Managed Agents, Claude Code on the web, Codex cloud, GitHub Copilot coding agent, Google Jules, Devin, Cursor cloud agents.
Why the layering matters. Each tier assumes the one below can be started non-interactively and observed. A harness with a headless mode, a stable protocol and readable session logs is easy to wrap; one that only works in a GUI is not. The process model matters too: a wrapper that spawns a CLI per task multiplies the footprint described above. This is a practical reason to check embeddability (axis 6) before a harness is standardised on.

Anthropic's agent products

Anthropic now sells several things that touch this stack at different levels, so it is worth separating them. “Anthropic's new Agents” is read here as the Managed Agents line, with the Agent SDK and Claude Code features beside it.

Harness

Claude Code

The reference harness. Recent additions include agent teammates (agent.spawn), a background “side agent” that monitors sessions, and mods: TypeScript functions that can rewrite prompts, add UI or replace built-in features (October 1, 2026).

Harness as library

Claude Agent SDK

Python and TypeScript. Runs the Claude Code loop by spawning the bundled CLI as a subprocess of the host application, with built-in file and shell tools, skills, sub-agents, MCP, session resume and permission controls. The loop, the sandbox and the session store are operated by the host’s own infrastructure.

Hosted harness of harnesses

Claude Managed Agents

A hosted REST API (public beta since April 8, 2026). An agent (model, prompt, tools, MCP, skills) and an environment (a configured cloud container) are defined, and sessions that exchange events are started. Anthropic runs the loop, sandbox and durable log. Reported pricing: standard token rates plus $0.08 per active session-hour.

Managed Agents also carries the features that look most like orchestration: outcomes (a separate grader agent checks work against a rubric and the agent iterates), multi-agent coordination (a lead delegates to specialists on a shared filesystem, auditable in the Console) and memory with a scheduled “dreaming” pass that curates it. Per the launch coverage, outcomes, multi-agent and memory were research-preview features needing separate access at the time of checking. Anthropic's stated guidance is to prototype locally with the Agent SDK and move to Managed Agents for production.

Compare this with ralph-orchestrator. Ralph wraps any CLI that is run locally and uses tests as the stop condition. Managed Agents wraps Anthropic's harness, hosts it, and uses a grader agent as the stop condition. Same shape, opposite trade: portability against convenience and lock-in.

Choosing

NeedStart withWhy
The most capable out-of-the-box coding agentClaude Code or Codex CLIDeepest tooling from the model vendors themselves; both embeddable
Switching models freely or running local onesOpenCode, Pi, Aider or GooseOpen source, many providers, no vendor lock
A small, inspectable harness to modifyPiFour tools, public prompt, extension packages
An IDE-centred workflow with parallel agentsCursor 3Agents Window, worktrees, cloud handoff
Strong sandboxing by defaultCodex CLIOS-level isolation on macOS and Linux
A custom agent inside a productClaude Agent SDK, Deep Agents or LangGraphHarness-as-library or runtime, depending on how much control you need
Many concurrent callers on one machinePi as a library, Codex App Server or OpenCode serverOne shared runtime instead of a process per call
Low cost on long sessionsA harness with a stable prefix and breakpoints on the stable headCached reads are a fraction of the base input price; see the caching section
An agent to grind on a task unattendedralph-orchestrator around the chosen harnessTest-gated loop, harness-agnostic
Several agents in parallel on one repoClaude Squad, Conductor, dmux or Agent TeamsWorktree isolation and status view
No infrastructure to runManaged Agents, Codex cloud or Cursor cloud agentsProvider hosts sandbox and state

One pattern holds up across sources: use the thinnest layer that does the job. Most teams that reach for a graph runtime or a fleet manager first would have been served by a harness in a loop.

Sources and caveats

How this was compiled. From public documentation, vendor posts and third-party comparisons read on October 6, 2026. Most of these tools were not run first-hand. The performance and caching comparisons cited are single community or reviewer runs and are illustrative, not benchmarks. The memory figures in the process-footprint section were measured for this article against a mock model on one machine, one run per level, and will vary by version, platform and workload. Licences, prices and model support change often; verify before deciding. This guide will be versioned as the landscape moves.
  1. Environment variables (Claude Code documentation): provider-selection variables for Bedrock and Vertex. The Azure (Microsoft Foundry) route uses separate variables that were not confirmed for this page.
  2. Coding Agent Harness Comparison 2026 (TechStackups): harness definition, vendors, licences, pricing.
  3. Agent frameworks, runtimes and harnesses, oh my (LangChain): the framework / runtime / harness taxonomy.
  4. Best AI Coding Agents in 2026: I tested Claude Code, Codex, OpenCode and Pi (Tensorlake): hands-on speed, token and cost comparison.
  5. pi.dev deep dive (urandom.io): Pi's design and package structure.
  6. Unlocking the Codex harness (OpenAI): App Server and embedding options.
  7. Cursor 3 (DataCamp): Agents Window, cloud agents, Composer 2, pricing.
  8. ralph-orchestrator README (GitHub, mikeyobrien): hats, backpressure, supported backends.
  9. Gas Town (GitHub, steveyegge): roles, hooks, Beads.
  10. The Code Agent Orchestra (Addy Osmani): tiers of multi-agent orchestration.
  11. Best multi-agent coding orchestrators in 2026 (amux): orchestrator licences and backends.
  12. Claude Agent SDK and Managed Agents (HatchWorks) and Claude Managed Agents explained (LowCode Agency): components, pricing, status.
  13. Code with Claude 2026: new agent features (MindStudio): outcomes, multi-agent orchestration, dreaming.
  14. Anthropic release notes, October 2026 (Releasebot): Claude Code mods and agent updates.
  15. LangGraph vs CrewAI vs AutoGen vs OpenAI Agents SDK (AIAgentRank): framework abstractions.
  16. Prompt caching (Anthropic docs): breakpoints, prefix order, lookback, lifetimes, pricing.
  17. How prompt caching actually works in Claude Code (Claude Code Camp): layering and cache-breaking events.
  18. Benchmark: Pi vs OpenCode vs Codex token overhead, prompt caching, MCP and cost (Pi discussion #6646) and oh-my-pi issue #10560: Pi cache behaviour and breakpoint anchoring.
  19. How does prompt caching work across models? (OpenCode forum): OpenCode breakpoint placement and setCacheKey.
  20. Prompt caching (OpenAI docs) and OpenClaw prompt caching reference: automatic caching on OpenAI and Gemini.
  21. Pi SDK docs: createAgentSession and in-process sessions. Inside the Claude Agent SDK: the SDK spawns the CLI as a subprocess. Claude Code issue #11122: per-instance memory and idle processes.
  22. Best AI Coding Agents in 2026 (Firecrawl) and Claude Code vs Codex CLI vs Aider vs OpenCode vs Pi vs Cursor (thoughts.jock.pl): cost, usage-limit and consistency caveats.
  23. Goose by Block review (DEV Community): Goose setup, reliability and security caveats.
  24. Pi coding agent pulls a 180 and adds MCP support (The Register) and Pi 1.0 (Techzine): MCP, Pi Durable, cache warming.
  25. Transitioning Gemini CLI to Antigravity CLI (GitHub discussion): June 18, 2026 change in access.
  26. Anthropic cracks down on unauthorized Claude usage by third-party harnesses (VentureBeat): subscription access and third-party harnesses.
  27. Measurements run for this article: a local mock of the Anthropic Messages API, Claude Code CLI 2.1.292 launched as one subprocess per request, and the Pi coding-agent SDK 1.0.4 hosting sessions in one Node process; Linux sandbox with 2 vCPUs and 8 GB of RAM. Method and limits are described in the process-footprint section.