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

bench-replay — команда для Claude Code и Codex

Команда bench-replay для Claude Code и Codex переигрывает один шаг пайплайна из сохранённого состояния и оценивает эффект изменения.

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

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

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

Отвечает на вопрос «помогает ли X», а не «хорош ли пайплайн сегодня»: для второго есть полный прогон через /bench-experiment.

Пользователь называет изменение и шаг, который оно затрагивает: implement, tasks, plan или specify. Команда поднимает нужную стадию, гоняет вариант как есть и один-два изменённых, затем прогоняет экзамен и гоняет регрессионные кейсы. Результат остаётся на ветке replay-<label> для сравнения.

Переигровка стоит около $8 и занимает минут десять — против $35 и сорока минут у полного раунда. Прогон, закончившийся быстрее двух минут с нулём воркеров, не считается: нужно смотреть runs-meta/replay-<cell>-<stage>-<step>-<label>.json, прежде чем верить низкой оценке.

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

  • проверить, помогает ли конкретное изменение, не гоняя полный раунд
  • переиграть один шаг из сохранённой стадии, не трогая остальное
  • получить оценку экзамена по каждому варианту изменения
  • найти строку кода, из-за которой вариант просел
  • сравнить два варианта изменения по времени, стоимости и воркерам

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

  • Проверь, помогает ли отключение fan-out на шаге implement
  • Переиграй шаг plan из стадии post-specify для gentle-ai's classifier
  • Сравни asis и новый check node на шаге tasks и разложи оценку по вариантам

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

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

.claude/commands/bench-replay.md

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

Вопросы о bench-replay

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

Положите файл .claude/commands/bench-replay.md из репозитория alfredoperez/speckit-companion в папку .claude/commands вашего проекта.

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

Переигрывает один шаг пайплайна (implement, tasks, plan или specify) из сохранённой стадии, с изменением и без, и оценивает каждый вариант экзаменом. Всё прочее окружение остаётся идентичным.

Чем переигровка отличается от полного раунда?

Переигровка стоит около $8 и занимает минут десять, полный раунд — $35 и сорок минут. Переигровка отвечает на вопрос «помогает ли X», раунд — «хорош ли пайплайн сегодня». Результаты переигровок не попадают в history.jsonl.

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

bench-replay.md · MIT
---
allowed-tools: Bash(. .claude/sandboxes-env.sh:*), Bash("$SANDBOXES_REPO"/bench/replay.sh:*), Bash("$SANDBOXES_REPO"/bench/stage-from-capture.sh:*), Bash(node "$SANDBOXES_REPO"/bench/grade-one.mjs:*), Bash(node "$SANDBOXES_REPO"/bench/regressions/read-case.mjs:*), Bash(node "$SANDBOXES_REPO"/bench/sync-templates.mjs:*), Bash(node -e:*), Bash(git -C:*), Bash(ls:*), Bash(cat:*), Bash(python3:*), AskUserQuestion
description: Change one thing and replay one pipeline step from a staged cell, then grade it
---

## Your task

Answer a single-step question without running a round. The user names a change ("fan-out off", "the new check node", "gentle-ai's classifier") and which step it affects; you replay that step from a staged state, as many ways as the question needs, and grade each. Everything else is held byte-identical, so a difference in the result is the change and nothing else.

This is for "does X help", never for "is the pipeline good today". A round answers the second. A replay costs about $8 and ten minutes; a round costs about $35 and forty. The harness `README.md` (`bench/README.md` in `speckit-sandboxes`) under **Stages** 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 question and the variants

`$ARGUMENTS` is the change. Turn it into:

- the **step** it affects: `implement`, `tasks`, `plan`, or `specify`
- the **stage** to start from: the one before that step (`post-tasks` for implement, `post-plan` for tasks, `post-specify` for plan, the baseline for specify)
- the **variants**, each with a one-word label: the shipped behaviour is always one of them and is always labelled `asis`

Two variants is the normal shape. Three or more only when the question genuinely has that many arms.

### 2. Pick the cell and check the build

Pick the arm the question is about. Cells are blind on disk; identify one by what is installed rather than by letter:

```bash
for d in "$BENCH_CELLS_DIR"/conduit-*/; do n=$(basename "$d"); c=$([ -d "$d/.specify/extensions/companion" ] && echo companion || echo stock); l=$([ -f "$d/living-specs.yml" ] && echo "+living" || echo ""); echo "$n $c$l"; done
```

A variant that changes the product needs the pinned build to carry it: `~/dev/GitHub/speckit-companion.worktrees/bench-main` is what a cell installs from. If the change is on `main` and not in the worktree, fast-forward it, then refresh the cell in place rather than re-baking:

```bash
git -C ~/dev/GitHub/speckit-companion.worktrees/bench-main merge --ff-only main
node -e "import('$SANDBOXES_REPO/bench/sync-templates.mjs').then(m=>m.installCompanion('$BENCH_CELLS_DIR/<cell>','companion','code'))"
node -e "import('$SANDBOXES_REPO/bench/lib.mjs').then(m=>m.gitCommitCellBaseline('$BENCH_CELLS_DIR/<cell>'))"
```

The second line re-tags the baseline so the stage you build next starts from the new build. Skip both if the variant is only a prompt passed to `replay.sh`.

### 3. Get a stage

Check for one first:

```bash
git -C "$BENCH_CELLS_DIR"/<cell> tag | grep ^stage/
```

If the stage you need is missing, rebuild it from a captured run. Every round since the clean sweep leaves stages behind, and every captured run under `runs/conduit/<runId>/` can become one:

```bash
"$SANDBOXES_REPO"/bench/stage-from-capture.sh <runId> <cell> <stage>
```

It winds the record back — unticks the task boxes, resets the status, trims the history — because a capture is of a finished run and a replayed step would otherwise read it as work already done. Confirm the output says `source changes: 0`.

### 4. Replay each variant

One call per variant. A variant that is only an instruction goes as the fifth argument; a variant that is a product change was installed in step 2:

```bash
"$SANDBOXES_REPO"/bench/replay.sh <cell> <stage> <step> asis
"$SANDBOXES_REPO"/bench/replay.sh <cell> <stage> <step> <label> "<extra instruction>"
```

Run them one after another, never at once: the machine and the workers are what is being measured. Each replay prints its time, tokens, workers and cost, then the exam score, then any regression case the cell still trips. The result stays on branch `replay-<label>` in the cell for diffing.

**A replay that finishes in under two minutes with zero workers did not run.** Read `$SANDBOXES_REPO/bench/runs-meta/replay-<cell>-<stage>-<step>-<label>.json` before believing a low score. Twice today a harness bug read as a catastrophic result.

### 5. Report

A table, one row per variant: exam, workers, cost, time, and the regression cases. Then the answer to the question in one or two sentences, and the strongest thing that disagrees with it.

Then, for every variant that scored below the best one, **chase the failure to the line** before reporting it. The per-test detail is in `.test-out/<cell>.acceptance.json`, the code is on the replay branch. Two variants failing the same tests means one cause. A score with no named cause is a number, not a finding.

Replays never land in `history.jsonl`. If the answer changes what ships, the confirming step is a round via `/bench-experiment`, not another replay.

### What not to do

- Do not compare a replay row against a round row. Different starting states.
- Do not reuse a cell's stage after refreshing its build without re-staging. The old stage carries the old commands.
- Do not stage by hand with `git`. `stage-from-capture.sh` and `drive-steps.sh` are the two writers, and both wind the record back.

© alfredoperez · MIT · alfredoperez/speckit-companion

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

Все слэш-команды по теме «Настройка агента: память, контекст, субагенты» →
bmad-eval bmad-code-org Скилл bmad-eval для Claude Code, Codex, Cursor и Copilot, который прогоняет тесты другого скилла и отчитывается о результатах. Запускается, когда нужно проверить триггеры описания, сравнить версии или оценить качество по рубрике. CX Codex +1 9 100установок principle-explain-the-number backnotprop Скилл principle-explain-the-number для Claude Code разбирает, что именно измеряет число и чем оно ограничено. Применяется к ускорению, регрессии, пропускной способности, задержке и eval. CX Codex +1 9 200установок eval-runner haabe Скилл eval-runner для Claude Code запускает eval-сценарии из YAML через reflexion-цикл и записывает результаты в JSON. Фиксирует время, число итераций и статус критериев успеха. CX Codex +1 ★ 54звёзд репо gaia-architecture-comparison ruvnet Скилл gaia-architecture-comparison для Claude Code, Codex, Cursor, Copilot и Gemini CLI, который сравнивает harness ruflo с эталонной реализацией HAL от Princeton по девяти параметрам — от покрытия вопросов до исполнения кода. CX Codex +1 433установок skill-evaluator HeshamFS Скилл skill-evaluator тестирует и бенчмаркает скиллы для ИИ-агентов через детерминированные проверки скриптов, точность триггеров и сравнение с базовым прогоном без скилла. CX Codex +1 ★ 95звёзд репо eval-engineering langchain-ai Скилл eval-engineering для Claude Code помогает проектировать и проверять задачи для оценки ИИ-агентов. Он подключается при работе с бенчмарками, трассами запусков и Harbor. CX Codex +1 6 300установок

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

Весь набор →
speckit.companion.mark-complete Команда speckit.companion.mark-complete для Claude Code помечает активную спеку завершённой через write-context.py. Закрывает спеку вручную без полного слияния. CX Codex +1 ★ 110звёзд репо speckit.constitution Промпт speckit.constitution создаёт или обновляет конституцию проекта в .specify/memory/constitution.md и синхронизирует связанные шаблоны спецификаций. CX Codex GP ChatGPT ★ 110звёзд репо bench-run-all Команда bench-run-all для Claude Code прогоняет один размер через три ячейки, запуская агентов, оценку и сбор результатов. Сравнивает пайплайны Speckit. CX Codex +1 ★ 110звёзд репо publish-canvas Команда publish-canvas готовит релиз canvas-плагина Copilot: поднимает версию, гоняет тесты, ставит тег canvas-v<X.Y.Z> и обновляет запись в github/awesome-copilot. 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звёзд репо bench-experiment Команда bench-experiment запускает раунд бенчмарка приложения Conduit и сравнивает результаты с предыдущими прогонами. Она пригодится, чтобы проверить экспериментальные изменения на рабочих ячейках. CX Codex +1 ★ 110звёзд репо

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

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