Git Guardrails Claude Code

by mattpocockc55ee46073edNo licenseListed Oct 8, 2026Updated Oct 8, 2026

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.

Includes scriptsSecurityAI & Agents

Add to a SourceWeft workspace

  1. Open the skill in your dashboard and add it to a workspace.
  2. Enable it for the chats that should use it.

This skill includes scripts. They run in your workspace sandbox when the skill is used — review the file list and source before adding it.

Add to SourceWeft

You will be asked to sign in first, then taken straight to this skill.

Ask your agent to install it

Paste this prompt into Claude Code, Codex, Cursor or another agent that can run commands — or into SourceWeft chat. The agent reads this skill's install guide, shows you its source, license and scripts, and installs it with the SourceWeft CLI once you agree.

Read https://sourceweft.com/skills/gh-mattpocock-skills-git-guardrails-claude-code/install.md and install the skill it describes. Before installing, show me its source, license and whether it ships scripts, and wait for my OK. Ask me before changing anything else on my machine.

Read the install guide the agent follows

Install it yourself from a terminal

For Claude Code, Codex, Cursor and other local agents. The SourceWeft CLI fetches the skill from its source repository at the commit scanned here, and verifies every file against the hashes recorded when the skill was scanned. If anything differs, nothing is written.

npx @sourceweft/cli skills install gh-mattpocock-skills-git-guardrails-claude-code

Add --agent claude-code, codex, cursor or universal to choose which agent gets it (Claude Code by default).

Installed locally, this skill's scripts run on your machine, not in a sandbox. Read them first — the CLI asks before installing.

Upstream installer — not verified by SourceWeft

The open-source skills installer fetches the same pinned commit, but does not check the files against the hashes SourceWeft recorded.

npx skills add https://github.com/mattpocock/skills/tree/c55ee46073ed923f86ce59a5eb3b6d895095d1b7/skills/misc/git-guardrails-claude-code

Source and attribution

Source:mattpocock/skillsinskills/misc/git-guardrails-claude-codeat commitc55ee46

License: No license

Content belongs to its original authors. SourceWeft indexes it from a public repository.

Report or request removal