git-guardrails-claude-code — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited git-guardrails-claude-code (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
设置一个 PreToolUse hook,在 Claude 执行危险 git commands 前拦截并阻止它们。
git push(包括 --force 在内的所有变体)git reset --hardgit clean -f / git clean -fdgit branch -Dgit checkout . / git restore .被阻止时,Claude 会看到一条消息,说明它没有权限访问这些 commands。
询问用户:只为当前项目(.claude/settings.json)安装,还是为所有项目(~/.claude/settings.json)安装?
Bundled script 位于:scripts/block-dangerous-git.sh
根据 scope 把它复制到目标位置:
.claude/hooks/block-dangerous-git.sh~/.claude/hooks/block-dangerous-git.sh使用 chmod +x 让它可执行。
添加到相应 settings file:
Project(.claude/settings.json):
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/block-dangerous-git.sh"
}
]
}
]
}
}Global(~/.claude/settings.json):
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "~/.claude/hooks/block-dangerous-git.sh"
}
]
}
]
}
}如果 settings file 已经存在,把 hook 合并到现有 hooks.PreToolUse array 中,不要覆盖其他 settings。
询问用户是否想从 blocked list 中添加或移除任何 patterns。相应编辑复制后的 script。
运行一个快速测试:
echo '{"tool_input":{"command":"git push origin main"}}' | <path-to-script>应以 code 2 退出,并向 stderr 打印 BLOCKED message。
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.