Repository context. Gather first
<!-- BEGIN GENERATED: gather-block. Edit docs/conventions/gather-block/block.md, then run scripts/sync-gather-block.py -->
Run each command below as its own Bash call, all sent together in one message (worktree isolation).
Keep any bound in the command's own pipe (output limits).
Unless this section says otherwise, treat a failure (not a repository, git unavailable) as an unknown value and carry on. Keep these as body calls, never ## Pre-computed context lines (gather-block convention).
<!-- END GENERATED: gather-block -->
- Current branch,
git branch --show-current - Recent commits,
git log --oneline -10 - Shallow clone,
git rev-parse --is-shallow-repository - Remote session marker,
printenv CLAUDE_CODE_REMOTE(set means the run is unattended: "Unattended runs")
Pre-computed context
Lane config: !ls "${CLAUDE_PROJECT_DIR:-.}/docs/conventions/bugs.yaml" 2>/dev/null || echo "absent — bundled default lanes apply"
Consumer gotchas:
!bash "${CLAUDE_PLUGIN_ROOT}/scripts/concat-gotchas.sh" --user-file '${user_config.gotchas_file}' || echo "(consumer gotchas unavailable)"
Personal gotchas file (gotchas_file): ${user_config.gotchas_file}
Variables
Arguments: $ARGUMENTS
Purpose
Hunt defects nobody has observed yet in resting code; no diff, failing test, or stack trace is
needed. One invocation is one bounded pass: hunt a target or a rotated lane, verify each
candidate through a separate fresh-context gate, report what survives in the plugin's five-field
shape, stop. Per-run recall is low and the raw false-positive rate high, so recall and precision
are separate stages: hunters are told to be generous, the gate is told to refute.
Verb contract. Read-only toward the repository
A bare invocation never edits code, branches, pushes, or files a tracker item. Filing sits behind
--track, which model auto-invocation never supplies on its own: a user or a standing lane rule
must ask for it. Out of scope, with their owners: coverage gaps (/testing:audit (if enabled),
/mutation-testing:audit (if enabled)), structural drift (/code-tidying:tidy (if enabled)), and comment markers
(/work-items:scan-todos (if enabled)).
Persisting the findings report and its cursor block under ${CLAUDE_PLUGIN_DATA} is plugin-owned
state, not repository mutation. --dry-run persists nothing: no report file, no cursor advance,
no filing.
Durable cursor state never lives in .work/: a fresh clone or git clean erases it. The ladder
re-derives the cursor from rungs 1–3 and never treats a cache note there as authority.
Cloud or scheduled runs. Pass --track there: this skill treats a filed item as the only output
that outlives such a run, and it is what rung 1 of the cursor ladder reads back. Without --track,
the next run has no filed item to read back.
- Pointer: when deciding whether
${CLAUDE_PLUGIN_DATA}outlives a run, fetch
plugins manifest reference § Environment variables
live.
Modes
| Argument | Mode | Behavior |
|---|---|---|
| <path> / <feature> / <diff-ish ref> | Targeted | Hunt exactly that scope. No lane rotation, no cursor advance. |
| --lane <name> | Named lane | Hunt the named lane's globs. Advances the cursor to that lane. |
| (empty) | Rotation | Self-select the next lane via the cursor ladder, then hunt it. |
| --track | Filing | After reporting, file verified findings as raw intake, subject to filing_posture and the Step 7 ladder. Composable with any mode. |
| --dry-run | Plan-and-report only | Full hunt + verification, report to stdout, zero persistence and zero cursor advance. Composable with any mode; overrides --track. |
| --unattended | Unattended | The caller declares that nobody is present (a loop, a routine, a lane rule). No scanned code runs, every survivor is verified-by-reading, and Step 7 routes as unattended. Composable with any mode. A run is also unattended without the flag when the environment says nobody is present ("Unattended runs" below). |
| --repo, --repos-from, --owner, --fleet, --skip | Several repositories | Runs the mode once per selected repository ("Over several repositories" below). Composable with any mode. |
Unattended runs
A run is unattended when --unattended is passed or the environment says nobody is present:
CLAUDE_CODE_REMOTE is set, the session runs under claude -p, or an autonomous loop started it.