git-guardrails-claude-code

Intercepts and blocks high-risk git commands in Claude Code via PreToolUse hook configuration.

28|3|Updated Apr 28, 2026
One-click install
npx skills add https://github.com/Minara-AI/cc-connect --skill git-guardrails-claude-code-minara-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-guardrails-claude-code
Source: https://github.com/Minara-AI/cc-connect/tree/main/.claude/skills/git-guardrails-claude-code
Command: npx skills add https://github.com/Minara-AI/cc-connect --skill git-guardrails-claude-code-minara-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires jq, and includes scripts (resource) components.

What problem does it solve?

This Skill prevents accidental execution of destructive or high-risk git operations by Claude Code, ensuring that sensitive branches or repository states remain protected from automated interference.

Core Features & Use Cases

  • Command Interception: Automatically blocks dangerous commands like git push, reset --hard, and branch -D before they reach the shell.
  • Flexible Scoping: Supports both project-specific and global installation patterns to suit different security requirements.
  • Use Case: A developer wants to ensure that Claude Code cannot accidentally push changes to a production branch or reset the local working directory during an experimental refactoring session.

Quick Start

Ask Claude to install the git guardrails script to the current project settings to block dangerous git commands.

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

You prevent destructive git commands by configuring a PreToolUse hook validation script that intercepts and blocks high-risk operations like git push, reset --hard, and branch -D before they reach the shell environment.

Can I scope git safety guardrails to apply globally across all projects?

Yes, you can scope git safety guardrails globally. The validation script supports both project-specific and global installation patterns to suit different security requirements for your automated development workflows.

How does command interception work for blocking git push in automated agents?

Command interception for blocking git push works by using a PreToolUse hook configuration in Claude Code. This hook executes a bash-compatible validation script that checks commands against high-risk patterns before they reach the shell.

Do I need jq installed to block high-risk git operations?

Yes, you need jq installed. The validation script requires jq as a dependency, along with a bash-compatible shell environment and the PreToolUse hook configuration, to successfully intercept and block high-risk git operations.

What are the limitations of using a validation script for git operational boundaries?

A limitation of using a validation script for git operational boundaries is that it requires a bash-compatible shell environment and the PreToolUse hook configuration to function. It strictly blocks commands rather than modifying them to be safe.