Ship & operateMIT

Git guardrails for Claude Code

by Matt Pocock (opens in a new tab) mattpocock/skills

Installs Claude Code hooks that block destructive git commands before they run.

Installation

Skills CLI

Skills CLI command
npx skills@latest add mattpocock/skills --skill git-guardrails-claude-code

Requires Node.js and npm. Choose your agents in the installer; add -g for a global installation.

Fieldbook review

Reviewed 27 Sept 2026

Blocks push, hard reset, clean and forced branch deletes. Claude Code only; asks for scope first.

  • LicenceMIT
  • FrontmatterValid name and description
  • Risky patterns1 match cleared on reading: Lists force-push as one of the commands its hook blocks.
  • Size96 lines
  • Last checked27 Sept 2026 · 69b291d655626a01602b998a1836fcb93c058ede68dfafddfd71e87f17074764

What it can touch

  • Edits code

    Changes files in your project.

  • Runs commands

    Runs shell commands such as tests, builds or installs.

Read the source

Fieldbook links to the original instead of copying it, so you always read the version you install.

skills/misc/git-guardrails-claude-code/SKILL.md on GitHub (opens in a new tab)