Agent skill · Audited from source
git-guardrails-claude-code
skill · mattpocock/skillsMIT licenceAudited 31 Oct 2026 · source dcb0b8cc0e4d
Is it safe? Yes — SAFE, grade B (89/100). We read this skill's source at commit dcb0b8cc0e4d and found no filesystem, network or shell access and no hard-coded secrets. What it does: Set up Claude Code hooks to block dangerous git commands (push, reset --hard, clean, branch -D, etc.) before they execute. Use when user wants to prevent destructive git operations, add git safety hooks, or block git…
Cite
Cite this page
ModelsAtlas. “git-guardrails-claude-code (mattpocock/skills)”. Retrieved 31 Oct 2026. https://modelsatlas.com/skills/mattpocock/git-guardrails-claude-code
2 skills are called “git-guardrails-claude-code”. You are viewing mattpocock/skills.
- mattpocock/skills★ 308k✓SAFE
- vinvcn/mattpocock-skills-zh-cn★ 5.4k✓SAFE
Trust audit
Audit 0.4.1 · source read 31 Oct 2026
SAFE means nothing in the source contradicts what the skill says it does. Grade B is shared by 16,667 of 17,602 audited skills.
What the source does
- FilesystemNone observedNo reads or writes in the source
- NetworkNone observedNo outbound calls in the source
- ShellNone observedNo commands run in the source
- DependenciesPinnedNothing floats
- SecretsNone foundNo keys in source
Five audit layers
| Layer | What we check | Result | Findings |
|---|---|---|---|
L0 Provenance | Repo owner, licence, archive status, activity | PASS | 1 |
L1 Static source | Secrets, path traversal, supply chain, hidden code | PASS | 0 |
L2 Instructions | Prompt injection, authority framing, hidden directives | PASS | 0 |
L3 Inventory | The files and declarations match the source | PASS | 0 |
L4 Sandbox | Run in isolation and watch behaviour | SKIPPED why | 0 |
Gates applied: no behavioural pass.
Findings (1)
LOWInventory / provenanceinv.symlink · AGENTS.md
AGENTS.md
- Why
- link not followed
- Fix
- —
Audit 0.4.1 · source sha dcb0b8cc0e4d · 31 Oct 2026Report an issue or request a re-scan
Provenance
Who published it, and what the verdict is pinned to
- Publishermattpocock GitHub userOwner of the repository this skill is read from
- Source foldermattpocock/skills/skills/misc/git-guardrails-claude-codeThe exact folder we audited
- LicenceMITAs the repository states it
- Commit pinned for this verdictdcb0b8cc0e4dA new audit runs when the source changes
- Repository statusNot archivedPushed today
- Sandboxed runNot runSkills are read, not executed; layer L4 is skipped
What it tells the agent
Full source on GitHub ↗Its description: Set up Claude Code hooks to block dangerous git commands (push, reset --hard, clean, branch -D, etc.) before they execute. Use when user wants to prevent destructive git operations, add git safety hooks, or block git…
---
name: git-guardrails-claude-code
description: Set up Claude Code hooks to block dangerous git commands (push, reset --hard, clean, branch -D, etc.) before they execute. Use when user wants to prevent destructive git operations, add git safety hooks, or block git push/reset in Claude Code.
---
# 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.
## Steps
### 1. Ask scope
Ask the user: install for **this project only** (`.claude/settings.json`) or **all projects** (`~/.claude/settings.json`)?
### 2. Copy the hook script
The bundled script is at: [scripts/block-dangerous-git.sh](scripts/block-dangerous-git.sh)
Copy it to the target location based on scope:
- **Project**: `.claude/hooks/block-dangerous-git.sh`
- **Global**: `~/.claude/hooks/block-dangerous-git.sh`
Make it executable with `chmod +x`.
### 3. Add hook to settings
Add to the appropriate settings file:
**Project** (`.claude/settings.json`):
```json
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/block-dangerous-git.sh"
}
]
}
]
}
}
```
**Global** (`~/.claude/settings.json`):
```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 the existing `hooks.PreToolUse` array. Don't overwrite other settings.
### 4. Ask about customization
Ask if user wants to add or remove any patterns from the blocked list. Edit the copied script accordingly.
### 5. Verify
Run a quick test:
```bash
echo '{"tool_input":{"command":"git push origin main"}}' | <path-to-script>
```
Should exit with code 2 and print a BLOCKED message to stderr.Excerpt, first 2,312 characters of SKILL.md, verbatim from the audited commit. It is text from someone else’s repository, quoted so you can judge it before your agent reads it.
Install
Pinned to the audited commit dcb0b8c
git clone https://github.com/mattpocock/skills git -C skills checkout dcb0b8cc0e4d
The author documents no install command, so this uses the repository directly. Our verdict covers commit dcb0b8cc0e4d only.
Works in which agents?
What its own text says, not a test
| Agent | Status | More |
|---|---|---|
| Claude Code | Mentioned in its text, not tested | Skills for Claude Code · About Claude Code |
Audit history
Every audit, every source change
- ✓SAFE B 89 / 100
first audit · source
dcb0b8cc0e4d
README badge
For maintainers · shows the latest audit
[](https://modelsatlas.com/skills/mattpocock/git-guardrails-claude-code/)
The badge shows our verdict and grade for this skill, and links back to this page. It changes when the audit does.
Similar skills
obra/superpowers
Use when creating new skills, editing existing skills, or verifying skills work before deployment
mattpocock/skills
A relentless interview to sharpen a plan or design, which also creates docs (ADR's and glossary) as we go.
mattpocock/skills
Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.
Add this badge to your README
[](https://modelsatlas.com/skills/mattpocock/git-guardrails-claude-code/)
<a href="https://modelsatlas.com/skills/mattpocock/git-guardrails-claude-code/"><img src="https://modelsatlas.com/skills/mattpocock/git-guardrails-claude-code/badge.svg" alt="ModelsAtlas: SAFE B"></a>
Questions about git-guardrails-claude-code
What does the git-guardrails-claude-code skill do?
Is git-guardrails-claude-code safe to install?
What can git-guardrails-claude-code access on my machine?
Which assistants does git-guardrails-claude-code work with?
How current is this page?
Sources
- github.com/mattpocock/skills/tree/main/skills/misc/git-guardrail — the audited source at commit dcb0b8cc0e4d and every finding aboveObserved · 31 Oct 2026
Spotted something wrong? Report a correction · Methodology
Keep going in your AI
Opens with this page as the source. We add nothing else to the prompt.
- What does the git-guardrails-claude-code skill do?
- Is git-guardrails-claude-code safe to install?
- What can git-guardrails-claude-code access on my machine?