Skip to content
mcp/skillhub

Agent Skill

Git Guardrails Claude Code skill

git-guardrails-claude-codeMatt Pocock Skillsskills/misc/git-guardrails-claude-code/SKILL.md

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.

300kMIT

always on

62 tokname + description

once used

521 tokSKILL.md body

bundled files

21 scripts

installs

492kskills.sh

Install the Git Guardrails Claude Code skill

Skills CLI (Claude Code, Codex, Cursor and others)

npx skills add https://github.com/mattpocock/skills --skill git-guardrails-claude-code

Claude Code, by hand (all projects)

git clone --depth 1 https://github.com/mattpocock/skills.git /tmp/skills
mkdir -p ~/.claude/skills
cp -R /tmp/skills/skills/misc/git-guardrails-claude-code ~/.claude/skills/git-guardrails-claude-code

For one project only, copy the folder into .claude/skills/ in that project instead. The agent picks it up when a task matches its description.

What it costs your context

Agent Skills load in three steps. Tokens counted with the o200k tokenizer; your model's count will differ a little.

WhenWhat loadsCost
Every sessionName and description62 tok
When the agent uses itThe SKILL.md instructions521 tok
Only if opened2 bundled files (1 KB)varies

Until it is used, git-guardrails-claude-code costs about 22× less than the median MCP server we measured (1,362 tokens on every turn). Installing all 38 skills from mattpocock/skills would load 1,290 tokens of descriptions. Skills vs MCP study

Checks

  • Ships scripts the agent can run. Read them before installing.

Checked 2026-10-22 · method

What's inside

The headings of its SKILL.md. Read the full file on GitHub.

  • Setup Git Guardrails
  • What Gets Blocked
  • Steps
  • 1. Ask scope
  • 2. Copy the hook script
  • 3. Add hook to settings
  • 4. Ask about customization
  • 5. Verify

More skills from mattpocock/skills

All skills in this repo
  1. grill-memattpocock/skills

    A relentless interview to sharpen a plan or design.

    1.4M14 tok idle · 9 in use
  2. grill-with-docsmattpocock/skills

    A relentless interview to sharpen a plan or design, which also creates docs (ADR's and glossary) as we go.

    1.2M30 tok idle · 17 in use
  3. Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.

    1.2M32 tok idle · 1,304 in use
  4. tddmattpocock/skills

    Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.

    1.1M33 tok idle · 735 in use
  5. setup-matt-pocock-skillsmattpocock/skills

    Configure this repo for the engineering skills: set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills.

    1.0M44 tok idle · 1,673 in use
  6. handoffmattpocock/skills

    Compact the current conversation into a handoff document for another agent to pick up.

    1.0M19 tok idle · 151 in use
  7. triagemattpocock/skills

    Move issues and external PRs through a state machine of triage roles, categorise, verify, grill if needed, and write agent-ready briefs.

    979k33 tok idle · 1,510 in use
  8. prototypemattpocock/skills

    Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.

    976k39 tok idle · 597 in use