/crew:verify [--refresh] [--price] [--stamp-reach [--apply] [--set N=REACH]]from crew
Build or refresh the verification map from evidence
Ships in crew. Installing the plugin adds it to Claude Code.
Build .crew/verify.json — the map from changed paths to the checks they require.
_verify/ first, then the repo's other conventions — qa/, spec/, _test*/. If
_verify/ exists, read its README.md and the scripts in it, and map every one of them into a
rule. If none of them exists, create _verify/ from
${CLAUDE_PLUGIN_ROOT}/skills/crew-setup/templates/_verify/ — README.md, smoke.sh,
run-all.sh, and a cases/ directory — then fill in that README's layout and status tables with
what this repo actually needs. Do not leave the template's commented-out examples as the whole
file: either write real checks or say plainly that the directory is a scaffold with none in it
yet. If a convention does exist, read it and ask me what runs it and when. It will not be
discovered for you, and it is usually the most valuable thing in the repo for this purpose.package.json /
*.csproj / Makefile / composer.json, CI workflow steps, e2e/ specs.
Read the CI config carefully — it is the closest thing to an existing map.git log --format= --name-only -300 | sort | uniq -c | sort -rn | head -30why and a unique id on every rule and "unmapped": "fail". Then, from the repo root, run
python3 "${CLAUDE_PLUGIN_ROOT}/hooks/scripts/crew_instructions.py" agents --root .. Unless it
printed hand-written, left alone or a rule already runs agents --check, add the rule that the
same script's agents-rule prints to rules, then run the agents command again.python3 "${CLAUDE_PLUGIN_ROOT}/hooks/scripts/verify_agents.py" --root . --check.If the repo has no meaningful tests, do not fabricate a map. Say so, and hand off
to a smoke-harness ticket (/crew:brainstorm) — a map pointing at checks that cannot fail is worse than
no map, because the gate turns green and everyone relaxes.
Running the whole map, unbudgeted. The Stop gate spends a budget
(verify.stopBudgetSeconds, default 60) cheapest-first and DEFERS what does
not fit, printing deferred to /crew:verify: <cmd> (<n>s) for each one. Those
were not checked. A rule over the budget alone is NOT VERIFIED ... deferred to CI, never a block;
a turn that ran no rule says verify-gate: 0 rules ran and writes no verified marker (L-0710).
seconds prices the RULE, and is charged ONCE. A rule runs whole or
defers whole, however many commands its run holds -- so a rule with
"seconds": 40 and three commands costs 40 against the budget, not 120. This
sentence exists because the unit was left unstated when the budget was
introduced ("run matched rules in ascending seconds"), and the first
implementation read it per command and split rules in half.
A command named by more than one source carries the STRONGEST obligation of
any of them. always is unconditional; a rule with no seconds is
unconditional-until-priced; only a rule that states seconds is deferrable.
Naming a command in always and also in a 90s rule therefore RUNS it -- the
merge resolves toward running, never toward deferring.
The obligation attaches to the RULE, so run order is never disturbed and
nothing is charged twice. A rule is unconditional when it states no cost or
when any command it names is unconditional, and it then runs WHOLE, in its own
run order, charged its seconds once. Two consequences worth knowing when
you write a map:
run: ["prepare", "check"] keeps prepare first even when check is in
always. Where a command runs is part of what the rule means; being
mandatory only decides whether it can be deferred.always makes the WHOLE rule
unconditional, because half a rule is not something anyone can say ran. If
you want just one check unconditional, give it a rule of its own.To run everything with no budget:
bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/verify-gate.sh --all
(on native Windows run it under Git Bash). In a PR's CI job pass --ci:
the same map over tracked files, Stop's reach filter, rc 77 or an empty run
fails, no marker is written; crew-setup ships the workflow. Give every rule
a measured seconds (step 6 times them); none is UNKNOWN cost and always runs.
With --sync: run
bash ${CLAUDE_PLUGIN_ROOT}/skills/crew-setup/scripts/map-audit.sh and reconcile.
Report the counts before and after.
With --refresh: keep existing rules, add rules for paths that have appeared
since the recorded anchor, and flag rules whose target files no longer exist.
Stop used to keep exactly one baseline (.crew/.verify-verified-at) and one
fingerprint (.crew/.verify-gate.fingerprint), both written ONLY when every
matched rule ran clean. A rule priced over the Stop budget on its own — this
repo's own rules[8] at 185s against a 60s default — was deferred on EVERY
Stop, so neither ever advanced again: the baseline froze, and every OTHER
rule re-matched and re-ran from that same old commit, forever.
.crew/.verify-gate.record.json (machine-local, never tracked) now carries
per-rule status alongside the two markers. A rule that is PERMANENTLY over
budget on its own — chronic, not a fluke of this turn's ordering — no longer
blocks the baseline; it is named in the record instead, and reported EVERY
turn ("NOT VERIFIED ON THIS TREE ... deferred to CI") until it actually runs
clean, which only --all can do: the verify-gate CI workflow on a pushed
branch, or this command here (/crew:done refuses until one has). A rule
that fits alone but lost to this turn's contention (acute) still blocks the
baseline exactly as before — genuinely unverified for THIS commit, not
permanently unverifiable.
The record is per checkout. Each clone or worktree has its own
.crew/.verify-gate.record.json, and every orphan and NOT VERIFIED line
names the one it read ([record: <absolute path>]). --all clears only the
record of the checkout it runs in — an --all in one worktree leaves
another's entries where they are — and --ci never prunes the record: it
excludes network/host rules and never records a pass. An orphan, an entry
whose rule was edited or removed, is dropped when a new rule on the same
paths replaces it (L-0733); one that nothing replaced stays until --all
runs in that checkout, or until verify_record.py forget-orphans, run from
its root, drops it by name without running anything.
--price (operator only, never from Stop)bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/verify-gate.sh --price [path] [--force]
Times every rule in a verify.json-shaped map with no budget and writes seconds (ceil, min 1) for
the ones that have none. Defaults to .crew/verify.json; pass a path to price a different file.
Never overwrites an existing seconds unless --force is given, and never writes 0 —
a rule that ran in under a second still costs 1.
.crew/verify.json in this repo is TRACKED, so --price against it dirties a committed file.
It is never reachable from the Stop hook and is never invoked automatically by this command either —
run it by hand, review the diff, and commit the pricing separately.
--stamp-reach (operator only, L-0562)python3 ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/verify_reach.py --root . [--apply] [--set N=local|network|host]
Declares reach on every rule that has none (absent or null), from the gate's own classifier
(below), run from --root as the gate runs from the project root: a rule the gate already runs gets
local, one it defers for a remote verb gets network. reach is part of rule_key, so it then
moves each stamped rule's measured timing and record entry to the new key: in this checkout
--apply changes neither what Stop runs nor what it costs (another checkout re-measures: --all
once there). Syntax-/wrapper-deferred rules: --set N=... only. Dry run; edits the map's text in
place, refusing unless it parses back to the original plus exactly the new keys. Show the table,
ask, then commit the diff on its own, as with --price.
local | network | hostThe Stop gate runs ONLY local rules. network/host rules run under --all and the merge gate,
never unattended on Stop. Declaring "reach": "local" runs the rule on Stop with NO inspection at
all — that is the human saying so, and the gate takes the word for it.
An UNDECLARED rule is not quietly assumed local, and the bar for "assumed local" is narrower than
it looks. The scanner (verify_record.scan_reach) STOPS MODELLING SHELL (Codex round 6) — five
rounds of "read one layer deeper into the shell syntax" each found a new shape that defeated the
last one, so it no longer tries to parse shell at all:
any shell metacharacter present, anywhere, defers unconditionally — the set below, plus a
newline or a tab. No exception, not even a 2>&1 or a trailing comment. Notice:
shell syntax in an undeclared rule: declare "reach": "local" (or network/host).
( ) $ ; & | < > " ' \ { } * ? [ ] ~ # !
...and U+0060, the backtick, which is deliberately NOT printed above.
Never write a literal backtick anywhere in this file. Claude Code pairs SINGLE backticks when it scans a command file — it does not honour the double-backtick form, and it does not exempt fenced blocks. So one unpaired backtick leaves the whole file's spans off by one, and the prose between two of them is handed to bash before the command runs.
This line did exactly that, twice. First as an inline span, where the fragment beginning
, a newline, or a tab became a command and /crew:verify died with
/bin/bash: line 1: ,: command not found. Then again after the list was moved into this fenced
block, which looked like the fix and was not: a fence is three backticks, the literal one inside
the list paired with one of them, and the file was left with an odd count — 251 — and an
unterminated span. The rule that actually holds is parity, not container.
check_command_backtick_spans enforces it.
only once nothing on that list is present does whitespace-only splitting become safe. A reach verb
(ssm, ssh, curl, aws, az, gh, psql, mysql) anywhere — notice: remote verb <v>.
otherwise, if the first token is a recognised interpreter
(bash/sh/dash/zsh/pwsh/powershell/python/python3/py/node/ruby/perl): -n
is parse-only ONLY as the exact second token with EXACTLY one token after it (bash -n a.sh
local; bash a.sh -n and bash -n a.sh b.sh are NOT); -m as the second token is always local
(a module name, never a file — python3 -m pytest x -q is local); -c/-Command/-File as the
second token always defer; any other token from the second position on that resolves to an
existing repo file defers too.
otherwise: any token at all resolving to an existing repo file defers.
none of the above: runs undeclared.
This is deliberately conservative and, on purpose, no longer tries to be precise about WHY a command
might be safe — verify_record.py's module docstring has the full history of why "model shell more
completely" turned out not to be a fixable bug. Declare "reach": "local" on the rule; that is the
fix, not a smarter scanner.
default/always entries in .crew/verify.json get the SAME classification on Stop — they have no
"reach" field of their own, so a deferred command named there is excluded from the fallback
exactly like an undeclared rule would be, never silently reintroduced through it.
--price refuses to time a verb-, syntax-, or wrapper-classified rule outright, in both directions,
same as the gate. The verifyReachUndeclared trigger in crew_state.py separately flags any rule
with no reach at all — see docs/crew/config-rationale.md for the full classification, and --stamp-reach above
to declare them.
Every rule the gate runs gets ENV, AWS_PROFILE, AWS_DEFAULT_PROFILE, AWS_DEFAULT_REGION,
AWS_REGION, AZURE_SUBSCRIPTION_ID, ARM_SUBSCRIPTION_ID, KUBECONFIG, TF_WORKSPACE and
TF_VAR_environment unset, unless the rule declares "env": {"VAR": "value"} — in which case
exactly those values are set instead. The gate prints what it pinned for every command. A rule whose
target is chosen by whatever the calling shell happened to have set cannot be reasoned about.
Following _verify/smoke.sh and GNU automake's convention, a command exiting 77 means "skipped,
environment absent" — not a pass, not a fail. The gate reports it
(SKIP (rc 77, environment absent)), never fails the turn on it, and never records it as verified:
it is listed with the deferred/chronic rules until it actually runs and exits 0.
Each command runs in a wrapper that writes its exit status to a completion record when it ends, and
only a record holding 0 is a pass. When the gate cannot tell, it prints VERIFY FAILED and then
verify-gate: COULD NOT TELL (<reason>): <cmd>. The reasons: the wrapper ended before writing the
record; the record is missing or unreadable; the status is above 128 (a signal, or the rule's own
status); no output-capture or completion-record file could be created; and, from the bash gate
only, the gate itself was signalled while the command ran (a killed PowerShell gate prints nothing).
The PowerShell gate adds two of its own: no usable bash resolved, and the rule's shell could not be
started. Could not tell fails the turn like a failure and never advances the marker or the rule's
record entry. The CI receipt lists such a command as UNKNOWN, as it does a command the log named
but never finished, and calls its list partial when a gate that exited non-zero left no total line
after its last rule.
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
npx claudepluginhub mbadali25/useful-claude-add-ons --plugin crew40 commands in this plugin
/approveApprove a ticket's plan - only you can, by typing this; the prompt hook records the receipt/autopilot0. RouteReport a ticket (status), drive it until a human is needed (run), or run an approved set as parallel lanes (wave)/brainstorm1. Mint the ticketBrainstorm a request into an approved direction, before it becomes a specOther plugins' commands for the same job