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 stefanobaghinov0.1.0In 1 marketplace
Claude Code hooks that make Claude a considerate collaborator: clean commits and PRs, safe pushes, conforming branches.
Run automatically on Claude Code events. Claude doesn't decide.
1 caution to review before installing
A hook runs when Claude uses the Bash tool
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Claude Code hooks that make Claude a considerate collaborator: clean commits and PRs, safe pushes, conforming branches.
A single PreToolUse hook on Bash that polices how specific CLI tools are
used, in three domains:
git commit, gh pr create, or
gh issue create|comment|edit Claude is about to run and denies violations
with the exact fix, at the moment of action. Judgment-only guidance arrives
as primers when a session or subagent starts — see
Session-start primers.+ in a worktree path and a branch
name that misses the convention.The first two used to be separate hooks (hooks/hygiene-dispatch.py here and a
personal git-history-guard.py). They parsed the same command string twice, and the
safety-critical one carried the weaker parser: shlex.split, which cannot see
into heredocs and allowed any command it failed to parse. One hook, one parse,
one rule registry — see Why one hook.
The previous setup registered five PreToolUse hooks, each gated with an
if: "Bash(git commit*)"-style filter and each injecting a prose rule file via
additionalContext. It had three compounding problems:
if-filter false positives
(anthropics/claude-code#75245) —
differently-patterned if gates fire together on commands that match none of
them. On recent CLIs, command substitution $(…), ${var} expansion, and even
a bare for loop trip every gate at once, injecting the full rule battery with a
0% true-positive rate.allow +
additionalContext, so a false positive silently auto-approved an unrelated
Bash command.The fix for all three: stop asking the model to remember rules, and check the artifact instead.
Claude Code runs all matching hooks in parallel and folds their answers with
a fixed precedence — deny > defer > ask > allow, order-independent — so
two hooks were never a safety mechanism, just two copies of the same parser.
Merging them buys three things:
git push --force 'unbalanced
used to make shlex.split raise, and the old guard returned — allowing an
unchecked force push. It is now denied.git -C /elsewhere commit is policed too. The old
hygiene matcher compared raw leading words and missed that form.git commit, but
only one reason ever reached the transcript. A single denial now lists the
signing problem and the message problem together.Criticality is explicit, which the split hooks could not express:
| Tier | Rules | On a rule's own error |
|---|---|---|
CRITICAL | git history safety, commit signing | deny (fail closed) |
ADVISORY | artifact hygiene | skipped (fail open) |
Each rule runs in its own try, so a bug in a hygiene rule cannot take down the
force-push rule — and a crash in the safety rules no longer silently removes
push protection, which is how the standalone guard behaved.
hooks/bash-policy.py does its own quote/heredoc-aware command matching
(sidestepping the upstream if-filter bug entirely), then:
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.
good-citizen@stefanobaghino is listed by stefanobaghino/claude-plugins — review the source before installing
npx claudepluginhub stefanobaghino/claude-plugins --plugin good-citizenPlugins from other owners that cover similar ground