Skip to content

Commands

Beovulfo edited this page Nov 30, 2026 · 5 revisions

Commands and skills

What Does
/herd:run <task> The autopilot: intake, criteria, build, break it, verify, evidence
/herd:criteria Write success criteria with runnable checks
/herd:evidence Interactive: decide with you how to prove the change works for your project type
herd init <slug> "<goal>" [--request "<message>"] Create a task, make it active, and switch to a new herd/<slug> branch cut from the current one (uncommitted changes come along; it warns instead on a detached HEAD or a repository with no commit). The request is the human's latest /herd:run message in the session log, read by the pre-init hook and stored verbatim in request.md, so herd done refuses human criteria that are not quotes of it. --request is used only when the log has no such message; one that differs from it is kept as a decision note. It prints request: from the session log or request: from --request. The [models] settings are frozen here, and .herd/ is added to the checkout's own info/exclude, so Herd state never shows in git status
herd init <slug> "<goal>" --quick "<check>" Quick route for a trivial change: one criterion, one check. Refused at a high risk floor
herd init <slug> "<goal>" --worktree Opt-in: start the task on a new herd/<slug> branch in its own worktree at .claude/worktrees/herd-<slug>, cut from the current local branch, so several agents can run tasks in one repository. [worktree] required = true in herd.toml makes it mandatory
herd check [slug] Validate task.toml; warns about criterion texts over 40 words, coverage notes over 50 words, checks that do not run project code, human criteria that are not quotes (herd done refuses them when a request is recorded), missing coverage or known_limits (refused at medium and high risk), quantifier or size words (any, every, very big) whose coverage does not say what varies or what scale was tried, and a missing, misplaced (inside a [[criteria]] table) or incomplete inputs list (refused at medium and high risk)
herd detect Propose test and lint commands for Python, Node, Rust, Go and make test
herd note --found|--fixed|--open|--decision|--late-red|--human-change|--tried [...] "text" Log a caveat, a decision, the reason code came before red first, the human's own change to a frozen criterion ("C1: <their words>"), or an adversarial attempt, with a timestamp; the report lists them. --open prints the note's number; --fixed --closes N closes open note N (1 or #1), so it leaves "Not proven" and shows under "Caveats" as closed. --attack names a standard attack (bad-input, collision, one-bad-part, recount, refusal, other-reading) and needs --check, a command herd verify runs (--timeout S for a slow one), or text starting n/a:. For recount, refusal and other-reading, --covered-by <criterion id> reuses that criterion's check instead. --refuses "<command>" adds a command that must refuse contradictory or broken input (see Attacks); --example "<command>" --expect "<text>" runs the program on a tiny case solved by hand, frozen at the first herd verify (change it with --expect-changed "<reason>"). herd help prints the full usage
herd triage "<text>" [--json] Print the risk floor for a task description in one line (risk: high (auth/**)); --json prints the full record
herd verify [slug] [--verbose] [--fresh] [--red] [--only <id>] Run all checks, including each standard attack's command, store evidence.json; exit 1 if any fail. On the standard route the first verify refuses while an attack has no note or ANSWERS.md (the design's second look) is missing. Each check records its time (seconds); the summary line ends with (checks took N s) and each check over 60 s is named. The time never fails anything. An unchanged tree (the work, task.toml and the attack notes) runs no check and keeps the last evidence; --fresh runs them all. --red runs every check once before any code and exits 0 only if every check fails (it cannot be combined with --only). Prints only what needs attention (failing, unchecked or zero-test criteria, failing attacks, herd check warnings, a criterion that failed 3 times in a row); --verbose lists all. When the task has a pull request, it ends by rewriting that PR's description from the latest evidence (body only; a failure is one warning line). --only <id> runs one criterion (C1) or one attack (its name, latest note) with its own command and timeout, prints C1 passing (221 s) or the failure, and exits 1 if it fails; it needs the red run first and writes nothing under .herd/, so it never counts for the gate
herd status [slug] [--json] Show evidence and whether the task is done, the design and build models, and whether each step runs in this session or in a subagent. If the task stopped without herd done, the first line says why and what to do next. With no task at all it prints the models and no active task: run herd init <slug> "<goal>" and exits 0. --json prints the stop record (stopped.json), or null
herd done [slug] [--verbose] Write evidence.md, close the task, and print the six-line final report filled from the evidence and notes. Refuses unless the Stop gate's conditions hold, refuses on the standard route without a design made on the design model, and refuses uncommitted work when pull requests are on (warns otherwise). Updates the task's PR description if herd pr opened one; --verbose prints the full report too
herd cancel [slug] [--reason "text"] Abandon the task: keep its files, stop the Stop gate from blocking, and write the stop record
herd reopen <slug> Make a finished task in this checkout active again, for a new session that continues it (to merge the base branch or fix review comments on its PR). start.json keeps the session that ran herd init and adds this one to sessions, so the Stop gate and the design hook count it as the task's. The stop counters are reset. The task must pass herd done again: an edit after the reopen makes the evidence stale until herd verify. Refuses a cancelled or missing task, and any reopen while another task is active. Without the pre-init hook (in a terminal) no session is recorded, and the command says so
herd pr [slug] [--yes] [--draft] [--milestone NAME] Opt-in: push the herd/* branch, open or update its PR with the evidence as the description; never merges. A new PR gets --draft and --milestone NAME as given; on an open PR the milestone is set and --draft turns it back into a draft. A flag left out changes nothing. Any other flag, --milestone=NAME and a missing name are refused before anything is pushed. Lines after Herd's footer line in the description, such as Closes #N, are kept
herd help List every command with its usage
herd gate The Stop hook (reads hook JSON on stdin). It blocks only the session that ran herd init or herd reopen and the last session to run a herd command in that checkout; any other session stops freely
herd design-brief Print the "be specific" second look, which the designer answers in the task's ANSWERS.md before the attacks
herd design-hook The SubagentStop hook for herd-designer: records the designer's model, whether ANSWERS.md exists and a fingerprint of the criteria and attack notes in design.json
herd preinit The PreToolUse hook on Bash: when the agent runs herd init <slug>, it records the files this session and its subagents already edited with Edit, Write, MultiEdit or NotebookEdit, read from the session log, so red first counts them as the agent's even if they are uncommitted. The record is per task and expires after 10 minutes. Not seen: files changed through Bash (sed, cat >); a file you edit after the agent did counts as the agent's. Like the other hooks, it does nothing when python3 is older than 3.11. Any other command returns at once (about 10 ms over Python's start-up)
herd guard The PreToolUse hook on Bash, Edit, Write, MultiEdit, NotebookEdit and Agent: while a task is active, denies edits to secrets and Herd's state files, irreversible git and GitHub commands, and running Herd's hook commands by hand, and logs each denial as a guard note. With or without a task, it denies herd:herd-designer and herd:herd-builder when run_in_background is true; false is allowed, and an omitted value is allowed except in headless sdk-cli sessions (0.16.2). Otherwise it allows everything when no task is active, on a Python older than 3.11, or when it fails (one stderr line)
herd lint The optional PostToolUse lint hook; herd lint --suggest prints a [lint] block for herd.toml

herd is python3 plugin/scripts/herd.py. Inside the plugin it is python3 "${CLAUDE_PLUGIN_ROOT}/scripts/herd.py".

Clone this wiki locally