К основному содержанию
команда CX Codex

bench-experiment — команда для Claude Code: запуск бенчмарка

Команда bench-experiment запускает раунд бенчмарка приложения Conduit и сравнивает результаты с предыдущими прогонами. Она пригодится, чтобы проверить экспериментальные изменения на рабочих ячейках.

MIT ★ 110 обновлён 2026-10-19

Установить в Claude Code · Вручную: положить файлы Все способы и платформы ↓
.claude/commands/bench-experiment.md
Открыть на GitHub

Что делает bench-experiment

Команда готовит ячейки бенчмарка, запускает драйверы и сбор метрик, затем сравнивает работу, oracle и wall-clock с прошлыми прогонами. В конце она фиксирует результаты в speckit-sandboxes: в том числе stats.jsonl, history.jsonl, REPORT.md и файлы запусков с обзорами.

Перед запуском команда проверяет каталог ячеек и активность Spotlight. Если Spotlight занят или маркерный файл отсутствует, раунд не начинается: нужно выполнить указанную команду mdutil и дождаться пользователя. Замеры запускаются без параллельных судей; после capture судей запускают небольшими партиями. Это важно, потому что совместный запуск нагрузки уже приводил к падению машины.

Для установки в Claude Code сохраните файл команды в .claude/commands/bench-experiment.md. Команда принимает описание эксперимента и флаги для размеров, режимов, версии расширения, spec-kit, модели и GUI-преамбулы. Сравнивая обычную сборку с Companion, используйте метрику work: overall включает lifecycle capture, которого у обычной сборки нет.

Какие задачи решает

  • сравнить результаты бенчмарка с предыдущими прогонами
  • проверить экспериментальную версию расширения на выбранных размерах
  • собрать метрики работы, oracle и wall-clock
  • зафиксировать результаты раунда в speckit-sandboxes

Примеры запросов агенту

  • Запусти эксперимент «hook anchors» на всех размерах и сравни результаты с прошлыми прогонами.
  • Проведи базовый повтор бенчмарка на --ext code и отчитайся по метрикам.
  • Проверь Companion и обычную сборку по метрике work.

Как установить bench-experiment

Вручную: положить файлы

.claude/commands/bench-experiment.md

Вызов — /bench-experiment. Для всех проектов — ~/.claude/commands/

Вопросы о bench-experiment

Как установить bench-experiment в Claude Code?

Сохраните файл команды по пути .claude/commands/bench-experiment.md.

Что делает bench-experiment?

Команда проводит раунд бенчмарка Conduit, сравнивает метрики с прошлыми прогонами и сохраняет отчёт и результаты в speckit-sandboxes.

Почему для сравнения обычной сборки с Companion нужна метрика work?

Метрика overall учитывает lifecycle capture, которого нет у обычной сборки. work сравнивает корректность и rubric для всех вариантов.

Исходный текст

bench-experiment.md · MIT
---
allowed-tools: Bash(. .claude/sandboxes-env.sh:*), Bash(node "$SANDBOXES_REPO"/bench/sync-templates.mjs:*), Bash(node "$SANDBOXES_REPO"/bench/run-all.mjs:*), Bash(npm run compile:*), Bash(git -C:*), Bash(date:*), Bash(ps:*), Agent, Workflow, AskUserQuestion
description: Run one full benchmark round on Conduit and report it against previous sweeps
---

## Your task

Run one complete round of the benchmark and report what changed. The user says "run an experiment and bench it" and expects the whole thing without being asked for details.

The harness lives in the `bench/` folder of the sibling [`speckit-sandboxes`](https://github.com/alfredoperez/speckit-sandboxes) repo and the app it measures in [`conduit`](https://github.com/alfredoperez/conduit). `bench/README.md` there is the reference; this command is the procedure.

### Paths

Shell state does not persist between Bash calls, so start each one with this line:

```bash
. .claude/sandboxes-env.sh && eval "$(node "$SANDBOXES_REPO"/bench/paths.mjs --sh)"
```

It sets `$SANDBOXES_REPO` (the sibling `speckit-sandboxes` checkout, whose `bench/` folder is the harness) and `$BENCH_CELLS_DIR` (where the cells are baked). When you hand a path to an agent, expand it first: an agent gets the absolute path, never the variable.

### 1. Name the sweep

`$ARGUMENTS` is what the experiment is testing, plus optional flags:

| Flag | Default | What it does |
|---|---|---|
| `--sizes easy,hard` | all four | which sizes the round covers |
| `--modes speckit,companion` | all arms | which arms to run |
| `--ext code\|latest\|<tag>` | `code` | `code` = the working tree, `latest` = the published build, or a release tag to backtrack to |
| `--speckit latest\|keep` | `latest` | pin or refresh spec-kit itself |
| `--model sonnet\|opus` | the session's | model the driver agents run on |
| `--preamble on\|off` | `off` | whether drivers are handed the GUI preamble |

**`--preamble on` is a promise the drivers have to keep.** The bake records it, nothing enforces it: a round baked `on` whose drivers were handed nothing has a column that lies, which is worse than no column. When it is on, every driver prompt starts with the output of `node "$SANDBOXES_REPO"/bench/preamble.mjs creation <speckit|companion> <specDir>` — the same text the GUI sends — and the arm decides which workflow name it takes. When it is off, drivers dispatch the command bodies alone.

Pass `--sizes`/`--modes` straight through to `sync-templates.mjs`, `prep` and `capture` — the same list at every step, or the round measures cells it never ran. Pass `--model` as the `model` option on each driver Agent. Everything else in `$ARGUMENTS` is what the experiment is testing. Turn it into a short label — "hook anchors", "living specs off", "fresh baseline". If there is nothing to name, use today's date and call it a baseline repeat, which is also useful: it is how the noise floor gets measured.

### 2. Check the machine first

Twelve clones of a React app are about 8GB of files Spotlight has never seen, and indexing them has taken this machine to a load average of 260. Before baking:

```bash
ls "$BENCH_CELLS_DIR"/.metadata_never_index || echo "MISSING"
```

If it is missing, or if `ps aux | grep mds_stores` shows Spotlight busy, tell the user to run `sudo mdutil -i off <the cells directory>` (the expanded `$BENCH_CELLS_DIR`) and wait for them. Do not start a round on a machine that is already struggling.

### 3. Bake

```bash
npm run compile                          # the driver dispatches the GUI preamble from dist/
node "$SANDBOXES_REPO"/bench/sync-templates.mjs --sizes <sizes> --ext <ext> --speckit <speckit> --sweep "<label>"
```

`--ext code` measures the extension in `COMPANION_DIR`, which is what an experiment on unreleased work needs. Use `--ext latest` only when the question is explicitly about the published build.

The bake prints the three versions it recorded and fails loudly if any cell can read what it is. Report the versions; do not report the arm mapping unless asked, and never pass it to a driver or a judge.

### 4. Prep and drive

```bash
node "$SANDBOXES_REPO"/bench/run-all.mjs prep --sizes <sizes>
```

Then one driver per cell, all twelve at once, following step 3 of `/bench-run-all` and the driver contract in `$SANDBOXES_REPO/bench/DRIVER.md` — **one command per step, never `/speckit-companion-auto`** — the same GUI preamble, the same settle-wait, capture for the Companion arms only, and **the cell's letter, never its arm**. Twelve drivers in parallel is fine; the round costs the slowest cell rather than the sum.

Expect 20 to 30 minutes.

### 5. Measure — with nothing else running

```bash
node "$SANDBOXES_REPO"/bench/run-all.mjs capture --sizes <sizes> --no-reset
```

This runs a build and two test passes in each of twelve cells. **Do not start the judges while it runs.** Stacking twelve judge agents on top of it is what took the machine down; it costs nothing to wait the ten minutes.

`--no-reset` keeps the diffs so the judges have something to read.

### 6. Judge — after capture finishes, in small batches

A rubric judge per cell and a comparative reviewer per size, as `/bench-capture` steps 3 and 4 describe. Run them **three or four at a time**, not twelve. Then re-run `capture` once to fold the rubric into the composite.

If the machine is under load, or the user has other work to do, stop after step 5 and say so: the oracle, wall-clock and test columns are complete without the judges, and the composite can be filled in later.

### 7. Report

```bash
node "$SANDBOXES_REPO"/bench/run-all.mjs compare --metric work
node "$SANDBOXES_REPO"/bench/run-all.mjs compare --metric oracle
node "$SANDBOXES_REPO"/bench/run-all.mjs compare --metric wall
node "$SANDBOXES_REPO"/bench/run-all.mjs runs --limit 12     # the index: what ran, on which model and which build
```

Lead with what moved and whether it moved more than the spread of the sweeps before it. A change smaller than that spread has not been measured — say so plainly rather than reporting it as a result.

**Read `work`, not `overall`, when comparing the stock arm to a Companion one.** `overall` gives a quarter of its weight to lifecycle capture, which stock does not have and never will, so it caps stock at 75 by construction. `work` is correctness plus rubric and every arm can reach 100.

Then commit the round in `speckit-sandboxes` — `stats.jsonl`, `history.jsonl`, `runs/`, `reviews/`, `REPORT.md`, all under `bench/` — with a message naming the sweep and what it was testing.

### If something is incomplete

Say which cells are missing and which columns they cost. A round with eleven of twelve cells and no rubrics is still worth pushing; a round reported as complete when it is not is worse than no round.

© alfredoperez · MIT · alfredoperez/speckit-companion

Похожие слэш-команды

Все слэш-команды по теме «Тесты и QA» →
doca-bench NVIDIA Запускает doca_bench и измеряет производительность библиотек DOCA на хосте или BlueField Arm. Проверяет пропускную способность, задержки и базовые показатели перед изменениями. CX Codex +1 166установок bmad-eval bmad-code-org Скилл bmad-eval для Claude Code, Codex, Cursor и Copilot, который прогоняет тесты другого скилла и отчитывается о результатах. Запускается, когда нужно проверить триггеры описания, сравнить версии или оценить качество по рубрике. CX Codex +1 9 100установок benchmark-checklist backnotprop Скилл benchmark-checklist задаёт агенту список вопросов, которые нужно закрыть доказательствами из прогона, прежде чем докладывать об ускорении или регрессии. CX Codex +1 9 100установок verify-this cursor Скилл verify-this проверяет конкретное утверждение на локальных данных: снимает замеры до и после, сравнивает артефакты и выдаёт один вердикт. CX Codex +1 2 600установок perf-theory-tester composio-community Скилл perf-theory-tester для Claude Code ставит эксперимент по правилам: одна правка на гипотезу, замеры, вердикт. Доказывает, ускорила ли оптимизация код. CX Codex +1 2 300установок add-lang colbymchenry Скилл add-lang для Claude Code, Codex, Cursor и других агентов, который подключает новый язык через tree-sitter к пайплайну codegraph. CX Codex +1 1 300установок

Из того же набора83

Весь набор →
bench-replay Команда bench-replay для Claude Code и Codex переигрывает один шаг пайплайна из сохранённого состояния и оценивает эффект изменения. CX Codex +1 ★ 110звёзд репо speckit.tasks Промпт speckit.tasks для Claude Code и Codex собирает из проектных документов план задач tasks.md, упорядоченный по зависимостям и пользовательским историям. Формирует этапы реализации проекта. CX Codex GP ChatGPT ★ 110звёзд репо changelog-entry Команда changelog-entry для Claude Code пишет запись changelog по PR или текущему diff, выбирая файл и формат. Запускается с номером PR или без аргумента. CX Codex +1 ★ 110звёзд репо eval-speckit-extension Скилл eval-speckit-extension проверяет работу расширения speckit-extension на реальной спецификации. Он валидирует срабатывание хуков жизненного цикла и запись шагов в .spec-context.json. CX Codex +1 ★ 110звёзд репо speckit.analyze Слэш-команда speckit.analyze сверяет spec.md, plan.md и tasks.md перед реализацией: ищет расхождения, дубли и требования, под которые не создана ни одна задача. CX Codex GP ChatGPT ★ 110звёзд репо speckit.companion.living-sync Команда speckit.companion.living-sync синхронизирует живые спецификации с текущими правками рабочего дерева в один проход. Обновляет существующие файлы spec без перегенерации. CX Codex +1 ★ 110звёзд репо speckit.implement Промпт speckit.implement читает план разработки и выполняет задачи из tasks.md. Подходит для поэтапной реализации в Claude Code и Codex. CX Codex GP ChatGPT ★ 110звёзд репо publish-all Команда publish-all для Claude Code выпускает четыре компонента проекта, когда изменения готовы и прошли QA. CX Codex +1 ★ 110звёзд репо

Спонсоры проекта

Компании, которые помогают держать аналитику открытой