Run benchmarks with Claude Code¶
The repository has a Claude Code
skill, /snap-bench, that turns the jobs in these runbooks into one command
each: write a plan, run it end to end, report on the results, bring the docs
in line with the code, and ship your changes. You type a command in a Claude
Code session, and Claude follows the skill's steps, asking you whatever they
don't settle.
| Command | What it does |
|---|---|
/snap-bench:plan <what to measure> |
Writes a new plan in resources/plans/ from your description |
/snap-bench:run <plan> [<plan> ...] |
Pushes the code, runs the plans on their hosts, analyses only those runs and writes the report |
/snap-bench:report [folder] [run IDs] |
Writes a short Markdown report from an analysis, or from run directories it analyses first |
/snap-bench document [new \| all \| <paths>] |
Brings the docs in line with the code and with the documentation standards |
/snap-bench ship [notes] |
Takes your changes to the default branch: checks, commits, merges and pushes |
/snap-bench plan, /snap-bench run and /snap-bench report are the same
as the first three. The skill is in .claude/skills/snap-bench/; how it
works, and what each command will and won't do, are in
The snap-bench skill.
Set up¶
- Install Claude Code and sign in, as Anthropic's documentation describes.
-
Start it in the repository root:
claudeIt loads the skill when a session starts, so start a new session after pulling changes to the skill. 3. For
run, set up as for Run a benchmark: your workstation's tools, SSH to each runner host without prompts, and a targets file that gives each target itsrunner_host.resources/targets/aws.tomlis an example with placeholder addresses: copy it, ortargets.example.toml, and fill in your hosts'.
The commands run only when you type them. Claude won't start one on its own.
Plan, run and report¶
-
Plan. Describe what to measure:
/snap-bench:plan trn2 vs g7e latency for live captions at 2 s chunks on the 100 ego4d clipsIt reads the plan format, the existing plans, your targets files and manifests, then asks about anything that changes the results or the cost (the targets, which clips, pacing, concurrency levels, repeats), giving each option's size. It estimates the streams, requests, duration and log size, writes
resources/plans/<name>.toml, and checks it with--dry-run. It never runs the plan. 2. Track the plan.make push-hostssends only files Git tracks:git add resources/plans/<name>.toml -
Run.
/snap-bench:run resources/plans/<name>.tomlIt dry-runs each plan, stops if a file the run needs is untracked, pushes the code with
make push-hosts, and runs the plans one after another, waiting for each. Then it analyses only those runs into a new folder and writes the report there. It takes as long as the plans do, and it never stages or commits anything, reruns a plan, or stops a host's run without asking. 4. Read the report,snap_benchmark_report.mdin the analysis folder.
For runs you already have, /snap-bench:report takes an analysis folder or
run directories, and optionally run IDs to cover only some of the runs. The
report gives the plan's intent (from its comments), the key findings,
throughput and latency, cost, and, for a concurrency sweep, each target's
optima ranked by throughput and by cost. Then come detail views, the
real-time factor and, when the clips have reference transcripts, accuracy. It reads the analysis
without changing it, and where the plan's comments disagree with the data,
it reports the data and says so.
| Output | Where |
|---|---|
| A plan | resources/plans/<name>.toml |
| A run | <work-dir>/runs/<run-id>-<target>/events.jsonl (plans use work-dir = "scratch") |
A run's launcher log, under run |
<work-dir>/runs/<run-id>.log |
| The analysis and its report | scratch/analysis/<run-id>/, named after the plan run (several plans: a UTC timestamp, then their names) |
The analysis behind each report, and every file it writes, is described in the Analysis section.
Keep the docs and code in step¶
When you've changed code, /snap-bench document brings the docs in line
with it, and /snap-bench ship checks, commits and merges your work to the
default branch, asking before it touches that branch:
/snap-bench document
/snap-bench ship
What each step of these does, what the skill learns about the repository, and how to change the skill are in The snap-bench skill.