git-guardrails-claude-code

Block dangerous git commands before execution in Claude Code.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill prevents destructive git commands from executing in Claude Code, reducing the risk of unintentional data loss or corruption.

Core Features & Use Cases

  • Git Command Blocking: Intercepts and blocks dangerous git commands like push, reset --hard, and clean before they are executed.
  • Scope Selection: Can be installed for individual projects or globally across all projects.
  • Customization: Allows the user to add or remove patterns from the blocked list.
  • Verification: Provides a quick test to verify that the guardrail is functioning correctly.

Quick Start

Install the git-guardrails skill for this project only and run a test to ensure the dangerous git commands are blocked.

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 Claude Code from running destructive git commands?

You can prevent destructive git commands in Claude Code by installing a pre-execution guardrail that intercepts and blocks operations like git push, reset --hard, and clean before they execute, reducing the risk of accidental data loss.

Can I customize which git commands are blocked in Claude Code?

Yes, you can customize the git command blocking list by adding or removing patterns. This allows you to guard against dangerous operations without over-blocking useful commands in your workflow.

Does this git safety guardrail work for individual projects or globally?

The git safety guardrail supports scope selection for both individual project installation and global installation across all projects, allowing you to choose the appropriate strict git command control scope.

How do I verify that my git command blocking is functioning correctly?

You can verify that git command blocking is functioning correctly by running a quick test after installation. This test ensures the pre-execution checks successfully intercept dangerous commands before they execute.

What is a pre-execution check for git operations in Claude Code?

A pre-execution check for git operations is a safety mechanism that intercepts commands before execution to prevent accidental data loss or corruption, suited for users with varying technical expertise requiring strict git control.