Git Guardrails Claude Code
Set up Claude Code hooks to block dangerous git commands (push, reset --hard, clean, branch -D, etc.) before they execute. Use when user wants to prevent destructive git operations, add git safety hooks, or block git push/reset in Claude Code.
- Type
- Skill
- Author
- mattpocock
- Category
- Git Workflow
- GitHub stars
- 304.2K
- Installs
- 507.8K
- Last updated
- November 1, 2026
Install
npx skills add https://github.com/mattpocock/skills --skill git-guardrails-claude-codeUse cases
- Block dangerous git commands before execution.
- Add safety hooks to prevent destructive operations.
- Prevent accidental git push or reset actions.
Frequently Asked Questions
What does this skill set up?
It sets up Claude Code hooks to block dangerous git commands.
What kind of commands does it block?
It blocks commands such as push, reset --hard, clean, and branch -D.
Where are these safety hooks added?
It adds git safety hooks specifically within Claude Code.
About this skill
Sets up Claude Code hooks that block dangerous git commands such as push, reset --hard, clean, and branch -D before they execute. It is useful for preventing destructive git operations in an agent-assisted workflow. It adds git safety hooks specifically within Claude Code.
Summary written with AI assistance from the project's public description.
Categories
More from mattpocock
Grill Me
A relentless interview to sharpen a plan or design.
by mattpocock
Grill With Docs
A relentless interview to sharpen a plan or design, which also creates docs (ADR's and glossary) as we go.
by mattpocock
Improve Codebase Architecture
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
by mattpocock
Tdd
Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
by mattpocock
Similar Skills
Find Skills
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", o...
by vercel-labs
Grill Me
A relentless interview to sharpen a plan or design.
by mattpocock
Ai Video Generation
Generate AI videos with Google Veo, Seedance 2.0, HappyHorse, Wan, Grok and 40+ models via inference.sh CLI. Models: Veo 3.1, Veo 3, Seedance 2.0,...
by inference-sh
Ai Image Generation
Generate AI images with GPT-Image-2, FLUX, Gemini, Grok, Seedream, Reve and 50+ models via inference.sh CLI. Models: GPT-Image-2, FLUX Dev LoRA, FL...
by inference-sh