git-guardrails-claude-code

Block dangerous git commands before execution in Claude Code.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Prevents destructive git operations such as push, reset --hard, clean, and branch -D before they execute, enhancing workflow safety.

Core Features & Use Cases

  • Blocks dangerous git commands: Mitigates risks associated with destructive git actions.
  • Customizable scope: Can be applied to individual projects or all projects for comprehensive protection.
  • PreToolUse hook: Intercepts and blocks git commands before they are executed in Claude Code.

Quick Start

Install the skill and configure it to block dangerous git commands for the current 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 prevent destructive git commands from executing in Claude Code?

PreToolUse hooks intercept and block dangerous git commands like push, reset --hard, clean, and branch -D before they execute in your Claude Code environment.

What git commands should be blocked to protect my workflow?

Dangerous git commands include push, reset --hard, clean, and branch -D, which can cause unintended repository changes or data loss during automated workflows.

Can I apply pre-commit hooks to block git commands for all my projects?

You can configure pre-commit hooks to block git commands either for an individual project or apply the scope to all projects for comprehensive workflow protection.

How do pre-commit hooks intercept git commands before execution?

PreToolUse hooks intercept git commands within the Claude Code environment, catching dangerous operations and blocking them before the command executes.

Do I need Claude Code to use pre-commit hooks for git safety?

Yes, this skill requires a Claude Code environment with appropriate configuration settings to properly intercept and block destructive git commands.

When should I use pre-commit hooks for git safety?

Use pre-commit hooks for git safety when automated workflows risk executing destructive commands like reset --hard or clean, requiring interception to prevent unintended repository damage.