Skip to the library

Agent governance

Comparing CLI harnesses: Codex, Claude Code, OpenCode V2, Cline and OMP

The strengths, differences and drawbacks of five coding harnesses: how to choose them, assign responsibilities and assess the real cost of agent work.

Editorial

Updated on October 12, 2026. Capabilities depend on the installed version and configuration.

Choosing a coding agent often begins with a question: which model should I use? Another decision shapes everyday work: which harness will turn that model's responses into actions on a project?

Codex CLI, Claude Code, OpenCode, Cline and Oh My Pi (OMP) can fill that role. They share the goal of working with code and tools, but organize context, permissions, extensions and execution differently. Understanding those differences helps you choose deliberately and combine tools without turning the repository into four agents competing for the same file.

This comparison separates documented capabilities from editorial recommendations. The suggested roles are a proposed operating model, rather than a benchmark of quality, speed or cost.

What a harness does and how the CLI fits

The model interprets information and proposes actions. The harness manages the working loop: it prepares context, exposes tools, executes calls, collects results and allows work to continue until there is a deliverable or a blocker.

The CLI is the terminal interface to that system. Harness and CLI are related but distinct: the same agent can have a terminal interface, an editor extension and a desktop application.

Changing interfaces therefore does not always mean changing agents. Using a similar model in two tools can also produce different experiences. Instructions, available tools and session management all matter.

Five questions help guide the choice: which models are available, how execution is controlled, how context carries forward, how the tool integrates with the project and how much the whole system costs to operate.

Codex CLI and work within explicit boundaries

Codex CLI can inspect a repository, edit files and run local tools. It supports interactive work and automation through codex exec, along with model, reasoning effort and permission selection. Official documentation.

Its sandbox sets boundaries for executed commands, with platform-specific enforcement. Approval policy determines when an action requires authorization; that is a separate layer from the sandbox. Codex sandbox.

Editorial advantage: it is an attractive candidate when you want to delegate implementation and review a concrete delivery: changes, executed commands and validation. Execution boundaries help define what the agent can do during that work.

Practical drawback: an unprepared environment can block installations, network access or tools the project requires. Resolving that requires configuring permissions and dependencies. Automatically granting full access removes part of the control that motivated the choice.

Codex also supports custom providers with a Responses API-compatible endpoint and local providers through --oss. Chat Completions support alone is insufficient: validate protocol, tools and authentication. Provider configuration.

Suggested role: bounded implementation, error diagnosis and change review that can be checked with the repository's actual tools.

Claude Code and workflow specialization

Claude Code provides project context through CLAUDE.md, skills, MCP, hooks and plugins. Hooks associate actions with execution lifecycle events. Claude Code extensions.

Its subagents can have their own instructions, tools and permissions, as well as separate context. Their requests count toward the applicable usage limits; delegation does not make work free. Claude Code subagents.

Editorial advantage: these components help turn a recurring workflow into reusable configuration. Exploration, implementation and review can have clear responsibilities.

Practical drawback: each specialization adds maintenance. Repeated instructions, unnecessary hooks and overly broad delegation can increase consumption and make the agent's behavior harder to explain.

The product is centered on the Claude ecosystem. That simplifies some decisions, but matters if you want execution infrastructure that alternates between independent providers.

Suggested role: a candidate for coordinating tasks that require splitting responsibilities and preserving project conventions. That role is an architectural choice, rather than a claim of superiority over Codex.

OpenCode V2 and provider flexibility

OpenCode's official site references V2 in its installation instructions and presents an open tool available in terminal, editor and desktop, with multiple providers and local models. OpenCode. This editorial covers the current offering; it does not assign improvements to V2 without comparing releases.

OpenCode documents primary agents, subagents and per-agent model configuration. Build and Plan have different tool access. Agents. Permissions can allow, request approval for or deny actions; the documentation describes mostly permissive defaults. Permissions.

Editorial advantage: you can assign models by task. A provider can handle exploration and another implementation without necessarily replacing the working interface.

Practical drawback: that freedom transfers decisions to the operator. Models, tool compatibility, provider limits and error behavior need evaluation. Two models appearing in the same selector does not mean they complete a task with equal reliability.

V2 has its own documentation and schema: permissions, shell and subagent replace V1 names. “Allow always” saves project-scoped approvals; subagents use their own permissions. Review these scopes before migration. V2 permissions.

Permission configuration deserves its own attention. A harness rule and an operating-system boundary are different mechanisms and should not be treated as equivalent.

Suggested role: specialized executors and controlled provider experiments. To reduce costs, measure accepted tasks and subsequent corrections rather than token price alone.

Cline and tasks that enter and leave through the terminal

Cline has an interactive CLI and headless mode. Its documentation covers pipes, JSON output, provider selection through authentication and MCP management. It also supports unattended execution through auto-approval, which can modify files and run commands. Cline CLI.

Editorial advantage: it is a practical candidate for focused assignments with a concrete input and result: analyzing a diff, explaining a failure or preparing a review. Its CLI can integrate those tasks into scripts.

Practical drawback: a seemingly small assignment can grow without boundaries. A review request can turn into implementation if its objective and permissions remain open. Changing providers also calls for reassessing output quality.

Cline’s current reference lists --auto-approve as defaulting to true and has no native shell-command allow/deny list, pointing to PreToolUse hooks instead. Do not assume confirmation will occur or that a review assignment will be read-only. CLI controls.

Headless describes execution without an interactive interface; it does not establish isolation or reliability by itself. Automation requires deciding which changes are authorized and how output will be accepted.

Suggested role: a flexible tool for bounded tasks and a second look at changes prepared by another agent. It can also handle primary work when that better suits the project; the supporting role is an operational choice.

Oh My Pi (OMP) and harness instrumentation

OMP is a coding-oriented fork of Pi. It combines support for multiple providers with built-in search, LSP, debugging, execution and hash-anchored editing tools. It also supports extensions and subagents. OMP project.

Editorial advantage: a compelling candidate for experimenting with the same model family across different tool surfaces. Its specialized tools may be especially useful for symbolic navigation, localized refactors and code inspection.

Practical drawback: additional tools do not guarantee better outcomes. LSP availability depends on the environment and language, extensions require maintenance, and its permissions should not automatically be equated with Codex's sandbox.

Suggested role: structural exploration, narrowly scoped changes and A/B testing against another harness using the same model. Benchmarks published by its maintainers must be verified on your own codebase; they are not an independent Codex comparison.

Comparing strengths and operating costs

This table summarizes the editorial recommendations above.

Harness Advantage to use Drawback to manage Suggested role
Codex CLI Local work with configurable execution boundaries Friction when permissions or environment do not fit the project Bounded implementation and validation
Claude Code Specialization through context, extensions and subagents Consumption and configuration maintenance Responsibility coordination
OpenCode V2 Flexibility to combine providers and agents Operator-owned evaluation and configuration Specialized executors
Cline CLI Interactive assignments or script integration Scope control and output acceptance Flexible support and additional review
OMP LSP, specialized editing tools and multi-provider extensibility Configuration burden and verification of execution controls Structural exploration and cross-harness experiments

These roles overlap. The extended model of choosing a harness per responsibility is covered in Advanced routing: model, effort, role and harness. The table suggests where to begin testing each tool, rather than exclusive assignments.

Combining tools without multiplying disorder

A reasonable combination starts with one task owner. That agent or person preserves the objective, decides what to delegate and accepts the result. Each executor receives an assignment with a verifiable completion condition.

For example, to fix an integration:

  1. The owner defines the expected contract and reproduces the error.
  2. An executor prepares the change in its own branch or worktree.
  3. Another agent reviews the diff with read access and looks for omitted cases.
  4. The owner checks actual execution, resolves findings and prepares delivery.

The work can be distributed across these five harnesses without using all of them. Two tools with clear responsibilities can contribute more than five open sessions with duplicated context.

Delegation across products requires explicit integration: a command, script, API or another available mechanism. A native subagent in one harness does not automatically become a session in another.

Each assignment should define the objective, authorized files, constraints, validation and expected output. That contract makes it possible to switch tools without reconstructing the whole intent of the work.

Evaluating the fit for your project

Choose representative tasks: a reproducible bug, a small modification and a code review. Prepare the same starting point and record the model, version, permissions and context for each trial.

Compare time to an acceptable result, human interventions, cost or quota consumption and defects found later. When model and harness change simultaneously, treat the result as an evaluation of the complete combination.

The useful question is how much reliable work you get for the total cost. That includes reviewing, correcting, maintaining configuration and recovering context, alongside inference charges.

Choose according to the responsibility you delegate

Codex, Claude Code, OpenCode, Cline and OMP offer different entry points to the same problem: turning an intention into executable, reviewable work.

The choice improves when the project keeps its contracts, conventions and checks outside any particular session. The harness can then change while the team still knows what needed doing, what was done and how it was verified.

The autonomy worth expanding is the kind that produces enough evidence to trust the delivery.

Keep going

← Back to the library