git-guardrails-claude-code

Community

Block git commands with Claude Code hooks.

Authorbohdanbirdie
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Blocks dangerous git commands before Claude Code executes them, preventing destructive operations from occurring in automated workflows.

Core Features & Use Cases

  • PreToolUse hook installation for project scope or global scope to enforce safety before code runs.
  • Bundled guard script at scripts/block-dangerous-git.sh that blocks risky commands like git push, git reset --hard, git clean -f/-fd, git branch -D, and git checkout/restore.
  • Two deployment scopes: apply to a single project (via .claude/settings.json) or globally (via ~/.claude/settings.json), suitable for developer teams and CI environments.
  • Safe collaboration by preventing accidental destructive commands in shared repos and automated tasks.

Quick Start

Install the bundled guard script and configure the scope (project or global) as described to start blocking dangerous git operations.

Dependency Matrix

Required Modules

jq

Components

scripts

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: git-guardrails-claude-code
Download link: https://github.com/bohdanbirdie/cloudstash/archive/main.zip#git-guardrails-claude-code

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.