> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Compare agent harnesses side by side

> Bring the session files your coding agents and managed agents already write, and see time, tokens, cost and how much each harness reports, in one table.

Bots are everywhere. To see what yours are doing, bring the files they
already write and compare them side by side. `evalgate harness compare` reads
each file locally, never uploads it, and never prints its content or path.

```bash theme={null}
npx @evalgate/sdk harness compare \
  --from ~/.gemini/tmp/my-app/chats/session-2026-11-27T03-12-0edf082f.jsonl --label "Gemini CLI" \
  --from ~/.codex/sessions/2026/11/27/rollout-2026-11-27T03-13-51-….jsonl --label "Codex CLI" \
  --from ~/.pi/agent/sessions/…/2026-11-27T03-13-23-436Z_….jsonl --label "Pi" \
  --from ./interactions.jsonl --source gemini-interactions --label "Gemini Interactions API"
```

```text theme={null}
Harness                  Agent                 Runs  Time   Input   Cached  Output  Requests  Tool calls  Est. cost  Coverage
Gemini CLI               gemini_cli            1     29.8s  28,648  81,775  2,557   8         10          —          11/59 (19%)
Codex CLI                codex                 1     15.6s  11,074  95,232  855     8         7           —          14/59 (24%)
Pi                       pi                    1     5.2s   12,471  0       668     5         5           $0.0158    16/59 (27%)
Gemini Interactions API  gemini_managed_agent  1     0.0s   119     0       97      —         1           —          11/59 (19%)
```

These are real runs. The three coding agents were given the same task, fixing
a discount bug so a test passes, and all three fixed it. The Gemini
Interactions API run computed the same cart total with code execution.

## Read the table

| Column | Meaning |
| - | - |
| Input | New (uncached) input tokens. |
| Cached | Input read from the prompt cache. A long session can be mostly cache. |
| Output | Output tokens, including reasoning where the harness reports it. |
| Requests, Tool calls | Model calls and tool calls; failed tool calls are shown in brackets. |
| Est. cost | The agent's own cost figure, or EvalGate's offline price table for a model it knows. |
| Coverage | How many of a run's measured fields the harness filled in. Higher means you can see more of what it did. |

A "—" means the harness does not export that number. It is never shown as 0.
Every number is self-reported by the agent's own files and is not checked
against a gateway or an invoice.

## Which files to bring

| Harness | File |
| - | - |
| Claude Code | `~/.claude/projects/<project>/<session>.jsonl` with `--source claude-session`, or its OpenTelemetry output |
| Codex CLI | `~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl` |
| Gemini CLI | `~/.gemini/tmp/<project>/chats/session-*.jsonl` |
| GitHub Copilot CLI | `~/.copilot/session-state/<id>/events.jsonl` |
| Pi | `~/.pi/agent/sessions/<cwd>/*.jsonl` |
| fx, nanocode, Eve | Their session logs or OpenTelemetry traces |
| Claude Managed Agents | OpenTelemetry spans from a Console telemetry destination |
| OpenAI Agents API | Saved trace export pages, one per line |
| Gemini Managed Agents | Saved `interactions.get` resources, one per line, with `--source gemini-interactions` |
| Vercel Agent Runs | A saved trace with `--source vercel-agent-runs` |

Most files are recognized automatically. If one is not, the error names the
`--source` values to try. `--label`, `--agent` and `--source` apply to the
`--from` before them.

## Keep the runs

The command previews by default. Add `--apply` to write the runs to
`.evalgate/runs`, then score them against an answer key with
`evalgate harness score`, or lay them out as a one-page PDF with
`evalgate harness report --view quality-vs-cost`.

`--format json` prints the same rows for scripts. The command exits 1 when
any file cannot be imported, so a comparison is never silently incomplete.

## Send the runs to your workspace

`evalgate harness upload` sends the runs in `.evalgate/runs` to your hosted
workspace, so your team sees them in one place:

```bash theme={null}
evalgate harness upload --api-key "$EVALGATE_API_KEY"
```

It needs an API key with the `runs:write` scope. Only the content-free run
record is sent: counts, timings, costs and digests, never prompts, outputs or
file contents. Each run is checked on your machine first; a file that is not a
valid run is reported and not sent. Running the command again is safe: a run
already in the workspace is reported as already stored. Runs arrive as
self-reported, the same as on your machine.

Only team-attributed runs are uploaded. A run imported with
`--attribute-by person` stays on your machine: the workspace does not yet
have the person-level opt-in and role controls that would keep one person's
usage and cost visible only to the people allowed to see it.

The command exits 1 when the workspace refuses a run, for example a different
capture under a run ID it already holds. The runs are also available from
`GET /api/harness/runs` and `GET /api/harness/runs/{runId}` with a `runs:read`
key.

## Compare groups of runs in your workspace

Once runs are in the workspace, compare whole groups of them instead of single
runs. The **Agent runs** page (`/runs`) shows each group's runs, success rate,
cost, time, quality and blocked runs, compares any two groups, and lists the
latest runs; each run opens on its own page with its measures, controls and
the rules it triggered. Unreported measures read "Not reported", never zero.
The same data is available from the API. `GET /api/harness/run-groups?by=agent` lists each agent's runs over the
last 30 days: how many passed and failed, and the average cost, time, tokens
and quality of the runs that reported them. Use `by=harness` to group by
harness label (runs without one fall back to their agent) or `by=skill` for
`name@version`. At most 200 groups are returned, most runs first;
`truncated: true` says there are more.

`GET /api/decision-briefs/runs?by=agent&baseline=codex&candidate=claude_code`
returns the bottom line for switching from one group to the other, built the
same way as the judge comparison: success rate decides first, and a switch is
recommended only once the candidate is shown to be no more than 5 points
worse on success (and on quality, when runs report it). Until then the brief
says how many more runs per side would settle it.

### Controls

Claude Code runs imported from OpenTelemetry logs also say which guardrails
stopped a tool call: how many a hook denied, how many a permission deny rule
denied, how many a person denied when asked, and which tools were blocked.
Only counts and tool names are kept, never the call's arguments. Runs from
agents that do not report who decided a tool call carry no controls.

When either group reported controls, the brief adds **Runs with a blocked
tool call** as a safety check: the share of runs that reported controls and
had at least one hook or rule block. Like success, a switch is recommended
only once the candidate is shown to be blocked no more than 5 points more
often, so a candidate whose runs report no controls cannot be shown safe.

The summaries are kept per day as runs arrive, so a comparison reads one row
per group per day however many runs there are. Both groups' runs are compared
as they are: if they worked on different tasks, the brief cannot tell.

## Runs that need a look

When a run is stored, EvalGate checks it against a few fixed rules and keeps
what it finds:

| Rule | Flags a run when |
| - | - |
| Run failed | its outcome is failed |
| Tool calls failed | 3 or more tool calls failed |
| Repeated the same tool call | 5 or more tool calls repeated an earlier one |
| Model API calls failed | 3 or more model API calls returned an error |
| The model refused | the model refused at least once |
| A guardrail blocked a tool call | a hook or a permission deny rule blocked at least one tool call |
| Cost outlier | it cost at least 3 times its agent's average over the 30 days before the run's day (once those days hold 10 priced runs) |

A measure the run did not report never triggers a rule. The comparison brief
lists these runs under **Needs a look**, most serious first, each linked to
its run. The dashboard's queue shows one item per agent and rule over the
last 7 days ("12 codex runs had tool failures"), not one per run, so a busy
fleet does not bury everything else. It appears for people who can read runs.

## Decision briefs elsewhere

The same bottom line appears where other decisions are made:

* **Experiments.** An experiment's Summary opens with the bottom line for the
  selected variant. Its pass rate counts only cases both variants completed
  and uses the experiment's own paired interval, so it agrees with the
  experiment's classification. Policy blocks count as safety, tool errors as
  stability, and cases that passed on the current variant but failed on the
  candidate are listed under **Needs a look**.
* **Releases.** In the Eval Loop, each release decision from a CI run can be
  compared with the workflow's last approved, still-valid release
  (**Compare with the approved release**). The two evaluation runs are paired
  case by case; a candidate that ran a different suite version is reported as
  not comparable, and there is nothing to compare before a release is
  approved. Test results carry no cost, so only time per case is compared.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.