The rules
| rule | ships as | what it catches |
|---|---|---|
pipe-to-tail | deny | a mutating command whose status is swallowed by a pipe |
bare-stash-pop | observe | git stash pop with no ref, where refs/stash is shared across worktrees |
cd-carries-over | advise | a Bash call that runs in a directory an earlier call of its own parallel batch moved the shell to with a top-level cd or pushd (the shell is no longer where the batch's first call ran, and the harness does not announce a carry between siblings); use (cd X && …), git -C X or absolute paths |
gh-pr-merge-auto | observe | --auto on a repository with no required checks, which merges immediately |
block-reinstate | deny | an agent running greenbelay block reinstate, which lifts the revocation of a reviewed block and re-admits its copies; the person runs it in their own shell |
publish-without-skill | advise | a v* tag pushed or a pull request merged with no call of the tag-release / merge-when-green skill in this turn or the one before, so the procedure ran from memory |
forge-merge-by-hand | advise | merging a pull request by POSTing to the forge's merge endpoint, which answers 200 whether the checks passed, failed or never started |
no-verify | observe | turning the whole commit gate off rather than one check |
git-add-broad | observe | staging the tree instead of the change |
stale-base | advise | a branch or worktree started from a checkout the remote has moved past |
push-preflight | advise | a git push whose slow pre-push test gate has not been rehearsed with amont rehearse --wait |
push-preview | advise | a push that would publish interface changes no approved localhost preview covers, unless the plan the person approved declares the evidence is enough (preview approval) |
plan-review-panel | deny | a plan presented at ExitPlanMode before its expert review panel ran (the review panel) |
plan-names-no-paths | advise (max advise) | a plan presented at ExitPlanMode whose ## Phases name no file in backticks, so its panel was seated from every area of its repositories instead of the file types it touches; the advice names each phase that names no file (the review panel) |
clear-at-boundary | advise (max deny) | a turn ending at a boundary (a worktree removed, a sweep.py --apply, a plan commit) with nothing in flight and the main chain's context past 200k tokens; deny sends a Stop continuation asking for the handoff and one line starting with the marker safe to /clear, advise sends a note to the person naming the reply that asks for the handoff line, except at a lone plan commit, where plan-phases-open carries the plan on, observe journals only; a boundary under background work, relais in flight or an unclean repository is kept as pending and advised at the first idle Stop after it; at most 3 advices per session, then silence journalled watched cap. Its size kind (ADR-0083): past size-tokens (400k) a Stop with nothing in flight hands off mid-phase at the size stance (size-stance, default observe until live evidence graduates it), at any phase fact and in a continued turn, held only by background work or relais in flight; a command boundary past 400k is answered at the stricter of the rule's stance and the size stance; once per turn and per 100k step, at most 3 per session, journalled size fired <N>k, size held background|relais, size cap |
plan-phases-open | deny | a turn ending while the plan this branch carries still has an open phase that is not a 🧑 decision: — the agent is sent on to it |
implementation-review | advise | a push of a branch that carries a plan, whose diff no independent reviewer has read for the tree being pushed (the implementation review) |
push-browser-check | advise (max deny) | a push of interface changes whose tree no browser-check agent of this session, or of one of its side transcripts, has looked at; a landed approved plan declaring ## Browser check → none: <reason> passes (the push browser check) |
ask-unopened-page | deny | an AskUserQuestion naming a local page (localhost URL, file:// URL, .html path) that no greenbelay open showed the person since the last answered question about it; without a readable transcript it advises |
foreground-poll | advise | a polling loop or gh run watch in the foreground, where the tool's ten-minute clock will kill it one poll short |
unbounded-background-push | advise | a git push sent to the background with its output kept in a file and no timeout, so the pre-push gate inside it can run for as long as it likes with nothing ending it or reporting it |
gui-open-unbounded | advise | a macOS app launch (open -a <App>, open <x>.app) with no timeout, sent in the background; silent on platforms where open is not a launcher: measured to hang twice on 2026-10-14, and the chain after it never ran |
sed-in-place | advise | sed -i spelled for the other sed (-i '' on GNU, bare -i on BSD) |
kubectl-gitops | advise | an imperative kubectl write in a repository Flux or Argo reconciles |
tag-after-commit | advise | git tag chained onto a git commit that a hook may have refused |
chain-with-and | observe | an edit, add or test joined by ; to a commit, push or test that runs even when it fails |
release-tag-push | observe | pushing a v* tag, which publishes: the tag may name the wrong commit, and a green workflow does not mean the artefact is right |
worktree-remove-force | advise | git worktree remove --force on a worktree that still holds uncommitted work |
amend-pushed | advise | git commit --amend on a commit the remote already has |
branch-force-delete | observe | git branch -D on a branch whose commits are on no remote and not merged |
worktree-isolation | observe | a branch created, or git reset --hard, in the primary checkout of a repository that already has linked worktrees |
stdin-hang | observe | a command that will read standard input with nothing on it — cat > file, a bare interpreter, tee outside a pipe — which blocks silently until the tool's clock runs out |
glob-in-flag-value | advise | an unquoted glob inside a flag value (--include=*.ts), which zsh expands — or fails on — before the program sees it |
glob-no-match | advise | an unquoted glob operand that matches nothing, which under zsh aborts the clause before it starts while a later clause reports success |
equals-separator | observe | a bare word beginning with = (echo ===, [ x == y ]), which zsh reads as a command lookup and whose failure aborts the whole command list |
unsplit-expansion | observe | an unquoted $var under set -- or for … in, which zsh leaves as one word: the positionals or the loop get the whole string and the command runs wrong while reporting success |
path-operand-missing | advise | a read of a path that is not there — under the grep shim a warning in mid-stream, for the coreutils one line and carry on — which the chain then reports as success |
workspace-root-write | deny | an output redirect or tee target that lands directly in a workspace root (a directory in no git tree that holds several repositories), where the file belongs to no repository, is never shown by git and is never swept; the refusal names the linked worktree this session works in, or its scratch directory |
stat-bsd-format | advise | stat -f '%…' on GNU stat (or -c on BSD), which prints a filesystem report where a timestamp was wanted |
pkill-option-after-pattern | deny | an option after pkill/pgrep's pattern (pkill -f "x" -n), which BSD pkill reads as another pattern and signals everything it matches — on 2026-11-25 every terminal tab; silent where pgrep -V names procps, which permutes its arguments |
whole-file-dump | advise (ceiling deny) | a file poured whole into the tool result by cat/sed -n/head — 31% of all result bytes measured — where the Read tool would have windowed it. At deny only a whole dump of a regular file over 8 KB is refused, once per agent and file (normalised path), saying the same command repeated will pass, and that retry is let through, journalled allowed-after-feedback; a bounded read or a smaller file stays advised, and a refusal that cannot be remembered advises instead (unrecorded). Feedback to the agent, never a prompt |
persisted-output-dump | advise | reading back whole a tool result the harness saved to a file for being too large, paying for it twice |
file-reread | advise | a Read, or a cat, of a file this session already has in context and that is unchanged on disk since — answered from the session's own record (one per agent, exact windows, certain or uncertain; a compaction clears the main one), not the command |
read-unbounded-large | advise (ceiling deny) | a Read with no offset/limit of a file over 8 KB, where the whole file lands in the context and every later turn carries it; plan files, diffs and every read by a reviewer agent (implementation-review, code-review-*, plan-review-*, interface-review, relais reviewers) are exempt. At deny it refuses once per agent and file (normalised path), saying the same Read repeated will pass, and lets that retry through, journalled allowed-after-feedback; when the refusal cannot be remembered (no usable session or agent id, a failed write) it advises instead, journalled unrecorded, so the promised retry is never refused. Feedback to the agent, never a prompt |
code-read-not-lsp | advise (ceiling deny) | a Read with no offset/limit of a code file over 4 KB (.rs .go .py .ts/.js) that fleet-lsp serves, where documentSymbol and goToDefinition answer in a few lines; once per file per agent per session (every time at deny, until LSP is asked), and read-unbounded-large stays quiet while it speaks. A Read of a file the same agent already asked LSP about (a PostToolUse LSP hook records each call, and the files its answer names, per session and agent; an Error performing answer counts) gets no LSP advice and is journalled lsp-first (read-unbounded-large still speaks past 8 KB); at deny the refusal names documentSymbol and says the Read passes once LSP was asked or if LSP errors. Silent without fleet-lsp on PATH, with the plugin off, outside a git working tree, for an agent whose tools lack LSP, and on files read-unbounded-large exempts |
secret-read | advise (max advise) | a read of a secret file by a reader (cat head tail sed bat more less nl grep rg ugrep awk xxd od strings base64 jq, or a cp whose source it is), by the Read tool, or by a Grep in content mode: ~/.ssh/* but not *.pub, known_hosts or config; ~/.netrc, ~/.npmrc, ~/.aws/credentials, ~/.docker/config.json, ~/.kube/config, ~/.config/mtls/*.key, ~/.claude/.credentials*; .env and .env.* (not .example, .sample, .template), .envrc; and a .key or .pem that holds a PRIVATE KEY. The file must exist. Advised once per path and agent across the three tools, and the call still runs: the rule never denies and graduate refuses to raise it. A pipe or redirect does not exempt a reader; quiet forms (grep -q, -l, -c, rg --files), curl, ssh, ls and sed -i are silent, and so is a reader whose stdout goes to /dev/null; a reader redirected to another path is advised as a copy. Limits: with two secret operands only the first is advised; a directory (grep -r token ~/.ssh) is silent; an unreadable file fails open and is not advised; a nested $(cat …) is not covered. The journal holds the kind and the path, never the command |
symbol-grep-not-lsp | advise (ceiling deny) | grep/rg/git grep, or the Grep tool, searching code for an identifier-shaped pattern (camelCase, PascalCase, snake_case, or after fn/def/class…), where workspaceSymbol and findReferences find the definition and its uses; once per pattern per session. Silent on a pipe filter, -c, -v, -i, -f, several -e, comment markers (TODO), text files, $VAR paths, and in the same places as code-read-not-lsp |
screenshot-in-main-session | advise (ceiling advise) | a chrome-devtools take_screenshot from the main conversation with no filePath: the image (~126 KB) enters the main context, so the advice is to delegate the check to the browser-check subagent; once per session. Silent for a subagent (any agent_id) and for a call with a filePath (the image is saved, not attached); observe journals take_screenshot @main and stays silent; a deny stance still advises |
relais-run-forks | advise (ceiling deny) | a relais run change run that would fork a worktree of its own: cwd is the primary checkout (workspace absent, auto, fork or isolated), or a linked worktree with fork or isolated; the advice is to start a worktree-task worktree and leave workspace unset in it. Advises every time. Silent for kind inspect/verify or a task the hook cannot read (journalled kind_unknown), workspace: "in-place" or an unknown workspace, and a cwd outside a repository or missing (not_a_repo), bare (bare), or a failed probe (probe_failed); observe journals relais run <primary|second> <workspace> and stays silent |
agent-preferred-model | advise (ceiling deny) | an Agent or Task launch of a bare subagent_type whose definition (<repo>/.claude/agents/<type>.md, else <config dir>/agents/<type>.md) says model: inherit and preferred-model: X, when the call carries no model and the prompt's first line does not start with model-fallback:; the advice is to pass model: "X". Silent for a namespaced plugin:name type, an explicit model of any value, and a definition that is missing, not a regular file, over 8 KiB or without closed frontmatter; plugin directories are never read |
lint-suppression-added | advise (ceiling deny) | an Edit, MultiEdit or Write that adds a lint suppression (# type: ignore, # noqa, eslint-disable, @ts-ignore, #[allow], //nolint) or loosens a lint configuration (tsconfig, eslint, pyright, ruff, Cargo [lints], golangci), where general.no-disabled-safety says to fix the finding instead; the file is compared before and after by marker, not by line |
agent-guidance-written | advise (ceiling advise) | an Edit, MultiEdit or Write to agent guidance (SKILL.md, CLAUDE.md, CLAUDE.md.tmpl, AGENTS.md, MEMORY.md, .claude/agents/*.md, dot_claude/agents/*.md), where the guidance.* and prose.* rules apply (ADR-0026, ADR-0032) and greentopo relevant --path <file> lists them; told once per session and file (per agent), later writes are journalled only. Other memory files are exempt |
agent-guidance-shape | advise (ceiling advise) | a write that leaves a SKILL.md without disable-model-invocation: true and without a one-line description: that says when to use it — a Use <word> … or whenever … clause (guidance.pointer-names-when), or grows a CLAUDE.md, CLAUDE.md.tmpl, AGENTS.md or MEMORY.md past 8,192 bytes (guidance.always-on-is-an-index; a ratchet: shrinking or equal size passes). Judged on the rebuilt whole file only; a fragment is journalled and silent; told once per session and file |
work-overlap | advise (ceiling advise) | a session's first Edit, MultiEdit, Write or NotebookEdit in a repository, when another session's latest activity line names the same repository and that session was last seen less than the window ago (2 h; git config greenbelay.work-overlap.window, e.g. 90m). Names the other session, its worktree, its branch, the title of the active plan its branch added when there is one (none for a peer on the default branch), and how long ago it was last seen, and the remedy greenbelay board --repo <repo>; told once per session and repository, counted only once a live peer is found (a first write that meets nobody does not use it up; under observe the journalled firing counts), silent for the session's own activity. Answered from the session activity records, not the command (the board). The other session is named by its owner record when it has one: name and ref beside the UUID, SendMessage to that name when it is live, "cleared since, do not credit it" when its process has cleared |
work-owner | advise (ceiling advise) | never from a command: the owner records (owners). A session's first write claims its worktree, an observed relais programme claim its ticket; a resume <repo> <programme> <ticket> prompt is told who owns the ticket, whether that owner is live or cleared, and the owner's own process after a /clear takes it over; a push or land is credited to its session only on publication evidence. Journals each lookup with its state |
greenspotter-written | advise (ceiling advise) | an Edit, MultiEdit or Write (a PostToolUse, once it has succeeded) of a .rs, .ts, .tsx, .go or .py file in a repository that vendors greenspotter's check row (decisions ADR-0044). The repository is the git root of the FILE's directory, not the payload cwd; the gate is open only when amont list --json run there prints amont-list-v1 listing the check id pre-commit-greenspotter-check, trusted or not (amont lists an untrusted row with no command), asked once per session and repository, with a 5 s deadline. It then runs greenspotter check --json -- <path> (GREENBELAY_GREENSPOTTER names another program), killed at 1 s, and advises each finding as path:line:col: rule-id: message with one greentopo rule <id> line per rule and how to waive (greenspotter: allow <rule-id> -- <reason>). Journal: each finding as rule path text (advised, or watched under observe, which says nothing); greenspotter-slow on each kill; greenspotter-unavailable, greenspotter-exit-2, greenspotter-exit-3, greenspotter-exit-other, greenspotter-unparsed, amont-list-failed and amont-list-unexpected once per session, never shown to the agent |
test-output-trimmed | advise (ceiling deny) | a test, lint or typecheck runner (cargo test, pytest, npm run test, tsc, …) piped into tail/head/grep while pipefail is not definitely on, so a failing run exits 0 and the trimming can cut the failure off. The shell analysis tracks pipefail as yes/no/maybe, including zsh setopt/unsetopt and set -o nopipefail; only a definite yes exempts. Evidence: 33.7 per 1000 calls (2,790 of 82,857, greenbelay backtest --rule test-output-trimmed --since 2026-09-11, measured 2026-10-11; weekly 20.1 to 53.4, flat 4 weeks) |
heavy-build-unqueued | advise (ceiling advise) | a readable Bash clause that runs a heavy build or test (the test-output-trimmed runners, plus cargo build, cargo check, xcodebuild, swift build) outside the host slot queue: not wrapped as amont slot run -- <cmd>, amont run <check> or amont rehearse, and slot run --now (greengate 5.0; the older --on-timeout=run too) counts as unqueued. Confirmed only when GREENHARNESS_HOST_SLOT is unset (greengate 3.x's AMONT_HOST_SLOT is not read) and amont --version on PATH is 1.62.0 or newer (probed once per session, 1.5 s deadline). The advice names amont slot run -- <cmd>, its 90 s --max-wait, exit 75 (not launched), --now as the deliberate way past a stalled line, and amont slots; amont's slot files are never read |
Two more checks run after a command rather than before it, on PostToolUse:
push-landed and push-published verify what a push that reported success
actually did, and home-fingerprint-drift (advise) says which watched home or
repository config file a test or build run changed. See
the assertions.
greenbelay rules prints this with each rule's measured firing rate, and
with the stance in force on this machine rather than the shipped one: a rule
you promoted in ~/.gitconfig reads deny (ships as observe), and a rule
with a ceiling names it, (max advise).
Why only four of them deny
pipe-to-tail blocks because seven consecutive weeks of measurement showed no
downward trend while every other habit halved. That is the bar: a rule earns
deny from your own transcripts, not from an argument about how bad the
mistake is. A habit the model is already correcting does not need a deny.
See measuring and graduating.
plan-review-panel is the other kind of deny, and the person's choice
rather than a measurement: it fires on ExitPlanMode, not on a shell command,
and checks a fact — whether the review panel the plan calls for ran on the plan
being presented — naming the missing roles when it did not. After two refusals
of the same plan, or whenever it cannot check, it hands the call to the person
as ask instead. See the review panel.
plan-phases-open is the third, also the person's choice. It fires on
Stop, the moment the agent ends its turn. ADR-0022 makes a plan one branch
and one pull request with its phases as commits, so a turn that ends with
a phase still open is a stall, not a handoff. The rule reads only the
active plans changed on the current branch (against the merge-base with
the remote default branch), never one already on main, and sends the agent
on to the first open - [ ] under ## Phases. It is silent when that
phase is a 🧑 decision:, in plan mode, while background tasks are still
running, and when the agent's last message has a line starting with
WAITING: <reason> (a preview awaiting approval, a deferred phase, a
blocker). After three continuations on the same phase in one session it lets
the turn end and tells the person, with a note only they see; their next
prompt resets the count. Anything it cannot establish — no repository, a git
failure, an unreadable plan, a session id it will not use as a file name —
lets the turn end. To turn it off without uninstalling:
git config --global greenbelay.plan-phases-open.stance observe.
clear-at-boundary fires on the same Stop. A turn that reached a boundary
(git worktree remove, sweep.py --apply, or a docs(plan): commit that is
not a closing one) with the transcript's last main-chain context at 200,000
tokens or more, no relais run still waiting on the session (read from the
transcript only; greenbelay never runs relais), clean repositories and
nothing unpushed outside docs/plans/, gets one note to the person with the
reply to give: "hand off now". The note says the agent hands off by itself at a
boundary (the worktree-task skill's Handoff section) and ends with that line.
At deny, the agent is sent on once, pointed at that Handoff section, to end
with safe to /clear; next: <the first prompt>; without the skill, the message
still spells out that line. It ships at advise: its
backtest advised 25 of 31 compacted sessions before their first compaction
(the bar was 28), and 46 of 140 advices were followed by an editing turn (the
bar was at most 10%). deny waits on the Outcome counts. It stays silent in
plan mode, with background tasks, when the last message asks a question, has a
WAITING: line or already says safe to /clear, and once per boundary. At a
lone plan commit past 200k its Continue comes before plan-phases-open, which
then stays silent for the rest of the turn; at advise it is silent there and
plan-phases-open carries the plan on. To send the agent on:
git config --global greenbelay.clear-at-boundary.stance deny. Rollback:
git config --global greenbelay.clear-at-boundary.stance observe.
The size kind (ADR-0083) hands off mid-phase. A Stop whose context is at
greenbelay.clear-at-boundary.size-tokens or more (default 400,000; a value
below 200,000 or one that does not parse is reported on stderr and reads as
400,000), with no background task and no relais run in flight, is answered at
the size stance even when the turn reached no command boundary, in a Working
phase, and on a Stop of a turn a hook continued. The clean-repository and
nothing-unpushed tests do not apply: mid-phase, uncommitted edits in the task
worktree are the normal state and the handoff lists them. The size stance,
greenbelay.clear-at-boundary.size-stance, ships at observe: the 30-day
replay (greenbelay size-replay, 2026-11-24) fired 2.71 times a day, but 13
of 84 fires (15.5%, the bar is at most 10%) came while a task launched
outside the replayed transcript was still running, which a transcript alone
cannot show. To send the agent on:
git config --global greenbelay.clear-at-boundary.size-stance deny. At deny the agent is sent on
once, to open its answer with a line for the person, write a ## Handoff that
starts mid-phase at <N>k, commit it alone as docs(plan): handoff <phase>
(which is never a command boundary), file no inbox lines, and end with
safe to /clear; next: \resume …`; plan-phases-openthen stays silent for the rest of the turn, at any phase. Atadvisethe person gets a note; atobserveit journals only. It fires once per turn, again only at each further 100k, at most 3 times per session. Past the size, a command boundary is answered at the stricter of the rule's stance and the size stance, so a size kind atobservenever quiets it; below it the command kind is unchanged.$GREENBELAY_OFF, greenbelay.enabled=false, the shadow arm and an explicit observeingreenbelay.stanceorgreenbelay.clear-at-boundary.stanceforce the size stance toobserve; the rule's compiled advisedoes not lower it. Each size decision is also kept, for 30 days and apart from the journal's rotation, insize-evidence/beside the journal;greenbelay size-evidence
[--days pairs each handoff request with the clear-relay'ssubmitline within 2 h: a session with no relay log is an unheeded request (the relay writes one only once it arms), and only an unreadable relay directory or log counts as missing evidence. A day file that cannot be written is journalledwatched size-evidence-unwritable. Rollback: git config --global greenbelay.clear-at-boundary.size-stance observe`.
The clear-relay Claude Code plugin, which install --write places, acts on
that line. When the main agent's answer ends with
safe to /clear; next: `<prompt>` (one line, at most 2,000 characters), it
shows a toast and a status line and waits 10 seconds. If nothing is typed, no
prompt is submitted and no turn starts, it runs /clear and submits the
prompt in the new session. Typing anything or running /stay keeps the
session. It relays at most once per 2 minutes and never retries: a refused
step shows a toast with the prompt, for pasting. Each arm, disarm, clear,
submit and failure goes as one JSON line to
<state dir>/greenbelay/clear-relay/<session>.jsonl, the plugin's
stateDir setting, which install sets. A submit line carries named:
the ticket a resume <repo> <programme> <ticket>: … prompt names, as
{repo, programme, ticket} (the ticket as relais prints it, the stem of its
file), or null for any other prompt. Lines written before 2026-11-19 have no
named key. A safe to /clear; parked: … line has no prompt and is never
relayed. To turn the relay off, set the plugin's
enabled setting to false; at stance observe no continuation asks for the
line, so the relay has nothing to act on; at advise it acts only when the
person asked for the handoff.
workspace-root-write is the fourth, and ships at deny straight away
instead of walking the observe, advise ladder. The evidence is on disk, not in a
rate: 86 *.log and *.err files in ~/Developer/Perso, none of them in a
repository, none swept, none traceable to a task, and the refusal carries a
one-word fix. examine reads only the shape (a write redirect or a tee
operand with a literal target); confirm establishes the fact, that the
directory the clause runs in, after its cds, is in no git tree and has at
least two children with a .git. The system temp directories are never roots.
The remedy names the linked worktree the session touched last, but only when
git check-ignore says a file of that name is ignored there (an untracked log
would hold worktree-sweep forever), and otherwise the session's scratch
directory, which worktree-sweep --scratch clears. To demote it to a record:
git config --global greenbelay.workspace-root-write.stance observe.
stale-base advises from the start because it refuses nothing, speaks only
after measuring a real gap, and names a failure no correcting loop can see —
nothing fails when you build on stale code. The work is correct against
the code it can see, and the conflict arrives later, from somewhere else. So a
session opening in a checkout the remote has moved past is told — see
the session notice for why it fetches and never pulls.
push-preflight advises for the same reason. git opens its connection to the
remote before it runs pre-push and holds it idle for as long as the test
gate takes; a remote that closes idle sessions kills the push after the gate
has already passed, and the model reads "the network" where the cause was the
gate's placement. With amont ≥ 1.28, amont rehearse --wait runs the same
gate on a snapshot of HEAD with no connection open — or follows the
rehearsal amont.rehearseOnCommit already started — and stamps the tree, so
the push that follows skips the suite (amont run pre-push on 1.27). The rule
speaks only when confirm finds all three facts: amont guards this
repository's pushes, a test gate would run for this push, and HEAD's tree
carries no stamp yet.
Shape, then the world
Most rules after the first handful came out of the transcripts the same way —
tens of thousands of Bash calls, sorted by what failed, was killed, or drew a
correction (see mine).
Each fires on shape and, where the fact lives in the world, confirms it first:
whether the call already runs in the background, which sed is on PATH,
whether the repository holds a Flux or Argo resource, whether the worktree is
dirty, whether the remote has the commit, whether any other branch has the
commits. A rule that fires on shape alone, like tag-after-commit, names a
failure every command in the chain reports as success.
pipe-to-tail in full
git push origin main 2>&1 | tail -5
A pipeline's exit status is its last command's. tail succeeds at tailing
an error message, so a rejected push, a push killed by a timeout, and a push
that never left the machine all report success — and the trimming discards the
error text, so the failure is silent in both channels.
The remedy the rule prints is not "don't use tail": it is to run the mutating
command on its own, read its output afterwards, and then verify the effect
(git ls-remote origin refs/heads/<branch>) rather than the exit code.
set -o pipefail first, or writing to a file and tailing the file, are also
accepted — the rule fires on the shape, and the reason names all three ways
out.
Asking about one command
greenbelay check 'git push | tail -1'
No stdin, no session, no journal entry — just the rules over one string, with whatever they would have said.