Skip to main content

Git Protection

Plugin Verified Active

Git safety hooks for Claude Code. Blocks force-push, protects main/master branch, prevents hard-reset, guards interactive rebase, and blocks git clean -fd.

Purpose

To enhance the safety and reliability of AI-driven Git operations by preventing accidental data loss and code corruption.

Features

  • Blocks force-pushing to Git repositories
  • Protects main and master branches from direct pushes
  • Prevents irreversible Git resets
  • Guards against accidental deletion of untracked files with `git clean -fd`

Use Cases

  • Use when employing AI agents for Git operations to prevent data loss.
  • Use to enforce safer Git workflows in team environments.
  • Use to protect critical branches from accidental overwrites.

Non-Goals

  • Managing Git repositories beyond safety checks.
  • Providing AI-assisted Git command generation.

Documentation

  • info:Configuration & parameter referenceThe README mentions configuration variables for hooks like `CC_ALLOW_DESTRUCTIVE`, `CC_PROTECT_BRANCHES`, and `CC_SECRET_PATTERNS`, but a detailed reference with explicit defaults and precedence order is missing.

Execution

  • info:ValidationThe hook scripts use `jq` for parsing input and basic string matching (grep) for validation, but lack a formal schema library for robust parameter validation.

Invocation

  • info:Hooks-off mechanismThere is no explicit 'hooks-off' mechanism documented or provided in the plugin. Users would need to uninstall the plugin to disable hooks.

Installation

First, add the marketplace

/plugin marketplace add yurukusa/cc-safe-setup
/plugin install git-protection@cc-safe-setup

Quality Score

Verified
94 /100
Analyzed about 14 hours ago

Trust Signals

Last commitabout 16 hours ago
Stars25
LicenseMIT
Status
View Source

© 2025 SkillRepo · Find the right skill, skip the noise.