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 --hardgit clean -f/git clean -fdgit branch -Dgit checkout ./git restore .
被阻止时,Claude 会看到一条消息,告知它没有权限访问这些命令。
When blocked, Claude sees a message telling it that it does not have authority to access these commands.