Git guardrails hook (Matt Pocock)
SkillInstalls a hook that blocks dangerous git commands before Claude runs them.
Sets up a PreToolUse hook in Claude Code that blocks git push, reset --hard, clean -f, branch -D and checkout or restore of the whole tree. Claude asks whether to install it for the project or globally, copies the bundled script, merges it into settings.json without overwriting other hooks, offers to adjust the blocked list, and tests that it works.
Try asking:
- "Set up git guardrails for this project"
- "Block git push and reset --hard for Claude in all my projects"
- "Add git safety hooks but allow git push"
Source: mattpocock/skills · MIT · by Matt Pocock

Log in to join the discussion.