Run another skill N times in parallel and merge the outputs into a frequency ledger - surfaces non-determinism and unions findings across runs. For high-stakes reviews and experiments.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Jury?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/sgtlaugh-jury)
---
name: jury
description: Run another skill N times in parallel and merge the outputs into a frequency ledger - surfaces non-determinism and unions findings across runs. For high-stakes reviews and experiments.
allowed-tools: Agent, Read, Write, Grep, Glob, Bash(mkdir:*), Bash(mktemp:*), Bash(date:*), Bash(seq:*), Bash(claude -p:*), Bash(jq:*), Bash(ps:*), Bash(echo:*), Bash(wait:*), Bash(cp:*)
---
# /jury - Repeat a skill N times, merge into a ledger
Runs a target skill N times concurrently in **independent** contexts, then merges the per-run findings into one comparison table: rows = deduped findings, cells = each run's severity, plus an **`X/M` frequency** column (of N launched, S succeeded, M full-fidelity). Surfaces recall variance and unions what any single run would miss. Best for skills that emit discrete, file-anchored findings (e.g. a code-review skill).
## Usage
```
/jury <skill-name> <its-args> [--n N] # default N=3, min 2, cap 6
/jury <skill-name> <its-args> --headless # jurors as root processes (for targets that self-fan-out)
/jury --merge <runs-dir> # re-merge saved raws, no re-run
```
`<skill-name>` is **whatever skill you want repeated** - read it from the input, never assume a particular one. It's a skill name + its args, not a nested slash-command (a leading slash is just stripped). The harness only ran `/jury`; everything after is text for this skill to act on by fanning out (Step 3), never by invoking the target in this session.
## Step 1 - Parse
- `--merge <dir>` → skip Steps 2-4; go straight to Step 5 reading the raws in `<dir>`. No target is parsed, so the fidelity gate uses its majority fallback and the overview says so.
- Otherwise: **the target name is the first non-flag token after `/jury`, copied verbatim from the input.** Do NOT replace it with any skill named elsewhere in this document - copy exactly what was typed (`code-review` stays `code-review`, `triage` stays `triage`). Everything after the name is its args, except `--n N` (default 3, min 2, cap 6) and `--headless` (jury's own flags, not the target's). **Echo `target=<the verbatim token> | args=<…> | N=<n> | stripped=<flags or none>`; if it doesn't match the input, re-read the input** - a wrong target wastes the whole fan-out.
- **Strip write/mutating flags from the target's args.** Read the target's `SKILL.md` (frontmatter `description` + usage) and strip **every** flag whose description mentions post, comment, submit, commit, push, fix, apply, write, create or edit (e.g. code-review's `--comment` and `--fix`, not just `--submit`/`--post`). Reading it for flags and headings is not the pasting forbidden below - nothing from it goes into the agents. Fan-out is **read-only**: running a mutating skill N times would multiply side effects (N duplicate PR comments, N tickets). The human acts once, on the merged result. This is an instruction, not a grant boundary: headless jurors run with `--dangerously-skip-permissions`, which bypasses the target's own grants, so only settings-level deny rules still apply.
- Identify the target skill name (strip a leading slash if present) and confirm it exists - check `~/.claude/skills/<name>/SKILL.md`, and if that dir isn't found, match it against an **available skill's registered name** (the dir can differ from the name, e.g. a plugin skill registered as `caveman:caveman` lives under `~/.claude/plugins/`). Each fan-out agent will **invoke** this skill itself - **do not invoke it in this (orchestrator) session**, and do NOT paste its file content into the agents (pasted-as-text runs shallower than the harness-loaded skill - agents skip steps and reason less deeply).
- **`--headless`** (default off): run jurors as independent **root processes** instead of Agent subagents (Step 3). **Self-fanning targets need it.** Grep the target's `SKILL.md` for `subagent` / `Agent` / `fan out` / `parallel` - if it spawns its own subagents, run it headless: every juror's agents share this session's limit of 20 running subagents (3 aristarchus jurors with their lenses, tracer and verifier come to about 27), a spawn past the limit fails with an instruction not to retry, and the target degrades (grounds shallower or serially) without saying so. Headless jurors are separate sessions, each with its own limit. Flag this and **suggest `--headless`** before fanning out; don't silently run a degraded sample.
## Step 2 - Cost gate (confirm before fan-out)
Estimate `N × the target's per-run cost + ~$1-2 merge`, as a rough range, then wait for an explicit `y`.
**You can't know the target's per-run cost pre-flight - it varies widely, so treat any estimate as a loose FLOOR, not a ceiling.** A review-type run ≈ **$2-5** (`CHEATSHEET.md` has measured per-skill costs); a log/multi-repo-heavy run (anything that reads logs or traverses several repos) ≈ **$5-6 and several minutes** each - so N=3 spans ~$5 to ~$20+ (one observed heavy run: 3× ≈ $18). For an unfamiliar target, bias the range **high**, say "could exceed this," and run **N=2 first** to calibrate its real per-run cost before scaling up. The displayed session cost may also exclude separately-billed subagents.
## Step 3 - Fan out (parallel, independent)
Spawn N `Agent` calls in ONE message, each with `subagent_type: "general-purpose"` (never `fork`: a fork copies this session's context, the target's `SKILL.md` read in Step 1 included, so the jurors stop being independent samples), `run_in_background: false` set explicitly (leaving it out runs the agent in the background), and no `model` parameter (jurors run on the session's model; a smaller one changes the sample). They run concurrently and all return before your next step. Each agent's task is to **invoke the `<target>` skill itself** (via the Skill tool) with the parsed args and return its output - e.g. *"Use the `<target>` skill with `<args>`. Run the skill fully - execute every step, don't shortcut. Return its complete output verbatim."* (Substitute the actual target name from Step 1, not a skill from this doc.)
- **Invoke the real skill, don't reproduce it.** Harness-loaded = full fidelity (all steps run, incl. existing-comments + deep reasoning). A pasted copy runs shallower - that's the fidelity bug this avoids.
- Independent context = independent sample.
- If the subagent reports it cannot invoke the skill, that's a finding - stop and report it (the fan-out mechanism depends on it).
**`--headless` mode (self-fanning targets).** The default (subagents) is lighter, cached, and MCP-present - right for the common target that does *not* spawn its own subagents. A target that **itself** fans out can degrade as a subagent: its agents and every other juror's count against this session's 20-subagent limit. For those, run each juror as a **root process** instead:
```bash
mkdir -p ~/.claude/jury-runs; D=$(mktemp -d ~/.claude/jury-runs/"$(date +%Y%m%d-%H%M%S)"-XXXX); echo "$D"
```
Write `/<target> <args>` to `<D>/prompt.txt` with the Write tool - args pasted into a double-quoted shell string break on a `"`, `$` or backtick - then launch with the printed path written literally:
```bash
D=<the printed path>
for i in $(seq 1 N); do
claude -p "$(< "$D/prompt.txt")" --dangerously-skip-permissions --max-budget-usd <2x the per-run estimate from Step 2> --output-format json > "$D/run-$i.json" 2>"$D/run-$i.err" &
done
wait
for f in "$D"/run-*.json; do jq -r '.result // empty' "$f" > "${f%.json}.md"; done
```
Each root process loads the target via the harness (full fidelity) and **can fan out fully**. Pull `.result` from each `run-<i>.json` for the merge - these ARE the saved raws (Step 4 already satisfied). Heavier than subagents (N cold starts, no shared cache, and headless may lack interactively-authenticated MCP servers), so use it **only** when the target self-fans.
**Don't misread an in-flight run as a crash (this WILL bite you).** `--output-format json` writes the **whole blob atomically at the end** - so mid-run the `run-<i>.json` is **0 bytes**, and that means *still running*, NEVER crashed. Rules:
- **Run the launch + `wait` as ONE blocking foreground call with `timeout: 600000`** (at the Bash tool's 2-minute default the call moves to the background mid-run, and you lose the blocking wait). Only a target estimated past ~9 minutes per run goes `run_in_background` instead - then wait for its exit notification, never poll. The bash tool then returns only when every juror has exited - no polling, no guessing. A heavy target (e.g. gadfly ≈ 7 min) means this call blocks for minutes; that's expected - let it.
- **Judge done-ness by the process, not the file** - `wait` returning (or the PID gone from `ps`) is the done signal. Empty json + live PID = working. Do **not** declare a crash, and do **not** launch a diagnostic "test run" (it wastes a full target run's cost), from a 0-byte file alone.
- **Run the cost-rollup `jq` ONLY after `wait` returns.** On empty files it yields `null` - if you see `null`, you ran it too early; the runs aren't done.
- **`otelHeadersHelper failed … Permission denied` in `run-<i>.err` is a BENIGN telemetry warning, not a failure.** It appears even in successful runs. Diagnose failure from the JSON (`.is_error==true`, missing `.result`, or empty json *after* the PID exited) - never from stderr noise.
**Cost rollup (headless only).** These jurors are separate processes - their spend is **not** in this session's meter, so surface it explicitly from the JSON. This is a new Bash call, so `$D` from the launch is gone - use the directory the launch printed:
```bash
jq -s '{total_cost_usd:(map(.total_cost_usd)|add), input_tokens:(map(.usage.input_tokens)|add), cache_read_tokens:(map(.usage.cache_read_input_tokens)|add), cache_write_tokens:(map(.usage.cache_creation_input_tokens)|add), output_tokens:(map(.usage.output_tokens)|add), turns:(map(.num_turns)|add), runs:length}' <dir printed at launch>/run-*.json
```
Report the totals in the Step 6 overview. (Subagent mode can't roll this up reliably - sub-agent billing may be separate and unreported; that's a reason headless gives you cost visibility the default doesn't.)
Notes:
- If the target creates **git worktrees** (e.g. `/aristarchus` reviews every PR in one), it must name them uniquely or parallel runs collide; also watch for shared-`.git` lock contention under concurrency - if runs fail with git-lock errors, re-run headless with a lower N first; if you fall back to subagents, mark every run `⚠ degraded (nested)` in the overview.
- If some agents fail, proceed with the survivors; record `launched N, S succeeded` (M full-fidelity comes from the Step 5 gate).
## Step 4 - Save raw outputs (persistent)
Each juror's output comes back as its `Agent` call's result (they run in the foreground, Step 3). Write each run verbatim to `<run dir>/run-<i>.md`, creating the run dir once with `mkdir -p ~/.claude/jury-runs && mktemp -d ~/.claude/jury-runs/"$(date +%Y%m%d-%H%M%S)"-XXXX` (the random suffix keeps two juries started in the same second apart; use the printed path literally afterwards). This is the **audit trail + re-merge cache** - re-run the merge later with `/jury --merge <dir>`. Print the directory path in the output.
**Full reports (both modes).** The merge reads `run-<i>.md`. A run that printed `Full report → <path>` (gadfly, dialectic): copy that file to `run-<i>.full.md`, which Step 5 reads instead of the summary.
## Step 5 - Merge into a ledger
**Fidelity gate (first).** Each run must look like a *complete* output before it earns full trust. The expected markers are the **output-contract headings in the target's own `SKILL.md`** (read in Step 1); only if it declares none, fall back to the sections/markers the *majority* of runs share. A run missing expected markers ran shallow - it skipped steps. (For aristarchus those happen to be the `Conventions:` + `Existing comments:` header fields - derive them from the target, don't hardcode per target.) Mark a shallow run `⚠ low-fidelity`: list its findings in a separate flagged block, exclude it from the frequency/unanimous counts, and note it in the overview. If most runs miss the expected markers, **stop and report** - the fan-out isn't faithful. With N=2 and differing structure under the majority fallback (no majority exists), mark `fidelity: split`, exclude neither run, and say so in the overview. If the runs are structurally uniform, the gate passes (note "fidelity: uniform").
1. **Extract** from each run (its `run-<i>.full.md` when present, else `run-<i>.md`): the discrete findings (however the target formats them - for `/aristarchus`: severity-tagged findings, lens findings included, each keeping its location + severity) **and the run's overall verdict/recommendation** (needed for the distribution in Step 6). Skip the rest of the prose/praise unless asked.
2. **Cluster** equivalent findings into rows. Use `file:line` as a **fuzzy** signal (same file, lines within a few of each other) + semantic equivalence - NOT an exact key (the same finding lands at slightly different lines across runs). **When unsure, keep rows separate** - over-splitting only adds rows a human can eyeball; wrong-merging hides a distinct finding.
3. **Normalize** each cell to a canonical vocabulary: `critical` / `warning` / `nit` / `absent`, each tagged `· Confirmed` or `· Inferred`. Map every run's wording onto this scale so cells are comparable - except when every run uses the same scale of its own (gadfly's `Sinks` / `Blocker` / `Handle`): then keep that scale, since flattening it loses the distinction the target cares about. If a run *raised then withdrew/refuted* a finding, mark its cell `withdrawn` (not a severity) - don't show it as a live `warning`. A `withdrawn` cell does not count toward X and makes the row `⚑ contested`.
4. **Frequency**: count how many runs raised each row, **out of the full-fidelity count M** (low-fidelity runs excluded by the gate), shown as `X/M`. The denominator M is the same for every row, so sorting by count = sorting by ratio.
5. **Completeness check (do NOT skip - this is the merge's completion criterion).** Re-scan every raw (`run-<i>.full.md` when present, else `run-<i>.md`): **each finding in each raw must map to a ledger row.** If any is unaccounted for, add it (as a singleton row, flagged for scrutiny). A finding present in a raw but absent from the table is a merge failure - and a dropped finding defeats the entire point of the tool. The merge is done only when zero raw findings are unrepresented, recorded in the overview as `completeness: K raw findings across M runs, all mapped (J singletons added)`.
## Step 6 - Output
**The output MUST contain:** the run-dir path; `launched N, S succeeded, M full-fidelity`; the fidelity status (`uniform`, `split`, or the `⚠ low-fidelity` block); `⚠ degraded (nested)` marks when they apply; the headless cost rollup when `--headless`; the comparison table; the verdict distribution; the `completeness:` line (Step 5).
1. **Overview** (derive it *from* the finished table, so it can't contradict it): `launched N, S succeeded, M full-fidelity`, total findings, unanimous vs singleton counts, verdict spread. In `--headless`, also report the **total cost + tokens** from the rollup (Step 3) - the jurors' spend isn't in this session's meter, so it must be surfaced here. **Get the counts by literally counting table rows** - unanimous = rows at `M/M`, singletons = rows at `1/M` - and cross-check against the table before writing; the numbers must match the rows (a frequency tag varying in severity, e.g. nit/warning, is still unanimous if present in every run).
2. **Comparison table**: `Finding | Location | Freq | Run 1 … Run N` with normalized cells. Sort by frequency desc, then severity. **One finding = exactly one row** - never split into sub-rows. If runs assign different severities, just show each in its own cell; if runs *disagree on validity* (one says `warning`, another judged it a non-issue), tag the row `⚑ contested` and surface it in stability flags - that disagreement is signal, not a formatting problem. Give the most specific `Location` (file:line, or the file(s) for cross-cutting/infra findings - avoid vague slashes).
3. **Recommendation block** - do NOT synthesize a single verdict:
- **Verdict distribution** (e.g. `Comment ×3 | Request changes ×1`).
- **Union of all blocking/critical findings** across runs (so a rare-but-real catch isn't averaged away).
- **Stability flags**: which findings were unanimous (trust) vs **singletons (1/M) - flag for human scrutiny** (rare real catch or one-off hallucination - highest value/risk), vs **`⚑ contested`** rows where runs disagree on validity - verify these manually, the disagreement means one side traced it and the other didn't.
## Guard Rails
- **Fan-out is read-only** - strip mutating flags per Step 1; never run a write-mode skill N times. `jury` writes only the runs directory by instruction; headless jurors run with permissions bypassed, so a settings deny rule (`gh pr comment`/`gh pr review`, `git push`) is the backstop.
- **Always confirm cost** before fanning out.
- **Never collapse to one verdict** - the value is catching what one run missed; show distribution + union.
- **Proceed on partial failure**; report `launched N, S succeeded, M full-fidelity`.
- Best on review-type skills (discrete, file-anchored findings). For skills without a natural anchor, clustering is fuzzier - lean harder on keep-separate.
- `~/.claude/jury-runs/` grows with each run (small markdown) - prune old timestamps occasionally.
- **`--headless` only for self-fanning targets.** Default subagents are lighter/cached/MCP-present for everything else; reach for headless when nesting would degrade the target, not by default.
- **Fan out in the depth you'd actually trust.** Union recall only rescues *randomly*-missed findings; N runs of a shallow mode (diff-only) share the same blind spots, so the union misses what that mode can't see. For high-stakes, fan out in the same mode you'd use for a single serious review (for `/aristarchus`: the default mode with lenses, never `--fast`) - don't union cheap-but-shallow runs and mistake the long table for thoroughness.