git-guardrails-claude-code

Block destructive Git commands like push and reset --hard.

Updated Jul 6, 2026
One-click install
npx skills add https://github.com/AtharvaN16/Personal-Lib --skill git-guardrails-claude-code-atharvan16
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-guardrails-claude-code
Source: https://github.com/AtharvaN16/Personal-Lib/tree/main/.agents/skills/git-guardrails-claude-code
Command: npx skills add https://github.com/AtharvaN16/Personal-Lib --skill git-guardrails-claude-code-atharvan16

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires , and includes scripts (resource) components.

What problem does it solve?

Prevents destructive Git commands like 'push', 'reset --hard', 'clean', and 'branch -D' from executing, enhancing Git safety.

Core Features & Use Cases

  • Git Command Blocking: Blocks dangerous Git commands to protect against accidental destructive actions.
  • Scope Selection: Supports project-specific or global application of hooks based on user preference.
  • Customization: Allows users to add or remove blocked patterns as needed.

Quick Start

Set up Git Guardrails to block destructive commands for your project by executing: git guardrails-claude-code setup

Frequently Asked Questions about git-guardrails-claude-code

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

FAQPage Schema
How do I block destructive Git commands like push and reset --hard?

You can block destructive Git commands by setting up Git Guardrails to intercept operations, validating them against a dangerous patterns list, and providing feedback to prevent unauthorized actions.

Can I apply Git safety hooks globally or just to a specific project?

Yes, Git Guardrails supports scope selection, allowing you to apply command blocking hooks either globally or restricted to a specific project based on your preference.

How do I customize which Git commands are blocked?

You can customize blocked patterns by adding or removing specific Git commands from the validation list to suit your project's safety requirements.

Do I need a script execution environment to use Git hooks for code security?

Yes, implementing Git Guardrails requires a script execution environment and access to Git settings to properly intercept and validate commands.

What Git commands are considered destructive and should be blocked?

Destructive Git commands include push, reset --hard, clean, and branch -D, which Git Guardrails prevents from executing to protect against accidental destructive actions.

How do I set up Git Guardrails for my project?

Set up Git Guardrails to block destructive commands for your project by executing the command git guardrails-claude-code setup in your environment.