Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By karlkfiv2.6.0MITIn 1 marketplace
Denies Bash commands that lose their exit status, like a gate piped into tail, so failures can't read as green. Runs as a hook on every Bash call and needs Python 3 on your PATH.
Trending plugins
7-day copy clicks
You run one by typing its /name in Claude Code.
2 cautions to review before installing
A hook runs when Claude uses the Bash tool
A command runs shell commands (! syntax) when you invoke it
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
exit-status, pipeline, false-green, shell-guard, ci-gate, bash-hook, claude-code, hooks ·
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Guard rails for Claude Code shell commands whose exit status is the answer.

The gate failed. The agent reported green. Both were telling the truth.
make check 2>&1 | tail -30; echo "EXIT=$?"
That prints EXIT=0 for a failing gate.
A pipeline reports its last stage's status, so what you read is tail's.
Recovering the gate's own status from the pipeline is not portable — PIPESTATUS is a bash feature, and under a shell without it the usual rescue expands to empty and reads as success too.
Nothing here is a lie. The command ran, the exit status was read, the number was reported accurately. The evidence was just incapable of showing failure. That is the whole class: not a wrong answer, but a check that could only ever come back green.
exit-status-guard is a PreToolUse hook on Bash that catches those shapes before the command runs, and tells the model why — so the fix lands in the rewrite rather than in a permission prompt you have to answer.
Five ways a status disappears, all of which turn a failure into a false green.
make check 2>&1 | tail -30 # denied — you get tail's status
go test ./... | grep FAIL # denied
(cd sub && cargo test) | head # denied — the subshell's status is cargo's
The fix is to redirect, so the call's exit status is the gate's, then reconcile status against output in a separate call:
make check > <scratchpad>/check.log 2>&1
grep -E 'FAILED|Error' <scratchpad>/check.log
Claude Code already reports the first call's exit status with its result, so nothing needs to echo $? after it.
A second statement there is one Claude Code's permission matcher cannot analyse, so outside auto mode it can turn a command the permission rules allow into a prompt.
<scratchpad> is the per-session scratchpad directory Claude Code creates under /tmp/claude-<uid>/.
The deny message resolves it to a literal path, so the rewrite is copy-pasteable and the redirect cannot fail before the gate runs — a build-output directory like tmp/ is commonly gitignored, and so absent from a fresh checkout.
Where there is no scratchpad to name, the suggestion carries its own mkdir -p tmp && instead.
set -o pipefail earlier in the same command suppresses this, unless it was set inside a subshell that has already ended, or turned off again.
It reaches a pipe inside a later $(…) too, since a substitution inherits the shell's options: set -o pipefail; out=$(make check | tail -5) is not denied.
A set that bash runs in a process of its own does not count: a pipeline stage (set -o pipefail | true), a backgrounded list (set -o pipefail &), a piped or backgrounded { …; }, if, case or loop, or a function nobody called.
Reading $PIPESTATUS is denied on its own, gate or no gate — the array is a bash feature, so under a shell without it the read expands to empty and every test against it reads as success. zsh's $pipestatus suppresses nothing: the array holds the most recent pipeline only, so a read cannot be tied to the pipeline it claims to recover, and under bash it expands to empty in its turn.
# with run_in_background: true
make check > <scratchpad>/c.log 2>&1; echo "EXIT=$?" # denied
A ;-list yields its last statement's status.
The log says EXIT=1 and Claude Code's task notification says completed (exit code 0), because the chain ended with an echo.
Capture the status and re-raise it:
make check > <scratchpad>/c.log 2>&1; rc=$?; echo "EXIT=$rc"; exit $rc
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub karlkfi/claude-bouncer --plugin exit-status-guardPlugins from other owners that cover similar ground