Giverny

Git Guardrails Claude Code

Set up Claude Code hooks to block dangerous git commands (push, reset --hard, clean, branch -D, etc.) before they execute.

by Matt Pocock★ 336,218General

What Git Guardrails Claude Code does

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.

How to install Git Guardrails Claude Code in Claude Code

Giverny gives you a ready prompt with the exact install command from mattpocock/skills. Sign in with GitHub, copy the prompt and paste it into Claude Code; Claude installs the skill and confirms it loaded. To install by hand, clone mattpocock/skills and copy the skills/misc/git-guardrails-claude-code folder into ~/.claude/skills/.

How to use it

Once installed, Claude loads Git Guardrails Claude Code on its own whenever your request matches what the skill does. You can also ask for it by name, for example: “Use the git-guardrails-claude-code skill on my current project.”

More Claude skills for general