
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.
Add to a SourceWeft workspace
- Open the skill in your dashboard and add it to a workspace.
- 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 SourceWeftYou 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.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-codeAdd --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-codeSource 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.
More from mattpocock/skills

Chief Of Staff
mattpocock
Coordinates subagents and schedules to pursue a long-running goal in one session.

Writing For Agents
mattpocock
A reference on writing documents that AI agents consume, such as skills, AGENTS.md and CLAUDE.md files.

Wait What
mattpocock
Re-pitches a confusing message using Simplified Technical English and the project's ubiquitous language.

To Questionnaire
mattpocock
Turns a decision the user cannot answer alone into a Markdown questionnaire for someone else to fill in.

Teach
mattpocock
Teaches a user a topic over multiple sessions, producing HTML lessons, reference sheets and learning records in a workspace.

Handoff
mattpocock
Compacts the current conversation into a handoff document so a fresh agent can continue the work.
More in Security

Dpop Adoption
Guides implementation of OAuth 2.0 DPoP (RFC 9449) sender-constrained refresh tokens for Google's OAuth platform.

Secops Triage
Guides SOC analysts through triaging Google SecOps security alerts, from investigation to closure or escalation.

Secops Investigate
Guides SOC analysts through deep security incident and entity investigations in Google SecOps using UDM queries and timelines.

Secops Hunt
Guides proactive threat hunting in Google SecOps using UDM queries, IoC lookback, prevalence and outlier analysis.

Secops Cases
Manages Google Security Operations SOAR cases across their lifecycle via MCP tools.

Iam Helper For Privileged Access Management
Guides Google Cloud Privileged Access Manager entitlement CRUD, temporary access requests, and grant approval workflows.