git-guardrails

Install a PreToolUse hook to block destructive git commands in Claude Code.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/Dedalus-ERP-PAS/hexagone-foundation-skills --skill git-guardrails-dedalus-erp-pas
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-guardrails
Source: https://github.com/Dedalus-ERP-PAS/hexagone-foundation-skills/tree/main/skills/git-guardrails
Command: npx skills add https://github.com/Dedalus-ERP-PAS/hexagone-foundation-skills --skill git-guardrails-dedalus-erp-pas

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires jq.

What problem does it solve?

This Skill blocks destructive git operations from being executed by Claude Code by installing a preventive PreToolUse hook that blocks dangerous commands before they run.

Core Features & Use Cases

  • Intercepts and blocks dangerous git commands (e.g., git push, git reset --hard, git clean, and git branch -D) before execution.
  • Provides clear feedback to the agent when a command is blocked, guiding users to run commands manually.
  • Easy to install in new or existing projects to enforce safety across AI-assisted development sessions.

Quick Start

Install the PreToolUse hook for Claude Code in your project to block destructive git commands.

Frequently Asked Questions about git-guardrails

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I block destructive git commands executed by Claude Code?

You can block destructive git commands by installing a PreToolUse hook that intercepts Claude Code tool invocations and blocks risky operations like git push or git reset --hard before execution. The hook provides feedback to guide manual execution instead.

What git operations are considered destructive and intercepted by pretooluse hooks?

Destructive git operations intercepted by pretooluse hooks include git push, git reset --hard, git clean, and git branch -D. The hook blocks these risky commands before they run during AI-assisted development sessions.

Can I install git guardrails in an existing project to enforce AI safety?

Yes, you can install the PreToolUse hook in new or existing projects to enforce safety across AI-assisted development sessions. It intercepts Claude Code tool invocations and blocks risky git operations before execution.

Do I need jq to set up pretooluse hooks for blocking git commands?

Yes, jq is required as a dependency to set up the PreToolUse hook that blocks dangerous git commands. The hook uses jq to parse tool invocations and intercept destructive operations before they execute.

What happens when a dangerous git command is blocked by the hook?

When a dangerous git command is blocked, the hook provides clear feedback to the agent and guides users to run the commands manually. This ensures destructive actions are intercepted before execution during AI-assisted workflows.

Why should I use hooks instead of manually checking git commands during AI development?

Using PreToolUse hooks automates the interception of destructive git commands, ensuring risky operations like git push or git clean are blocked before execution without relying on manual oversight. This enforces consistent safety across all AI-assisted development sessions.