guard-git

guard-git is a skill for Claude Code from danielvm-git/bigpowers. It costs 100 tokens per session (2,257 once invoked), scanned B, original, MIT.

A safety and workflow guard for Git, the version-control tool used to track code changes. It installs checks that block risky commands, protect important branches, enforce a commit format, and detect common secrets.

In plain words
What is it for?
Use it before an agent commits, pushes, resets, cleans, deletes branches, or restores files. It supports several coding-agent tools and requires jq when its hook runs.
Why use it?
It helps prevent lost work, accidental changes to shared branches, badly formatted commits, and credentials being checked into the repository.

Skill for Claude Code

Written for Claude Code: $CLAUDE_PROJECT_DIR variable. Also seen: model in frontmatter; reads .claude/ paths; mentions Claude Code.

Good fit Use it before an agent commits, pushes, resets, cleans, deletes branches, or restores files. It supports several coding-agent tools and requires jq when its hook runs.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/danielvm-git/bigpowers/guard-git
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add danielvm-git/bigpowers --skill guard-git
Clone the repo
git clone --depth 1 https://github.com/danielvm-git/bigpowers

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for guard-git

README.md
[![agentmods](https://agentmods.dev/badge/skills/danielvm-git/bigpowers/guard-git/github.svg)](https://agentmods.dev/skills/danielvm-git/bigpowers/guard-git)
Your own site
<a href="https://agentmods.dev/skills/danielvm-git/bigpowers/guard-git"><img src="https://agentmods.dev/badge/skills/danielvm-git/bigpowers/guard-git/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for guard-git

Your own site · 80×15
<a href="https://agentmods.dev/skills/danielvm-git/bigpowers/guard-git"><img src="https://agentmods.dev/badge/skills/danielvm-git/bigpowers/guard-git.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 100 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,257 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 7 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Tool Misuse · line 4
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
  • high Tool Misuse · line 15
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
  • high Tool Misuse · line 181
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
  • high Agent Snooping · line 31
    Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.
    Fix: Remove all code or instructions that access agent configuration directories (.claude/, .codex/, .gemini/). If configuration values are needed, pass them explicitly as parameters or environment variabl
  • high Agent Snooping · line 33
    Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.
    Fix: Remove all code or instructions that access agent configuration directories (.claude/, .codex/, .gemini/). If configuration values are needed, pass them explicitly as parameters or environment variabl
  • high Tool Misuse · line 178
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
  • medium Excessive Agency · line 3
    Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.
    Fix: Remove the model/provider override or disclose it prominently and require explicit operator approval before invoking an external coding CLI or billed model.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00100 $0.02257
Opus 5.5 $0.00040 $0.00903
Sonnet 5.5 $0.00020 $0.00451
Haiku 4.5 $0.00010 $0.00226

Measured 26d ago against content hash ede498117838, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

guard-git scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 26d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

| Claude Code | `PreToolUse` (Bash) | `.claude/settings.json` or `~/.claude/settings.json` |
.cline/skills/guard-git/SKILL.md · 237 lines

How it starts

The opening of the file, as written. The whole thing — 237 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Guard Git

HARD GATE — HARD GATE — Before committing, verify: branch is not main/master, author is correct, git user is configured. Bad commits are hard to fix.

Installs a shared hook that blocks destructive git operations and enforces workflow discipline. Requires jq on the agent's PATH when the hook runs.

What gets blocked/enforced

  • Safety: force push (-f, --force, +refspec), reset with --hard, clean with any -f*, branch -D / --delete --force, checkout/restore that discard work (-f, . pathspec).
  • Argv, not substrings: the hook tokenizes each command, strips git's global options (-C <path>, -c k=v, --no-pager, --git-dir=…) and judges the (subcommand, arguments) pair — so git -C repo reset -q --hard is blocked, while git push --force-with-lease is allowed. Rules live in scripts/lib/git-argv.py, mirrored in extensions/omp-hooks.ts; scripts/test-guard-git-normalize.sh fails if the two disagree.
  • Discipline: Blocks direct commits or pushes to protected branches (main, master) unless GIT_BIGPOWERS_LAND=1 (set only by scripts/land-branch.sh).
  • Allows: git push origin <feature-branch> for backup/CI; solo land push to main only inside land-branch.sh.
  • Standardization: Enforces Conventional Commits for all git commit commands.
  • Secrets: Blocks commits containing common secret patterns (sk-, ghp_, AKIA, xoxb-, -----BEGIN private keys) — see REFERENCE.md.

Quick start

  1. Scope: ask project-only vs global (paths differ per product).
  2. Write the hook bundle from REFERENCE.md into the client's hooks directory.
  3. Run chmod +x on pre-tool-use.sh.
  4. Merge the hook snippet from REFERENCE.md into the right settings file — do not wipe unrelated keys.
  5. Verify with the tests in REFERENCE.md.
Client Mechanism Config
Claude Code PreToolUse (Bash) .claude/settings.json or ~/.claude/settings.json
Cursor / Cursor CLI beforeShellExecution .cursor/hooks.json or ~/.cursor/hooks.json
Gemini CLI BeforeTool + run_shell_command .gemini/settings.json or ~/.gemini/settings.json
Google Antigravity Built-in Terminal Deny list Settings UI (no shell hook)

Read the full file on GitHub · 237 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 26d ago Changed · +5 lines ede498117838
  2. 3mo ago First seen · 232 lines · 100 tokens per session scan B 35d2a345eb6d

Subscribe to this mod's changes

guard-git is a skill published in the GitHub repository danielvm-git/bigpowers (297 stars, last pushed 4d ago), licensed MIT. It adds 100 tokens to every session and 2,257 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

guard-git compared with skills from other repositories

guard-git next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
guard-gitdanielvm-git/bigpowersSkill2974d agoMITB100Claude Code
git-advanced-workflowswshobson/agentsSkill43k6d agoMITA54Claude Code
workflow-patternswshobson/agentsSkill43k6d agoMITA35Claude Code
block-no-verify-hookwshobson/agentsSkill43k6d agoMITC46Claude Code
conventional-commitsskyf0xx/hedgehogSkill50yesterdayMITA88Claude Code
pr-writingskyf0xx/hedgehogSkill50yesterdayMITA107Claude Code
hedgehog-orchestratingskyf0xx/hedgehogSkill50yesterdayMITA151Claude Code