git-guardrails
Installation
SKILL.md
Git Guardrails
Sets up a PreToolUse hook that intercepts and blocks dangerous git commands before Claude Code executes them.
Prerequisites
- jq: required for the hook script to parse tool input — install with
brew install jqorapt-get install jq- Important: if
jqis not installed, the hook will fail open (allow all commands). Always verifyjqis available after setup.
- Important: if
When to Use This Skill
Activate when the user:
- Wants to prevent destructive git operations from being run by the AI agent
- Asks to add git safety hooks to Claude Code
- Wants to block
git push,git reset --hard, or other dangerous commands - Is setting up a new project and wants guardrails on git operations