From utility
Install a Claude Code PreToolUse hook that blocks dangerous git commands (push, reset --hard, clean, branch -D, checkout ., restore .). Supports project-only or global scope. Use when the user says "setup git guardrails", "block dangerous git", "protect git", or wants to prevent agents from running destructive git operations.
How this skill is triggered — by the user, by Claude, or both
Slash command
/utility:setup-git-guardrailsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Install a Claude Code hook that intercepts dangerous git commands before they execute. The hook
Install a Claude Code hook that intercepts dangerous git commands before they execute. The hook
runs as a PreToolUse event on the Bash tool and blocks commands that could destroy work.
Ask the user:
Install git guardrails for this project only or globally?
- Project: adds to
.claude/settings.local.jsonin this repo- Global: adds to
~/.claude/settings.jsonfor all repos
Copy the block-dangerous-git.sh script to the appropriate location:
.claude/hooks/block-dangerous-git.sh~/.claude/hooks/block-dangerous-git.shMake it executable: chmod +x.
Add the hook to the chosen settings file:
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "{path}/block-dangerous-git.sh"
}
]
}
]
}
}
If hooks already exist in the settings file, merge -- don't overwrite.
Present the default blocked patterns:
Blocked commands:
git push(any form)git reset --hardgit clean -f/git clean -fdgit branch -Dgit checkout .git restore .Want to add or remove any patterns?
If the user wants changes, edit the script accordingly.
git push --dry-run) and confirm it's interceptedgit status) and confirm it passesReport that guardrails are active.
npx claudepluginhub xxkeefer/skills --plugin utilityProvides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.