·git-safety-guard
</>

git-safety-guard

Blocks destructive git and filesystem commands before execution. Prevents accidental loss of uncommitted work from git checkout --, git reset --hard, rm -rf, and similar destructive operations. Works as a Claude Code PreToolUse hook with fail-open semantics.

15Installs·0Trend·@terraphim

Installation

$npx skills add https://github.com/terraphim/terraphim-skills --skill git-safety-guard

How to Install git-safety-guard

Quickly install git-safety-guard AI skill to your development environment via command line

  1. Open Terminal: Open your terminal or command line tool (Terminal, iTerm, Windows Terminal, etc.)
  2. Run Installation Command: Copy and run this command: npx skills add https://github.com/terraphim/terraphim-skills --skill git-safety-guard
  3. Verify Installation: Once installed, the skill will be automatically configured in your AI coding environment and ready to use in Claude Code, Cursor, or OpenClaw

Source: terraphim/terraphim-skills.

SKILL.md

View raw

Use this skill when setting up or configuring protection against destructive git/filesystem commands in Claude Code.

Git Safety Guard intercepts Bash commands before execution and blocks dangerous operations that could permanently destroy uncommitted work or important files. The guard uses regex pattern matching with an allowlist to distinguish between safe and dangerous variants of commands.

| git checkout -- | Discards uncommitted changes permanently | | git restore | Discards uncommitted changes (except --staged) | | git reset --hard | Destroys all uncommitted changes | | git reset --merge | Can lose uncommitted changes | | git clean -f | Removes untracked files permanently | | git push --force | Destroys remote history |

Blocks destructive git and filesystem commands before execution. Prevents accidental loss of uncommitted work from git checkout --, git reset --hard, rm -rf, and similar destructive operations. Works as a Claude Code PreToolUse hook with fail-open semantics. Source: terraphim/terraphim-skills.

Facts (cite-ready)

Stable fields and commands for AI/search citations.

Install command
npx skills add https://github.com/terraphim/terraphim-skills --skill git-safety-guard
Category
</>Dev Tools
Verified
First Seen
2026-02-20
Updated
2026-03-11

Browse more skills from terraphim/terraphim-skills

Quick answers

What is git-safety-guard?

Blocks destructive git and filesystem commands before execution. Prevents accidental loss of uncommitted work from git checkout --, git reset --hard, rm -rf, and similar destructive operations. Works as a Claude Code PreToolUse hook with fail-open semantics. Source: terraphim/terraphim-skills.

How do I install git-safety-guard?

Open your terminal or command line tool (Terminal, iTerm, Windows Terminal, etc.) Copy and run this command: npx skills add https://github.com/terraphim/terraphim-skills --skill git-safety-guard Once installed, the skill will be automatically configured in your AI coding environment and ready to use in Claude Code, Cursor, or OpenClaw

Where is the source repository?

https://github.com/terraphim/terraphim-skills