git-guardrails-claude-code
Sets up a Claude Code PreToolUse hook that blocks destructive git commands (push, reset --hard, clean -f, branch -D, checkout/restore .) before they run, with a Python hook that fails closed. Use when the user wants git safety hooks or to block git push/reset in Claude Code.
Pinned to revision 1d8776b07da9, so it is the text this page describes rather than whatever the author pushed since.
Files
- skills/git-guardrails-claude-code/SKILL.md
- skills/git-guardrails-claude-code/scripts/block_dangerous_git.py
- skills/git-guardrails-claude-code/scripts/test_block_dangerous_git.py
Every link opens the file at its source, pinned to the revision this page describes.