The coding agent is a component. The harness is the product.

Agent systems · evaluation · architecture · verified Jul 25, 2026

I want one runtime that can give Codex and Claude the same task, isolate their work, record every decision and tool result, select the best candidate with tests, and learn when each model is worth its cost. “Ask two agents” is not an architecture; a typed protocol, bounded authority, and reproducible evaluation are.

Status boundary. This page specifies the next flagship build and its acceptance tests. It does not claim a finished harness, benchmark win, or production deployment.

The unit of work is a contract

Each task begins as an immutable envelope: goal, repository revision, scoped paths, constraints, acceptance commands, resource budget, and a definition of done. Repo conventions belong in AGENTS.md or the provider's equivalent; the task envelope carries only what changes for this job. That keeps prompts small enough to inspect and makes a run replayable.

{
  "task_id": "auth-refresh-017",
  "base_sha": "8b14…",
  "goal": "rotate refresh tokens after use",
  "scope": ["src/auth/**", "tests/auth/**"],
  "acceptance": ["npm test -- auth", "npm run typecheck"],
  "limits": {"wall_minutes": 20, "usd": 6, "writes": "worktree"},
  "artifacts": ["patch", "test-results", "decision-log"]
}
State machine for a verified coding-agent task INGESTvalidate contract PLANDAG + risks EXECUTEisolated worktree VERIFYtests + static gates REVIEWindependent critic SELECTevidence, not eloquence MERGE GATEhuman approval PUBLISHpatch + trace + score failed or inconclusive → revise plan within remaining budget

A model response never advances the state; only typed outputs and gate results do.

Use disagreement deliberately

The simplest strong pattern is asymmetric. One agent inspects and plans; another implements without seeing persuasive prose from the first, only the task contract and accepted plan. A fresh reviewer receives the patch, tests, and original acceptance criteria. The reviewer cannot edit. This reduces shared-context anchoring and makes “looks plausible” compete with executable evidence.

Provider-neutral planner, implementer, and reviewer swimlane ROLE, NOT BRAND, DEFINES AUTHORITY ORCHESTRATOR PLANNER IMPLEMENTER REVIEWER contract + route plan + risk map patch + evidence verdict + findings Codex or Claude can fill any lane; the evaluation learns the better route by task class.

Provider assignment is a policy decision learned from results, not a permanent hierarchy.

The six components I would build

ComponentResponsibilityEvidence it must emit
Task compilerTurns an issue into the immutable contract and rejects ambiguous acceptance criteria.Validated JSON, base revision, dependency snapshot.
Workspace managerCreates a disposable worktree/container with path and network policy.Environment digest and complete filesystem diff.
Provider adaptersNormalize Codex and Claude events into one stream without erasing provider-native detail.Raw event log plus normalized trace.
Gate runnerRuns formatting, types, unit/integration tests, policy scans, and task-specific checks.Commands, exit codes, stdout/stderr hashes, durations.
RouterSelects role/model using task features, prior pass rate, latency, and marginal cost.Routing rationale and counterfactual baseline.
Replay UIShows prompt, tools, edits, retries, token/cost estimates, and final artifact as a timeline.Shareable, redacted run bundle.

How Codex and Claude plug in

Codex already supports parallel subagent workflows, repository guidance through AGENTS.md, sandbox and approval controls, and review/test-oriented workflows. Parallelism is most valuable for independent, read-heavy work; parallel writers need non-overlapping scope or separate worktrees.

Claude Code exposes a useful non-interactive adapter surface: claude -p, JSON or streaming JSON output, explicit allowed/disallowed tools, model selection, permission mode, and a maximum-turn limit. MCP can provide the same external tool contracts to either provider. The harness should preserve these native controls rather than hiding everything behind a lowest-common denominator.

Evaluation before clever routing

Start with 30–50 versioned tasks drawn from the target repositories: bug fixes, feature work, refactors, test generation, migrations, and review. Each task needs a frozen base commit and hidden behavioral checks. Report first-pass success, human-accepted success, regression rate, wall time, tokens, estimated cost, review precision, and unnecessary diff size. Run both providers on matched tasks before fitting a router.

The critical anti-metric is self-reported completion. The agent's prose is an artifact, never the label. A task succeeds only when gates pass and a human accepts the diff. Traces must scrub secrets, tool outputs need size limits, network access must be declared, and destructive or externally visible actions stay approval-gated.

Milestones that turn this page into a case study

  1. Replayable single-agent runner: one contract, one worktree, one provider, one complete trace.
  2. Cross-provider adapter: Codex and Claude produce the same normalized event schema.
  3. Independent review: blind patch review with findings mapped to test evidence.
  4. Matched benchmark: at least 30 frozen tasks with cost, latency, and accepted-pass results.
  5. Learned routing: only after the always-Codex, always-Claude, and cheapest-model baselines exist.

Primary documentation

  1. OpenAI Codex use cases: verified workflows, evaluation, and engineering patterns.
  2. OpenAI: repository guidance with AGENTS.md.
  3. OpenAI: Codex subagents.
  4. Anthropic: Claude Code CLI reference.
  5. Anthropic: Model Context Protocol.