
git-guardrails-claude-code
Set up Claude Code hooks to block dangerous git commands
by mattpocockFree
Description
git-guardrails-claude-code is an agent skill from Matt Pocock's skills collection, listed on skills.sh. It sets up a Claude Code hook that blocks dangerous git commands before they run: git push (including --force), reset --hard, clean -f, branch -D and checkout or restore of everything. You choose whether it applies to one project or all of them. A skill is a SKILL.md file of instructions (sometimes with scripts and reference notes) that an AI agent loads only when a task calls for it, so the agent knows the steps to follow and what to avoid. It is free and open source.…
Highlights
- Blocks git push and force-push
- Blocks reset --hard, clean -f and branch -D
- Project or global install
Ratings & Reviews
No ratings yet
Be the first to rate git-guardrails-claude-code.
People also visit
git-guardrails-claude-code FAQ
What does the git-guardrails-claude-code skill do?
It sets up a Claude Code hook that blocks dangerous git commands before they run: git push (including --force), reset --hard, clean -f, branch -D and checkout or restore of everything.
How do I install the git-guardrails-claude-code skill?
Run: npx skills add https://github.com/mattpocock/skills --skill git-guardrails-claude-code
Is it free?
Yes. It is free and open source.
What is an agent skill?
A SKILL.md file of instructions, sometimes with scripts and reference notes, that an AI agent such as Claude Code loads when a task needs it, so it handles that task the same careful way every time.
Has it been checked for security?
skills.sh lists three audits: Gen Agent Trust Hub Pass, Socket Pass and Snyk Pass. A Warn is worth reading before you install.
What are the best git-guardrails-claude-code alternatives?
Popular alternatives to git-guardrails-claude-code include code-review, pr and resolving-merge-conflicts. See all git-guardrails-claude-code alternatives

