git-guardrails-claude-code

Configure Claude pre-command hooks to block dangerous git operations.

46|7|Updated Oct 12, 2025
One-click install
npx skills add https://github.com/adriannoes/awesome-vibe-coding --skill git-guardrails-claude-code-adriannoes
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-guardrails-claude-code
Source: https://github.com/adriannoes/awesome-vibe-coding/tree/main/cursor-and-claude/skills/matt-pocock/misc/git-guardrails-claude-code
Command: npx skills add https://github.com/adriannoes/awesome-vibe-coding --skill git-guardrails-claude-code-adriannoes

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill helps prevent accidental or malicious execution of dangerous git commands, safeguarding repositories from unwanted modifications.

Core Features & Use Cases

  • Git Command Blocking: Sets up hooks to intercept commands like git push --force, git reset --hard, and git clean before they run.
  • Safety Enforcement: Ensures that destructive or unsafe git operations are blocked, providing alerts and messages to Claude or the user.
  • Use Case: A team wants to prevent accidental data loss during development by stopping malicious git resets or force pushes in shared repositories.

Quick Start

Use the git guardrails skill to configure Claude to block risky git commands before execution.

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 accidental git push --force in a shared repository?

Git command blocking works by installing pre-command hooks that intercept risky git operations before they run. The hooks ensure destructive commands like git reset --hard and git clean are blocked, providing alerts to Claude or the user.

Can I configure git hooks globally to block dangerous commands across all projects?

To set up git safety hooks, configure Claude to install pre-command scripts that block risky git commands before execution. The Skill manages hook installation in local or global config locations to enforce repository safety.

Does git safety enforcement work for team environments to stop malicious git resets?

Git safety hooks specifically block destructive commands like git push --force, git reset --hard, and git clean before they run. This prevents accidental or malicious execution of operations that cause unwanted repository modifications.

What are the limitations of using pre-command hooks for git safety?

Git safety hooks prevent destructive git operations by intercepting commands like git push --force, git reset --hard, and git clean before they run. The installed scripts provide alerts and block unsafe operations to ensure repository safety.