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.
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.
A Claude Code plugin that blocks dangerous git commands for all agents (main + subagents).
/plugin marketplace add clemux/claude-code-plugins
/plugin install safer-git@clemux-claude-code-plugins
claude --plugin-dir ~/dev/claude-code-plugins/safer-git
| Command pattern | Description |
|---|---|
git push --force / -f | Force push (rewrites remote history) |
git push --force-with-lease | Still rewrites remote history; blocks the common agent bypass |
git push --delete | Delete remote branch |
git push origin :branch | Delete remote branch (colon-refspec syntax) |
| Command pattern | Description |
|---|---|
git commit --amend | Amend commit (rewrites history) |
git commit --no-verify / -n | Skip pre-commit hooks |
| Command pattern | Description |
|---|---|
git reset --hard | Hard reset (discards uncommitted changes) |
git checkout . | Discard all working tree changes |
git restore . | Discard all working tree changes |
git clean -f | Delete untracked files |
| Command pattern | Description |
|---|---|
git branch -D | Force-delete branch |
| Command pattern | Description |
|---|---|
git rebase -i / --interactive | Interactive rebase |
git filter-branch | Full history rewrite |
| Command pattern | Description |
|---|---|
git stash drop | Permanently deletes a stash entry |
git stash clear | Permanently deletes all stashes |
git reflog expire | Removes the reflog (recovery safety net) |
git gc --prune | Makes unreachable objects unrecoverable |
| Command pattern | Description |
|---|---|
git config alias.* | Blocks alias creation (prevents alias.yolo = push --force bypass) |
The plugin registers a PreToolUse hook on the Bash tool. When any agent (including subagents like Haiku) attempts to run a Bash command:
&&, ||, ;, |) into segmentsjq — for parsing hook input JSONgrep -P (PCRE) — for regex matching| Vector | Mitigated? | Notes |
|---|---|---|
Suggest alternative flag (--force-with-lease) | Yes | Blocked explicitly |
Create git alias (git config alias.yolo "push --force") | Yes | git config alias.* is blocked |
Use colon-refspec (git push origin :branch) | Yes | Blocked explicitly |
Write dangerous command to a script file, then bash script.sh | No | Hook only sees bash script.sh, not file contents |
Use eval "git push --force" | No | Hook sees the eval string but regex may not parse it reliably |
Python/node subprocess (subprocess.run(["git", "push", "--force"])) | No | Entirely outside Bash tool |
Subshells: $(git push --force) inside a larger command | Partial | Depends on command splitting |
git <alias> will bypass detection since the alias is resolved by git, not the shell command string.bash script.sh), the hook cannot inspect the file contents.eval, xargs, or piping to bash/sh can obscure the actual command.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 clemux/claude-code-plugins --plugin safer-gitPlugins from other owners that cover similar ground