Skip to content
Current section: Compare

CompareBeta

Compare two setups on your own repo.

Compare compares two setups on your own repo: two git refs, two models or two agents, as a baseline and a candidate. Your tests decide each trial, and Compare reports the pass rates, the cost and how far the difference can be trusted. It reports what happened and never calls a change better or safe.

Compare is in beta. It runs on your machine or in your CI, through the vendors’ own CLIs, with your sign-in or your API keys.

In the app

The Setup tab walks you through choosing a comparison, writing the suite, the first run and push, and optional CI. Afterwards Runs and Suites show the results.

Step 1 of 4 of Compare's Setup tab in the cedr.dev app: compare agent setups, models or efforts, or two coding agents.
  1. What to compare
  2. Write the suite
  3. First run and push
  4. Add it to CI
Open Setup

From the command line

Write a suite, see what it would do, then run it. Your tests decide each trial.

Terminal
# Write .cedr/compare/suite.toml
cedr compare init
# What the suite would do, without starting anything
cedr compare plan
# Run the trials within your budget
cedr compare run
# Send unsent results to the app
cedr compare push

A suite is code. Its commands run with your permissions, so run only suites you trust.

Write a Suite

Or let your agent do it

Paste this into your coding agent. It reads these docs, explains each change and waits for your approval.

Prompt for your agent
Read https://cedr.dev/docs/agents and https://cedr.dev/docs/compare, then help me write a Compare suite for this repo with cedr compare init and check it with cedr compare plan. Ask me what to compare first, and start no trials until I approve. Ask before installing anything, changing configuration, uploading data or scheduling jobs. Never ask me to paste credentials into chat.
  • Write my Compare suiteWrites a suite comparing agent setups on two git refs and checks its plan. Starts no trials.
  • Compare two modelsWrites a suite that runs the same commit under two models or efforts.
  • Compare two agentsWrites a suite that runs the same task through two coding agents.
Open Compare in the app
Terminal window
cedr compare init

This writes .cedr/compare/suite.toml. Edit it to describe what you are comparing and the tasks to try:

version = 1
trials = 3
[baseline]
harness = "claude"
model = "claude-sonnet-5-5"
ref = "main"
[candidate]
harness = "claude"
model = "claude-sonnet-5-5"
ref = "HEAD"
[[tasks]]
id = "fix-parser"
prompt = "Fix the failing parser test."
setup = "npm ci"
test = "npm test -- parser"
test_files = ".cedr/compare/fix-parser"

To test a change to your rules or skills, compare two different committed git refs: the starter’s main and HEAD are identical until you commit a candidate change on another branch. To compare models or efforts on the same commit, remove both ref entries and change model or effort. cedr compare init prints these next steps; run cedr compare plan before starting trials. Only committed work is measured, and Compare needs the repo’s full history: it refuses a shallow clone.

An agent can edit the tests it is judged by. Keep your tests in test_files and they are copied over its work before test runs.

Each step’s leftover processes are stopped when it ends on Linux and macOS, so a server started in setup is gone by test. Start it in the test command.

A suite is code. Its commands run with your permissions, so run only suites you trust. cedr compare plan shows what a suite would do without starting anything.

Terminal window
cedr compare plan
cedr compare run
compare suite: complete, $1.27 of $2.00 (c-20261101T193000Z-1a2b3c)
passed rate 95% median cost
baseline 2/3 67% 21%-94% 41s $0.12
candidate 3/3 100% 44%-100% 38s $0.09
fix-parser baseline 2/3, candidate 3/3
pass rate +33 points; the intervals overlap, so this run does not separate them

Overlapping intervals mean the run does not tell the two apart, not that they are equal. More trials narrow them. Each result also records the models, CLI versions, commits and a digest of your agent files, so you can tell what was measured.

cedr compare history lists saved runs and cedr compare show <id> prints one again. Results are saved on your machine, and you can send them to your organization in the app.

Press Ctrl-C to stop a run on Linux or macOS: the agent stops too, and what the run measured so far is saved. On Windows, Ctrl-C ends the run without saving it.

Command Options
cedr compare init --name NAME writes .cedr/compare/NAME.toml instead of suite.toml
cedr compare plan [SUITE] --task ID, --trials N, --format text|json
cedr compare run [SUITE] --budget-usd N, --task ID, --trials N, --fail-on never|lower|separated, --allow-unpriced, --no-record, --no-push, --repo NAME, --format text|json
cedr compare push [ID]... --all, --org ORG, --config PATH, --repo NAME, --dry-run, --format text|json
cedr compare history --limit N, --format text|json
cedr compare show <ID|PATH> --fail-on never|lower|separated, --format text|json
cedr compare budget [USD] --unset, --pull, --org ORG, --config PATH, --format text|json

compare run and compare show exit 0 when the run is complete and the --fail-on condition did not hold, 1 when it held, 3 when the run is incomplete, whatever the counts say, and 2 on a usage, configuration or file error.

Terminal window
cedr compare push --org <organization ID>

With no result ids, a bare cedr compare push sends only unsent results saved from this repo. Add --all to send every unsent result on the machine. Each push is at most 256 KiB; a larger result stays saved locally. Name a result id to send it again; repeats keep the first copy. If the app is busy, the CLI waits and retries. Use your personal API key through the CLI’s private key store or CEDR_API_KEY.

When [sync] is set and auto is not false, Compare sends each saved run when it finishes, including incomplete runs. Use --no-push to skip automatic sending for that run; a later cedr compare push can still send it. Use --no-record to keep a run from being saved or sent. Set [sync] auto = false to stop automatic sending.

Sending includes the result, repo name, machine id and name, and, for GitHub Actions, the PR number and run URL. Prompts, agent output and paths are never sent. Trials run on your machine or CI with your own credentials.

Open Compare in the app. Runs lists what differs between each baseline and candidate; open one for its trial marks, counts, costs and uncertainty. Suites charts both variants over time and marks configuration changes. Every member sees the organization’s retained results. Removing results in the app leaves your local files in place.

On a run, the Tasks table shows passes out of scored trials for each variant and counts each distinct task once. Candidate only and Baseline only mean just one variant passed at least one trial. Those changes appear first. Both means each variant passed at least one trial, and Neither means both variants had scored trials without a pass. A task is Unscored if either variant has no scored trial.

Setup walks you through choosing a comparison, writing a suite, the first run and push, and optional CI. Write my Compare suite gives your agent a prompt to write and plan it without starting trials. Settings holds the organization budget and result retention.

Every run has a cap in US dollars at API prices, including on a plan where you are not billed per call. The default is $2.00.

Terminal window
cedr compare budget 5 # set it on this machine
cedr compare budget --unset # back to the default
cedr compare run --budget-usd 10 # for one run

Owners and admins can also set a budget for the organization in Compare Settings in the app. Machines and CI pick it up with cedr compare budget --pull --org <organization ID>.

A run stops before a trial that could pass the cap, and reports itself as incomplete. Claude is also held to what is left during a trial. Other agents are checked between trials, so a trial can go over by what it spends before its timeout. An agent stopped at its timeout has an unknown cost, so the run stops there too unless you passed --allow-unpriced.

claude and codex are built in. Run any other agent with the command harness:

[candidate]
harness = "command"
model = "my-model"
command = ["my-agent", "--model", "{model}", "--prompt-file", "{prompt_file}"]

The budget cannot rely on what these spend, so a run with one always needs --allow-unpriced. If the command’s last line of output is JSON such as {"cost_usd": 0.12}, that cost is counted and reported. The same flag is needed for a codex model Compare has no price for. A relative path in command starts from the repo root.

- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: Sheernox/cedr@vX.Y.Z
with:
compare: .cedr/compare/suite.toml
compare-budget-usd: "5"
compare-fail-on: lower
push-org: org-<your organization ID>
env:
CEDR_API_KEY: ${{ secrets.CEDR_API_KEY }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}

Install the agent’s CLI in an earlier step, and use API keys rather than a signed-in plan. lower fails the check when the candidate passes less often; separated fails it only when the intervals do not overlap as well. An incomplete run always fails. Set compare-allow-unpriced: "true" for a variant that needs --allow-unpriced.

Never point this at a suite from an untrusted pull request.