Skip to content
Free and open to everyone. The lessons keep improving thanks to your feedback.
Language : EN

Starting and steering the agent Point of caution Intermediate

git-guardrails-claude-code

mattpocock/skills

Bloquer les commandes git destructrices par un hook

The skill descriptions are in French for now. The interface is in English; the pages will be translated later.

This description is still being proofread: the technical information is checked, the wording has not yet been validated by a human.

What it does

Installe un garde-fou qui bloque avant exécution les commandes git destructrices, comme push, reset --hard, clean -f ou branch -D. Tu choisis de le poser sur un seul projet ou sur tous.

Who it is for

Pour toi qui laisses l'agent travailler avec git et qui veux l'empêcher d'effacer du travail ou de publier par erreur.

Example requests

  • « Bloque les commandes git dangereuses dans ce projet. »
  • « Installe un garde-fou pour que l'agent ne fasse jamais git push. »
  • « Ajoute git branch -D à la liste des commandes interdites. »

Limits

  • Il écrit un hook dans le fichier settings.json : l'agent doit te demander ton accord clair avant de toucher à ce fichier.
  • Il demande bash et jq ; sous Windows, il faut Git Bash et jq, et ce cas n'a pas été vérifié.
  • Il ne marche qu'avec Claude Code.
  • Il bloque aussi git push : tu devras publier toi-même ou retirer cette règle.

Install this skill

Prerequisites : bash + jq (Windows : Git Bash + jq)

Copy the command, paste it into your terminal (Mac) or PowerShell (Windows), then confirm yourself when the program asks.

Command (latest published version)

npx skills add https://github.com/mattpocock/skills --skill git-guardrails-claude-code -a claude-code

The npx command needs Node.js 22.20 or later. Windows : scripts bash (scripts__block-dangerous-git.sh) : Git Bash ou WSL sous Windows; si la création de liens échoue : ajouter --copy (non testé).

Command pinned to the checked version · Or from the official Claude Code plugin catalog

Command pinned to the checked version

npx skills add mattpocock/skills@4ae2317ddb22b046e26455e4f9c9b3aaaf62212d --skill git-guardrails-claude-code -a claude-code

Or from the official Claude Code plugin catalog (The plugin may install several skills at once.)

/plugin install mattpocock-skills@claude-plugins-official

Command checked against the documentation, not yet tried by Neurylio.

Before installing. Read the SKILL.md file on GitHub, check where the skill comes from and what it can do. The lessons of module 7 explain how:

Back to the library