Preface

In 2024, the industry’s mainstream judgment was that IDEs would win—Copilot embedded in editors, Cursor growing rapidly, and “Agents” mostly just chat boxes with Shell permissions. By mid-2026, the CLI coding Agents running stably in CI, SSH, and GUI-free server environments turned out to be the terminal-based ones. According to a list compiled by Arinbjörn Kolbeinsson in July 2026, there are over 35 actively maintained CLI coding Agents alone.

However, the focus of developer community discussions in recent months has shifted from “which model is the strongest” to another question: Harness (Agent scaffolding) is the variable that determines whether a task can actually be completed. Engineering details wrapped around the model, such as system prompts, retry logic, context compression, and sub-Agent orchestration, often create larger score gaps on benchmarks like Terminal-Bench 2.1 than switching to a different base model.

This article sorts out the context of the Harness competition based on first-hand public materials and third-party rankings from June to July 2026, and provides a horizontal comparison of mainstream tools such as Claude Code, Codex CLI, OpenCode, and GitHub Copilot CLI.

What is Harness: The Layer Beyond the Model

A CLI coding Agent can be split into two parts:
1. Model: Responsible for reasoning, generating code, and understanding instructions.
2. Harness: Responsible for feeding files to the model, executing Shell commands, managing permissions, compressing context, orchestrating sub-Agents, and retrying when failures occur.

Capital and Compute pointed out the misconception in a June 2026 review: asking “which model is the best” on leaderboards is the wrong question; the correct question is “which Agent can finish the task”. For the same GPT-5.5 model, the Terminal-Bench scores can differ by several percentage points when run in Codex CLI versus another Harness.

Naman Vats’ 2026 preprint paper The Scaffold Effect further quantified this phenomenon: on the 50-task slice of Terminal-Bench Pro, fixing the model and only swapping the Harness (Goose, OpenCode, OpenHands-SDK), the cost variance is often larger than switching models. Every element in the Harness—system prompt, turn budget, retry policy, skill injection—quietly rewrites the final outcome.

Terminal-Bench 2.1: The Litmus Test for Harness Gaps

Terminal-Bench is a terminal Agent benchmark maintained by the Laude Institute, Stanford researchers, and the open-source community. Each task has an independent Docker environment, manually written reference solutions, and automated validation scripts. The mid-2026 Terminal-Bench 2.1 is a validated revised version of 2.0, retaining 89 tasks and fixing environment dependencies, resource budgets, and “instruction-test mismatches” for approximately 28 tasks, making scores better reflect actual Agent capabilities rather than benchmark bugs.

The official leaderboard (tbench.ai) requires each Agent/model combination to run at least k=5 times and take the average. As of July 2026, third-party validation results summarized by Snorkel AI are roughly as follows (overlapping confidence intervals can be considered “neck-and-neck”):

Rank Agent Model Accuracy
1 Claude Code Claude 5 Fable 83.8% ±1.2
2 Codex CLI GPT-5.5 83.1% ±1.1
3 Terminus 2 Claude 5 Fable 80.4% ±1.2
4 Cursor CLI Grok 4.5 79.3% ±1.5
5 Claude Code Claude Opus 4.8 78.9% ±1.3

A few noteworthy details:
Same model, different Harness, different scores. Terminus 2 is the reference Harness included with the Terminal-Bench project; both Claude Code and Terminus 2 use Fable 5, with scores of 83.8% and 80.4% respectively. The gap comes from Anthropic’s proprietary Harness tuning in tool calling, context management, and retry strategies.

Same Harness, scores change when swapping models, but the Harness’s upper limit is often more critical. Claude Code scores 78.9% with Opus 4.8 and 83.8% with Fable 5—model upgrades work, but Codex CLI + GPT-5.5 still ranks in the top tier alongside it, indicating that OpenAI’s Harness engineering is equally robust.

“Naked model scores” under a unified scaffold are lower. Scale’s SWE-bench Pro public leaderboard places all models in the same SWE-Agent scaffold, with the top score around 59%; while vendors’ self-reported SWE-bench Verified scores on their own Harness can reach around 90%. The 30-40 percentage point gap is the hidden workload of the Harness that the benchmark title omits.

Harness Roadmaps of Four Mainstream CLI Agents

Claude Code: Category Template with Deepest Orchestration

Anthropic’s Claude Code, released in February 2025, basically defined the “standard skeleton” for subsequent CLI Agents: Agentic loops, file/Shell tools, project memory files, permission prompts, Plan mode, Hooks, Skills, and Subagents. By mid-2026, it added experimental Agent Teams (multi-session message exchange) and a separate Agent SDK billing pool.

The strength of its Harness lies in deep orchestration: custom Subagents, worktree isolated parallelism, cross-session persistent memory, and /rewind checkpoints. The top score of Fable 5 on Terminal-Bench 2.1 aligns with the bundled strategy of “joint tuning of model + Harness”. The tradeoffs are model lock-in, closed-source Harness, and a billing model where headless/SDK usage is charged separately.

Codex CLI: Strong Counterweight for Open-Source Harness

OpenAI open-sourced Codex CLI (Apache-2.0, later rewritten with a Rust core) in April 2025, and added Goals persistence, thread-level Subagent delegation, a plugin marketplace, browser control, encrypted remote execution, and even a one-click import migration path for Claude Code configurations in the first half of 2026.

The Harness’s selling points are OS-level sandboxing (Seatbelt/Landlock), open auditability, and support for local models. It scored 83.1% with GPT-5.5 on Terminal-Bench 2.1, nearly tying with Claude Code. For teams that need to run real Shell commands in dirty repositories and independently audit Harness behavior, Codex is currently one of the only options that combines “lab-grade model access + open-source Harness + kernel isolation”.

OpenCode: Model-Agnostic Portable Base

OpenCode (maintained by the Anomaly/SST team, MIT license) is one of the most-starred Agent projects on GitHub in 2026 (over 180k stars), supporting 75+ model providers, and adopting a client-server architecture: opencode serve can run a headless service, with TUI, desktop, and IDE plugins as clients.

Its Terminal-Bench score is not independent of the model—it approaches Claude Code when paired with Opus 4.8, and approaches Codex CLI when paired with GPT-5.5. The value of its Harness lies in neutrality and portability: AGENTS.md, custom Agent/Subagent JSON, MCP, LSP, and JS/TS plugins. It is ideal for BYOK, local models, batch automation, and other scenarios where users “do not want to be tied to a single subscription”. Note that Anthropic prohibits using Claude Pro/Max subscriptions with OpenCode; Claude must be accessed via API Key.

GitHub Copilot CLI: “Lazy Default” for Platform Harness

Copilot CLI entered preview in September 2025 and achieved General Availability in February 2026, with an entry price of $10/month, making it one of the cheapest dedicated plans among mainstream products. Its Harness is deeply integrated with GitHub workflows: built-in GitHub MCP, per-repository Copilot Memory, automatic assignment of explore/plan/review/build expert Agents, and the prefix & can offload tasks to the cloud-based Coding Agent.

On the official Terminal-Bench leaderboard, Copilot CLI has not yet entered the top ranks—platform Agents excel not at maximizing leaderboard scores, but at native integration with PRs, Issues, Reviews, and Actions. In July 2026, Copilot also integrated Moonshot’s open-weight model Kimi K2.7 Code (via Azure), becoming one of the few tools that offer open-weight options in a closed-source platform Harness.

Context Compression: The Invisible Battleground of Harness

In long sessions, every step of the Agent re-injects task descriptions, related files, and historical tool outputs into the context. A 2026 preprint by Bai et al., How Do AI Agents Spend Your Money? (Stanford Digital Economy Lab / Microsoft Research), pointed out that token consumption for Agentic coding tasks can reach three orders of magnitude higher than regular code chat, and total tokens for the same task can differ by 30 times. Input tokens are the main cost driver—how the Harness “trims” context directly determines the bill.

The practices adopted by the community in 2026 roughly fall into four categories:
1. Automatic Compaction: Claude Code, Codex CLI, Copilot CLI (triggered in ~95% of sessions), and OpenCode all support automatic summarization and window restart when the session approaches its limit. What is retained in the summary (decisions, unfinished tasks, invariants) is a Harness engineering decision.
2. Tool Output Sandboxing: The popular pattern is to keep Shell/browser output in child processes and only send summaries into the conversation. A community project context-mode’s public benchmark states that a 56 KB Playwright snapshot can be compressed to 299 B for inclusion in the context.
3. Hook-Level Compressors: Tools like squeez and context-compress integrate with Claude Code, Copilot CLI, OpenCode, and Codex CLI via PreToolUse Hooks, compressing Bash output by up to ~95% while preserving exact identifiers like SHA, UUID, and ticket numbers.
4. Subagent Isolation: Splitting explore, review, and implement tasks into separate context windows to avoid cross-contamination of noise—Claude Code, Copilot CLI, and OpenCode all have this built-in. Pi takes the opposite approach: the core only retains four tools (read/write/edit/bash), with a system prompt limited to under 1000 tokens, using a “minimalist Harness” to shift pressure back to the model.

Amazon CloudWatch launched Coding Agent Insights in 2026, which can pull organizational-level telemetry for Claude Code, Codex, and Copilot—indicating that context and Harness efficiency have risen from personal tricks to engineering management-level observability metrics.

How Developers Should Choose

There is no “one-size-fits-all strongest” CLI Agent. Arinbjörn Kolbeinsson’s July 2026 conclusion aligns with Capital and Compute: Claude Code and Codex CLI have nearly identical result quality, with the 1-2-3 ranking being largely meaningless; larger swings come from whether task descriptions are clear, whether the repository has AGENTS.md/CLAUDE.md, and whether permission policies are reasonable.

You can quickly match scenarios with the right tool:

Scenario Preferred Agent Reason
Already subscribed to Claude/OpenAI/GitHub Claude Code / Codex CLI / Copilot CLI Bundled access is usually the cheapest entry point to cutting-edge models
Multi-file refactoring, large codebase debugging Claude Code, Codex CLI Top-tier Terminal-Bench scores, terminal Harness reads files more accurately
Model-agnostic, BYOK, self-hosting OpenCode 75+ providers, MIT license, client-server architecture
GitHub-centered teams Copilot CLI Native integration with PRs/Reviews/cloud offloading, $10 entry price
Auditing Harness, local models Codex CLI, OpenCode Open-source and readable; Codex adds OS-level sandboxing
Maximizing token savings Cache-first Harness like DeepSeek-Reasonix Projects report ~99.8% prefix cache hit rates for heavy usage

No matter which tool you choose, putting AGENTS.md, MCP lists, build/test commands, and review rules into your repository has more long-term value than chasing monthly leaderboards. MCP, AGENTS.md, and ACP were incorporated into the governance of the Linux Foundation’s Agentic AI Foundation in December 2025—while the Harness competition is fierce, migration costs are falling.

Summary

In mid-2026’s CLI coding Agent track, models remain a necessary component, but Harness is becoming the main battlefield for differentiation. The neck-and-neck performance of Claude Code and Codex CLI on Terminal-Bench 2.1, score drift of the same model across different scaffolds, and the huge gap between unified scaffold scores on SWE-bench Pro and vendor self-tested scores all point to the same thing: when choosing an Agent, first check whether it can stably read files, run tests, compress context, and retry correctly in your repository—then look at which model it uses.

Tool churn is fast, but the methodology of Harness engineering will last longer. Treating context as an independent discipline is a lesson that every serious development team should learn in the second half of 2026.