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 karlkfiv1.16.0MITIn 1 marketplace
Lets Claude commit and push on feature branches without prompts, but prompts before any protected-branch or destructive git or gh command. A PreToolUse hook that approves, prompts or denies each call; needs Python 3 and git on PATH.
Trending plugins
7-day copy clicks
You run one by typing its /name in Claude Code.
3 cautions to review before installing
A hook runs when Claude uses the Bash tool
A hook runs when Claude writes or edits files
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
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Branch-aware git permissions for Claude Code.

Let Claude commit and push all day on feature branches. Pause it at
main.
Claude finishes a task and runs git add -A && git commit -m "fix" && git push — straight onto whatever branch is checked out.
Most of the time that's a throwaway claude/* branch and you want it to just happen.
Once in a while it's main, or it's git reset --hard, or git push origin HEAD:main.
The default Bash(git commit:*) permission rules can't tell these apart — they either trust every git command or prompt on every one.
branch-guard is a PreToolUse hook that classifies each git/gh command, auto-approves the safe ones (read-only, staging, branch/worktree creation, commits and pushes on a feature branch), and prompts before anything that touches a protected branch (main/master, plus any you add) or is destructive.
A destructive case it can settle itself it denies instead, handing the model the check rather than spending your attention on it.
Everything else defers to your normal permission settings.
BRANCH_GUARD_OVERRIDEThe hook produces one of four outcomes per command:
git reset --hard onto a tip the guard has proved nothing else reaches and proved to be carrying more than a reproducible merge or a published rebase, a push onto a base that has moved into this branch's own lines, and a gh write naming a pull request, issue or release while naming no repository.
Asking there would spend your attention on a gh pr view or a git rebase — and on the third it would spend it for nothing, since the prompt shows you a command that reads correctly either way.
Which repository gh picks is the working directory, and the working directory is not in the command.It guards the Bash tool (for git and gh commands) and the Edit, Write, MultiEdit, and NotebookEdit tools (for the branch a file's repository is on).
For a Bash command, every segment is classified and the command-level decision is: any segment needs ask → ask; else every segment is recognized-safe → allow; else defer. A segment counts as recognized-safe if it's a safe git/gh invocation, a pure read-only filter (a pager like head/tail/wc) piped after one, a side-effect-free label/no-op (echo/printf/true/pwd), or a cd whose literal target stays in this worktree — so git log | head, git log … ; echo "---" ; git log … and cd . && git status auto-approve, but a non-git, non-filter, non-benign command can never ride along into an approval.
A segment that writes a file via an output redirect (git log > f, echo x > f; /dev/null and the standard streams don't count) is downgraded out of allow.
The table below assumes the worktree is on a feature branch (claude/x) under the default strict push policy.
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 branch-guardPlugins from other owners that cover similar ground