git-guardrails-claude-code

Block dangerous git commands in Claude Code workflows.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Intercepts and blocks dangerous git commands within Claude Code to prevent destructive operations.

Core Features & Use Cases

  • Blocking harmful commands: blocks git push (including --force), git reset --hard, git clean, and git branch -D.
  • Scope-aware deployment: supports project-local and global installation scopes.
  • Safe workflow integration: provides clear messaging when a command is blocked and guidance for remediation.

Quick Start

Install the bundled hook script into the appropriate Claude Code location and configure the scope in the settings.

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 block destructive git commands like git push --force in Claude Code?

You can block destructive git commands in Claude Code by installing a bundled hook script and configuring the settings to intercept and prevent operations like git push --force, git reset --hard, and git clean.

What dangerous git commands should I prevent from running in automated workflows?

Dangerous git commands to block in automated workflows include git push, git reset --hard, git clean, and git branch -D, as these can permanently destroy commits, untracked files, and branches.

Can I apply git safety hooks globally or only to a specific project in Claude Code?

Git safety hooks support both project-local and global installation scopes in Claude Code, allowing you to apply git command blocking either to a single repository or across all your automated workflows.

Do I need jq to set up git command blocking with hook scripts?

Yes, you need jq installed as a dependency to configure and run the bundled hook script that intercepts and blocks dangerous git commands within your Claude Code environment.

What happens when a blocked git command is intercepted during a Claude Code session?

When a blocked git command is intercepted, Claude Code provides clear messaging that the command was blocked and offers guidance for remediation to safely proceed with your workflow.