{
  "slug": "hyperfine-executes-benchmarks-directly-and-runs-setup-and-cleanup-commands-in-a-12e18fb2b73b",
  "title": "hyperfine executes benchmarks directly and runs setup and cleanup commands in a shell",
  "tools": [
    "hyperfine"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-10-07T21:13:36.000Z",
  "announced_at": "2026-10-07T21:13:36.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When benchmarking a repository command, Hyperfine runs the benchmark command directly by default. Add setup or cleanup hooks as needed; those hooks run in a shell even with `--shell=none`.",
    "examples": [
      "hyperfine --setup '<setup command>' --prepare '<before each run>' --conclude '<after each run>' --cleanup '<cleanup command>' '<repository command>'",
      "hyperfine -S --setup '<setup command>' --cleanup '<cleanup command>' '<repository command>'",
      "hyperfine --shell <SHELL> --setup '<setup command>' --cleanup '<cleanup command>' '<repository command>'"
    ],
    "gotchas": [
      "Version: v2.0.0",
      "<repository command> (required): Executable and its arguments to benchmark; each command argument is passed directly by default.",
      "-S / --shell=default: Select the platform default shell for benchmarked commands: `sh` on Unix or `cmd.exe` on Windows.",
      "--shell <SHELL>: Select a shell for benchmarked commands; may be a shell name or path. Alternative to `-S`/`--shell=default`.",
      "--shell=none: Run benchmarked commands directly without an intermediate shell; this is the default in v2.0.0. Setup, prepare, conclude, and cleanup hooks still run in a shell.",
      "--setup <CMD>: Run once before each set of timing runs.",
      "--prepare <CMD>: Run before each timing run.",
      "--conclude <CMD>: Run after each timing run.",
      "--cleanup <CMD>: Run after completion of all benchmarking runs for each individual command.",
      "Prerequisite: Hyperfine must be installed and available as `hyperfine` on `PATH`.",
      "The previous default shell is stated as `sh` on Unix and `cmd.exe` on Windows."
    ]
  },
  "why_it_matters": "Benchmark a repository command directly while retaining shell execution for setup and cleanup steps.",
  "before": "Before v2.0.0, benchmarked commands used a platform default shell: `sh` on Unix and `cmd.exe` on Windows. Use `-S` / `--shell=default` to restore that behavior.",
  "sources": [
    "https://github.com/sharkdp/hyperfine/releases/tag/v2.0.0",
    "https://github.com/sharkdp/hyperfine/blob/v2.0.0/README.md"
  ],
  "rank": 0.97062,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v2+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "wave2b-20261017",
    "verdict_id": "wave2b-20261017:wave2b-20261017-228b6cde5f7e5eb2-3:gate",
    "evidence_hash": "e97e7ac8f2a74688489ab9335a1d33f37de316dc351233c75dd828fe560592bd"
  },
  "review": {
    "draft_hash": "ef953166cfa874fa87dbc45ced565afb85892f83bc07754ff026116be8db806d",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T21:13:36.000Z",
    "decision": "wave2b-20261017:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.97 >= 0.9; 2 needed) and Jev gave 0.75 (>= 0.6 needed)."
  }
}
