git-guardrails-claude-code

Block dangerous git commands before execution in Claude Code.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill blocks dangerous git commands before execution, preventing destructive actions like 'push', 'reset --hard', and 'clean' in Claude Code.

Core Features & Use Cases

  • Git Safety Hooks: Blocks dangerous git commands before they execute.
  • Scope Selection: Can be installed for individual projects or globally.
  • Customization: Allows user to add or remove blocked patterns.
  • Verification: Includes a test command to verify the setup.

Quick Start

Run 'git-guardrails-claude-code' to set up git safety hooks for your project.

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 dangerous git commands like push and reset --hard in Claude Code?

You can block dangerous git commands by installing git safety hooks that intercept and prevent destructive actions like push, reset --hard, and clean before they execute in Claude Code.

Can I apply git command blocking globally or just for individual projects?

Git command blocking supports both global git operations and individual project scopes, allowing you to configure safety hooks for your entire environment or a specific repository.

How do I verify that my git safety hooks are configured correctly?

You can verify your git safety hooks by running the included test command, which checks the setup and confirms that the command blocking configuration is properly applied.

What destructive git actions can I prevent from executing in my development workflow?

Pre-execution verification blocks destructive git actions such as push, reset --hard, and clean, and allows you to customize blocked patterns by adding or removing commands.

How do I customize which git commands are blocked by Claude Code hooks?

You can customize blocked git commands by modifying the safety hook patterns, allowing you to add or remove specific git commands from the pre-execution verification list.