git-guardrails-claude-code

Block dangerous git commands in Claude Code workflows.

Updated May 31, 2026
One-click install
npx skills add https://github.com/danielorzeata83-a11y/Abc --skill git-guardrails-claude-code-danielorzeata83-a11y
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-guardrails-claude-code
Source: https://github.com/danielorzeata83-a11y/Abc/tree/main/.claude/skills/git-guardrails-claude-code
Command: npx skills add https://github.com/danielorzeata83-a11y/Abc --skill git-guardrails-claude-code-danielorzeata83-a11y

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Prevents accidental execution of dangerous git commands, ensuring safe and controlled use of git operations within Claude Code.

Core Features & Use Cases

  • Git Command Blocking: Blocks destructive git commands like push, reset --hard, and clean to avoid unintended data loss.
  • Project and Global Settings: Configure for project-specific or global git operations.
  • Customization: Allows users to add or remove patterns from the blocked list for flexible protection.
  • Verification: Simple test to confirm that dangerous commands are blocked.

Quick Start

Set up git guardrails for this project by copying the block-dangerous-git.sh script to .claude/hooks/ and making it executable.

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 in Claude Code?

To block destructive git commands in Claude Code, you can use a hook script that intercepts and prevents execution of operations like `push`, `reset --hard`, and `clean` to avoid unintended data loss.

What dangerous git operations should I prevent from running automatically?

Dangerous git operations that commonly cause data loss include `git push --force`, `git reset --hard`, and `git clean`. Blocking these commands ensures safe and controlled git operations within automated workflows.

Can I configure git command blocking for specific projects only?

Yes, you can configure git command blocking for either project-specific or global settings. This allows you to apply safety guardrails only where destructive git operations pose a risk.

How do I set up git safety hooks to intercept risky commands?

To set up git safety hooks, copy the `block-dangerous-git.sh` script to the `.claude/hooks/` directory and make it executable. This enables verification procedures for blocked commands.

Is it possible to customize which git commands are blocked?

Yes, customization options allow you to add or remove patterns from the blocked list. This provides flexible protection so you can tailor command blocking to your specific workflow requirements.