Skip to main content

git-guardrails-claude-code

Install Claude hooks blocking dangerous git commands before execution.

Informations de source

Dépôt
redpanda-data/ui-harness
Dernière activité de la source
27 mai 2026 à 14:03
Langue détectée de SKILL.md
anglais
Étoiles
34
Forks
4

Options d'installation

Le prompt qui vérifie d'abord la source est sélectionné par défaut. Vous pouvez passer à une commande directe ou télécharger une copie locale.

Vérifiez les fichiers source

Lisez SKILL.md et les fichiers associés affichés par SkillsMP avant de décider de l'installer.

Explorateur de fichiers
2 fichiers

Affichage de SKILL.md

SKILL.md
Instructions source · Aperçu en lecture seule
name
git-guardrails-claude-code
description
Install Claude hooks blocking dangerous git commands before execution.
# Git Guardrails Install PreToolUse Bash hook blocking dangerous git before Claude runs it. Blocks: `git push`, `git reset --hard`, `git clean -f/-fd`, `git branch -D`, `git checkout .`, `git restore .`. ## Steps 1. Ask scope: project `.claude/settings.json` or global `~/.claude/settings.json`. 2. Copy bundled `scripts/block-dangerous-git.sh` to: - project: `.claude/hooks/block-dangerous-git.sh` - global: `~/.claude/hooks/block-dangerous-git.sh` 3. `chmod +x` hook. 4. Add PreToolUse Bash command in chosen settings: ```json {"hooks":{"PreToolUse":[{"matcher":"Bash","hooks":[{"type":"command","command":".claude/hooks/block-dangerous-git.sh"}]}]}} ``` 5. Test with blocked command. Confirm hook denies.
Voir sur GitHub