Run Benchmark
Create one independently resumable session per task. Put the app in benchmarks/<task>/<YYYY-MM-DD>-<harness>-<model>/ (with -2, -3, and so on for repeated identical runs) and final/global evidence in runs/<run-id>/data/. Every invocation gets a unique benchmark_id; a Markdown plan generates it once and shares it across every enabled model/task run so the comparison UI can recover the exact benchmark group.
Reuse first
When asked to compare models, build a comparison page from existing apps. Do not invoke any model unless the user explicitly asks for a run or rerun ("lance", "rerun", "relance", "run again"). Report missing cells instead of filling them.
.agents/skills/run-benchmark/scripts/create-comparison.mjs \
--models 'claude-opus-5-5:xhigh,gemini-4-argon@cursor-agent:high' \
--tasks all \
--title 'Opus 5.5 vs Gemini 4 Argon'
- Model spec:
<model>[@<harness>][:<effort>]. A trailing effort in the name (gemini-4-argon-high) is an effort filter. Names are normalized across harness drift (claude-opus-5.5-300k-extra-highmatchesclaude-opus-5-5:xhigh). - Per task and model it picks the newest verified app;
--allow-failedfalls back to failed/terminated ones,--require-allkeeps only tasks every model covers,--apps task/result,...lists apps by hand,--dry-runprints the selection. - It writes
comparisons/cmp-<UTC>-<slug>.json(id,title,created_at,apps) and printshttp://127.0.0.1:9080/?run=<id>. It reads the catalog from the Portly-managed workbench and starts it if needed. - An app may belong to any number of comparisons; manifests only reference
benchmarks/<task>/<result>IDs and never copy or modify run evidence. - If cells are missing and the user then asks to fill them, run only those task/model pairs, then recreate the comparison.
Workflow
- Read references/task-catalog.md for task names, application types, and seed sources.
- Read canonical prompts locally from
<benchmark-repository>/prompts/<slug>/(orBENCHMARK_PROMPTS_DIRwhen explicitly overridden). Select the numerically highestv<number>.md, including uncommitted local versions, and fail closed if the version is missing. Save the exact local file path,https://benchmark.melvynx.dev/prompts/<slug>/<version>, and prompt in the immutable run snapshot; do not fetch either website. - Confirm the requested model exists in the chosen harness when the harness exposes a model catalog. Never substitute a model silently.
Every benchmarked model must have a price in the comparison UI. Before the first run of a new model, add its official per-MTok rates (input, cache read, cache write, output) to benchmark-compare/src/lib/model-pricing.ts with a test in model-pricing.test.ts. run-benchmark.sh refuses unpriced models. After a run, confirm the run page shows a dollar cost for every model, not "Not recorded".
- Run:
```bash
.agents/skills/run-benchmark/scripts/run-benchmark.sh \
--model '<model-name>' \
--harness '<codex|ccx|cc|cckimi|cursor-agent|opencode>' \
--tasks '<task-a,task-b>' \
--effort '<level>'
```
Or run a reusable Markdown plan:
```bash
.agents/skills/run-benchmark/scripts/run-benchmark-plan.sh \
benchmark-plans/<plan-name>.md
```
- Inspect the printed run directory and each
verification.json. A completed process is not proof unless the transcript is valid, a session ID was captured, and a non-empty final response was captured. - Run
scripts/verify-benchmark-run.sh <run-dir>...for task-appropriate build/runtime checks, thenscripts/validate-benchmark-run.sh <run-dir>...as the deterministic final gate. - Resume a task using its generated
resume-command.sh; append new output to a new transcript file rather than overwriting the original. - When a one-shot result fails verification, send a neutral fix prompt with
scripts/iterate-benchmark-task.sh <run-dir>/data/<task> <prompt-file>. It resumes the same session inside the original isolated workspace and recordsiterations/<n>/with prompt, transcript, timing, and usage. Keep the one-shot score separate and list every iteration prompt and cost in the plan's## Iterationsnotes.
Modes
- Use
--dry-runto create prompts, commands, metadata, ports, and app directories without calling a model. - Use
--smoketo ask each harness for onlyHARNESS_OK; this verifies authentication, model selection, transcript capture, and resumability without running a benchmark task. - Use
--list-tasksto print the catalog. - Use
run-benchmark-plan.sh <plan.md> --dry-runto validate and prepare every enabled plan row without calling models.
Markdown plans
- Copy ../../../benchmark-plans/TEMPLATE.md to create a reusable plan.
- Set
enabledtoyesornofor each row. - Set
tasksto one canonical task, comma-separated tasks, orall. - Before launching a row with
tasks: all, expand it and compare the count and
names against references/task-catalog.md. Treat
a missing newly-added task as a runner bug to fix before the run starts.
- Add as many rows as needed to compare models and harnesses. Each row remains an independent recorded run.
- The plan runner expands rows by task and launches every model/task pair concurrently. Expect interleaved progress and one run directory per pair.
Constraints
- Follow .agents/rules/benchmark-runs.md.
- For
ccx, select exactlygpt-5.6-sol,gpt-5.6-terra, orgpt-5.6-luna; forward effort through--effort. - Use
cckimiwhen the local Claude Code-compatible Kimi alias is explicitly requested; keep the exact Kimi model identifier and effort. - Use
opencodeonly when the caller explicitly selects it. Pass the exactprovider/modelid fromopencode models. - When a GPT model uses the Claude Code harness family, route it through
ccx; never run a GPT model withcc. - Do not combine tasks into one model session.
- Never store an app below
runs/;app-path.txtandmetadata.jsonmust point to the task-local output directory. - Do not mark a generated application verified until its build and real serving port have been checked.
- For visual, animated, or interactive tasks, do not rely on the app's own
self-test or a single first-frame screenshot as visual proof. Exercise the
real browser state across representative interactions, timeline positions,
scenes, or viewport sizes; if the browser render fails after a self-test
passes, preserve that as the model result.
- Every generated-task prompt requires
pnpmexclusively when dependency installation or package scripts are needed; do not introduce npm commands or npm lockfiles. - Keep model-facing prompts neutral: never disclose that the task is a benchmark or evaluation, never mention run evidence, and never expose a completion sentinel.
- For every non-CLI task, instruct the model to set the browser title and primary visible title to its model name using only identity information already available to it, with no additional title text.
- Every non-standalone prompt must include its allocated port as a setup, package-script, and runtime-verification requirement.
- Record each model invocation in task
metadata.jsonasmodel_timing.started_at,model_timing.completed_at, andmodel_timing.duration_ms. Usenullfor prepared dry runs. - Record
benchmark_idin bothrun.jsonand every taskmetadata.json. Pass--benchmark-idonly when several direct runner invocations intentionally belong to the same comparison group; otherwise let the runner generate a fresh ID. - Analyze each valid transcript with
scripts/analyze-transcript.py. Store a stacked progress bar and percentages forcontext_gathering,planning,implementation, andverificationundertranscript_analysisin task metadata. Exclude transport noise, encrypted signatures, and duplicated tool results. - Extract the terminal harness usage record with
scripts/analyze-session-usage.pyand persist normalized input, output, cache, reasoning, total, cost, duration, turn, and raw model-usage details undersession_usage. Usenullonly for prepared dry runs and an explicitunavailableobject when usage cannot be recovered. - Keep the exact raw JSONL. Redact secrets if a harness unexpectedly emits them before sharing or committing artifacts.
- Treat
prompts/<slug>/v<number>.mdas immutable after use. Add changes as a new numeric version and runpnpm index:promptsbefore committing.