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.
Sets up a PreToolUse hook that intercepts and blocks dangerous git commands before Claude executes them.
This is an infrastructure safety skill, not a feature-delivery step.
Use /git-guardrails-claude-code when the project or user wants stronger protection against destructive git operations in Claude-driven workflows.
Do not treat it as part of the normal feature pipeline. It is a repo or user setup action that makes later work safer.
git push --force / git push -f (regular pushes are allowed)git reset --hardgit clean -f / git clean -fdgit branch -Dgit checkout . / git restore .When blocked, Claude sees a message telling it that it does not have authority to access these commands.
Ask the user: install for this project only (.claude/settings.json) or all projects (~/.claude/settings.json)?
The bundled script is at: scripts/block-dangerous-git.sh
Copy it to the target location based on scope:
.claude/hooks/block-dangerous-git.sh~/.claude/hooks/block-dangerous-git.shMake it executable with chmod +x.
Add to the appropriate 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"
}
]
}
]
}
}If the settings file already exists, merge the hook into existing hooks.PreToolUse array — don't overwrite other settings.
Ask if user wants to add or remove any patterns from the blocked list. Edit the copied script accordingly.
Run a quick test:
# Should be BLOCKED (exit 2):
echo '{"tool_input":{"command":"git push --force origin main"}}' | <path-to-script>
# Should be ALLOWED (exit 0):
echo '{"tool_input":{"command":"git push origin feature/my-branch"}}' | <path-to-script>The force-push command should exit with code 2 and print a BLOCKED message to stderr. The regular push should exit with code 0.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.