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

# Compare two agents in 2 minutes

> Give Claude Code and Codex the same task on the same repository, then compare what they did and what it cost

Start two runs on the same prompt and repository, one with Claude Code and one with Codex, then read them side by side.

You need the CLI installed and `TRACKS_API_KEY` set, see [Quickstart with the CLI](https://docs.tracks.alpic.ai/quickstart-cli.md), and a balance above \$0.

**1. Start both runs**

```bash theme={null}
PROMPT="Add a tool named get-weather that takes a city and shows its current temperature in a new view. Then run npm run build and fix any error."
REPO=https://github.com/alpic-ai/apps-sdk-template

CLAUDE_RUN=$(tracks runs create "$PROMPT" \
  --harness claude-code --model claude-sonnet-5-5 \
  --repository "$REPO" --setup "npm install" --budget 5 | jq -r .id)

CODEX_RUN=$(tracks runs create "$PROMPT" \
  --harness codex --model gpt-5.5 \
  --repository "$REPO" --setup "npm install" --budget 5 | jq -r .id)
```

Each command returns right away with the run's `id`. Both runs get the same repository, the same setup script and the same \$5 budget, so only the agent differs.

**2. Follow them**

Watch one agent work as it happens:

```bash theme={null}
tracks runs follow "$CLAUDE_RUN" --events
```

Or just wait for both to end:

```bash theme={null}
tracks runs follow "$CLAUDE_RUN" > /dev/null &
tracks runs follow "$CODEX_RUN" > /dev/null &
wait
```

**3. Compare them**

```bash theme={null}
for RUN in "$CLAUDE_RUN" "$CODEX_RUN"; do
  tracks runs get "$RUN" | jq '{agent: .agent.harness, end_reason, started_at, ended_at}'
  tracks runs usage "$RUN" | jq '{cost_usd, sandbox_seconds: .sandbox.seconds}'
done
```

This prints how each run ended, how long it took and what it cost.

## Read what each agent did

Open **Runs** in the [web app](https://tracks.alpic.ai). Both runs are listed with their agent, cost and duration. Open one to read its conversation: every message the agent wrote and every tool call and command it ran.

From the terminal, `tracks runs events <id>` lists the same events as JSON.

> [!NOTE]
>
> An end reason of `completed` means the agent stopped, not that it did the job well. Read its last messages to judge
> its work, or let Tracks judge it with an experiment.

> [!TIP]
>
> Prefer clicking? In the web app, **Runs** then **New run** starts the same run with a repository picked from your
> library.

## Make the comparison fair

One run per agent is an anecdote: the same agent can succeed once and fail the next time. An [experiment](https://docs.tracks.alpic.ai/concepts/experiments.md) repeats each run several times, judges every run on yes-or-no criteria you write, and gives each agent a pass rate.

* [Measure your MCP server or skill](https://docs.tracks.alpic.ai/guides/measure-your-mcp-server.md): a complete experiment comparing two agents, with and without your tools.
* [Write evaluations](https://docs.tracks.alpic.ai/guides/write-evaluations.md): criteria that judge runs reliably.


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