git-guardrails-claude-code

Installation
SKILL.md

Setup Git Guardrails

Sets up a PreToolUse hook that intercepts and blocks dangerous git commands before Claude executes them.

What Gets Blocked

  • git push (all variants including --force)
  • git reset --hard
  • git clean -f / git clean -fd
  • git branch -D
  • git checkout . / git restore .

When blocked, Claude sees a message telling it that it does not have authority to access these commands.

This is a deterministic config task. Run the bash blocks below as written — the copy-then-verify order matters: never register a hook that points at a script that isn't there, or every session/Bash call will fail with /bin/sh: …/block-dangerous-git.sh: not found.

Installs
12
Repository
c0nant/skills
GitHub Stars
3
First Seen
Jun 9, 2026
git-guardrails-claude-code — c0nant/skills