Agent Benchmark
Build and run dynamic, professional benchmarks for agent systems: skills, tools, prompts, harnesses, and workflows. Popularity is not evidence. Same tasks + measured metrics + reported methodology is evidence.
Grounded in field practice from Kun Chen’s agentic engineering workflow talk (video): viral skills can increase tokens and worsen outcomes; GitHub MCP vs CLI/agent-optimized tools differed by ~3× tokens and >2× latency on the same tasks; browser tools differed in turns and tokens for equal work; long loops only help when a verifiable metric exists.
See REFERENCE.md for principles, metric catalog, and experiment templates.
Safety
- Prefer read-only or sandboxed tasks for first runs. Do not hit production write APIs, charge real cards, or delete remote branches/data as part of a bench case unless the user explicitly authorizes a labeled “live” suite.
- Never publish secrets, tokens, customer data, or private repo contents in bench artifacts. Redact logs.
- Cap cost: set max tokens, max turns, max wall time, and max concurrent trials before the first run.
- Do not claim statistical significance with n=1. Report n, variance, and limits honestly.
- Isolate runs (clean worktree / temp dir / fresh session) so order effects and dirty git state do not poison comparisons.
- When benchmarking third-party skills/tools, record exact versions/commits; do not smear authors—report numbers.
Workflow
1. Define the decision
State the question in one sentence, e.g.:
- “Does skill A beat skill B on these PR tasks?”
- “Is MCP cheaper than CLI for the same GitHub tasks?”
- “Did our skill-from-feedback patch improve success without blowing tokens?”
If the user has no tasks yet, propose a minimal suite (3–10 cases) from their repo’s real workflows, not synthetic toys alone.
2. Fix the experiment design (before coding)
Write a bench plan (markdown or JSON) with:
| Field |
Required |
suite_id / title |
yes |
tasks[] — id, prompt, setup, success_predicate, timeout |
yes |
conditions[] — id, what varies (skill on/off, tool A/B, model, harness) |
yes |
metrics — success, tokens_in/out, turns, wall_ms, cost_usd, optional quality score |
yes |
n_trials per task×condition |
yes (≥3 recommended) |
budget_caps |
yes |
isolation — worktree / tmp / session reset |
yes |
seeds / ordering (round-robin conditions) |
yes |
Hard rule: every condition runs the exact same task prompts and the same success predicate. Only the controlled variable changes.
3. Implement a dynamic harness (smallest that works)
Prefer repo-owned scripts under scripts/dev/ or scripts/bench/ (gitignored personal vs maintained—follow repo policy):
Load plan JSON/YAML.
For each trial: prepare isolation → run agent/tool under condition → collect metrics → evaluate success predicate.
Append one JSONL row per trial: suite, task, condition, trial, metrics, error, artifact_path.
Aggregate: mean/median, success rate, p50/p95 latency, total cost; optional bootstrap CI if n allows.
Mint a run dir, then emit $AGENT_DOCS/REPORT.md + $AGENT_DOCS/results.json:
RUN_ID=$(date -u +%Y-%m-%dT%H%M%SZ)
AGENT_DOCS="docs/agent/benchmark/$RUN_ID"
mkdir -p "$AGENT_DOCS"
printf '%s\n' "$RUN_ID" > docs/agent/benchmark/CURRENT
Include methodology, versions, and raw data paths. Never write these at the repository root or a fixed flat path that a second bench overwrites.
Dynamic = the plan file is the product: user adds tasks/conditions without rewriting the runner.
4. Run
- Dry-run one task × two conditions with n=1 to validate plumbing.
- Full suite under budget caps.
- On failure of the harness itself, fix harness before interpreting model quality.
5. Interpret (professional bar)
- Prefer paired comparisons (same task across conditions).
- Call a winner only if success is ≥ and cost/tokens/latency improve, or success improves with justified cost tradeoff the user accepts.
- Flag degradations (Kun’s viral skill pattern: more tokens, worse results).
- Recommend next experiment (ablate one variable) rather than “more vibes.”
6. Optional long-loop mode
When the user wants overnight improvement on a verifiable metric (coverage %, load time, failing e2e count):
- Define metric + stop condition + token/iteration caps (avoid unbounded quota burn).
- Loop: hypothesis → change → re-run fixed suite → keep only if metric improves.
- Land changes on a feature branch with
finish-and-ship; never trash main.
7. Feed skills
If a condition is “skill v1 vs skill v2”, hand losing/winning diffs to skill-from-feedback / capture-workflow with the bench report as evidence—not stars.
Verification
Publish:
- suite plan path and git commit of harness + tasks;
- environment: model ids, harness versions, skill commits, tool versions;
- n trials, ordering, isolation method, budget caps;
- table: condition × success% × median tokens × median turns × median latency × cost;
- raw JSONL path;
- decision for the original question + confidence limits;
- what was not measured.
Do not call a skill/tool “better” without same-task numbers. Do not call a suite “professional” without fixed prompts, success predicates, cost caps, and recorded versions.
1---2name: agent-benchmark3description: Use when the user wants a professional, dynamic agent/skill/tool benchmark — compare harnesses, skills, MCPs, CLIs, or workflows on the same tasks with tokens, turns, latency, cost, and success metrics; prove whether a change helps; run ablation-style experiments; or build a reusable bench harness for a repo. Inspired by rigorous same-task evaluation (not GitHub stars).4---56# Agent Benchmark78Build and run **dynamic, professional benchmarks** for agent systems: skills, tools, prompts, harnesses, and workflows. Popularity is not evidence. Same tasks + measured metrics + reported methodology is evidence.910Grounded in field practice from Kun Chen’s agentic engineering workflow talk ([video](https://www.youtube.com/watch?v=iQyg-KypKAA)): viral skills can **increase tokens and worsen outcomes**; GitHub MCP vs CLI/agent-optimized tools differed by **~3× tokens** and **>2× latency** on the **same tasks**; browser tools differed in **turns and tokens** for equal work; long loops only help when a **verifiable metric** exists.1112See [REFERENCE.md](REFERENCE.md) for principles, metric catalog, and experiment templates.1314## Safety1516- Prefer **read-only or sandboxed** tasks for first runs. Do not hit production write APIs, charge real cards, or delete remote branches/data as part of a bench case unless the user explicitly authorizes a labeled “live” suite.17- Never publish secrets, tokens, customer data, or private repo contents in bench artifacts. Redact logs.18- Cap cost: set max tokens, max turns, max wall time, and max concurrent trials **before** the first run.19- Do not claim statistical significance with n=1. Report n, variance, and limits honestly.20- Isolate runs (clean worktree / temp dir / fresh session) so order effects and dirty git state do not poison comparisons.21- When benchmarking third-party skills/tools, record exact versions/commits; do not smear authors—report numbers.2223## Workflow2425### 1. Define the decision2627State the question in one sentence, e.g.:2829- “Does skill A beat skill B on these PR tasks?”30- “Is MCP cheaper than CLI for the same GitHub tasks?”31- “Did our skill-from-feedback patch improve success without blowing tokens?”3233If the user has no tasks yet, propose a **minimal suite** (3–10 cases) from their repo’s real workflows, not synthetic toys alone.3435### 2. Fix the experiment design (before coding)3637Write a bench plan (markdown or JSON) with:3839| Field | Required |40|-------|----------|41| `suite_id` / title | yes |42| `tasks[]` — id, prompt, setup, success_predicate, timeout | yes |43| `conditions[]` — id, what varies (skill on/off, tool A/B, model, harness) | yes |44| `metrics` — success, tokens_in/out, turns, wall_ms, cost_usd, optional quality score | yes |45| `n_trials` per task×condition | yes (≥3 recommended) |46| `budget_caps` | yes |47| `isolation` — worktree / tmp / session reset | yes |48| `seeds` / ordering (round-robin conditions) | yes |4950**Hard rule:** every condition runs the **exact same task prompts** and the **same success predicate**. Only the controlled variable changes.5152### 3. Implement a dynamic harness (smallest that works)5354Prefer repo-owned scripts under `scripts/dev/` or `scripts/bench/` (gitignored personal vs maintained—follow repo policy):55561. Load plan JSON/YAML.572. For each trial: prepare isolation → run agent/tool under condition → collect metrics → evaluate success predicate.583. Append one JSONL row per trial: `suite, task, condition, trial, metrics, error, artifact_path`.594. Aggregate: mean/median, success rate, p50/p95 latency, total cost; optional bootstrap CI if n allows.605. Mint a run dir, then emit `$AGENT_DOCS/REPORT.md` + `$AGENT_DOCS/results.json`:6162 ```bash63 RUN_ID=$(date -u +%Y-%m-%dT%H%M%SZ)64 AGENT_DOCS="docs/agent/benchmark/$RUN_ID"65 mkdir -p "$AGENT_DOCS"66 printf '%s\n' "$RUN_ID" > docs/agent/benchmark/CURRENT67 ```6869 Include methodology, versions, and raw data paths. Never write these at the repository root or a fixed flat path that a second bench overwrites.7071Dynamic = the plan file is the product: user adds tasks/conditions without rewriting the runner.7273### 4. Run74751. Dry-run one task × two conditions with n=1 to validate plumbing.762. Full suite under budget caps.773. On failure of the harness itself, fix harness before interpreting model quality.7879### 5. Interpret (professional bar)8081- Prefer **paired** comparisons (same task across conditions).82- Call a winner only if success is ≥ and cost/tokens/latency improve, or success improves with justified cost tradeoff the user accepts.83- Flag **degradations** (Kun’s viral skill pattern: more tokens, worse results).84- Recommend next experiment (ablate one variable) rather than “more vibes.”8586### 6. Optional long-loop mode8788When the user wants overnight improvement on a **verifiable metric** (coverage %, load time, failing e2e count):8990- Define metric + stop condition + token/iteration caps (avoid unbounded quota burn).91- Loop: hypothesis → change → re-run fixed suite → keep only if metric improves.92- Land changes on a **feature branch** with `finish-and-ship`; never trash main.9394### 7. Feed skills9596If a condition is “skill v1 vs skill v2”, hand losing/winning diffs to `skill-from-feedback` / `capture-workflow` with the bench report as evidence—not stars.9798## Verification99100Publish:101102- suite plan path and git commit of harness + tasks;103- environment: model ids, harness versions, skill commits, tool versions;104- n trials, ordering, isolation method, budget caps;105- table: condition × success% × median tokens × median turns × median latency × cost;106- raw JSONL path;107- decision for the original question + confidence limits;108- what was **not** measured.109110Do not call a skill/tool “better” without same-task numbers. Do not call a suite “professional” without fixed prompts, success predicates, cost caps, and recorded versions.