git-guardrails-claude-code

Installation
SKILL.md

设置 Git Guardrails

设置一个 PreToolUse hook,在 Claude 执行之前拦截和阻止危险的 git 命令。

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

被阻止的命令 (What Gets Blocked)

  • git push(包括 --force 等所有变体)

    git push (all variants including --force)

  • git reset --hard
  • git clean -f / git clean -fd
  • git branch -D
  • git checkout . / git restore .

被阻止时,Claude 会看到一条消息,告知它没有权限访问这些命令。

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

Installs
1
GitHub Stars
48
First Seen
Jul 8, 2026
git-guardrails-claude-code — ninehills/mattpocock-skills