Pular para o conteúdo
Kitbay
Skill

git-guardrails-claude-code

MITAtualizado em 9 de nov. de 2026321.493Estrelas no GitHubInclui scripts

A skill from Matt Pocock's collection that installs a Claude Code hook stopping the agent from running destructive git commands.

O que a skill ensina

A skill from Matt Pocock's collection that installs a Claude Code hook stopping the agent from running destructive git commands. It asks whether to protect the current project or every project, copies a bundled shell script into the matching hooks folder, and adds a PreToolUse hook for Bash commands to the project or user settings file, merging with hooks already there. The script blocks git push in every form, hard resets, forced cleans, forced branch deletion and discarding all working-tree changes with checkout or restore, and tells the agent it has no authority to run them. Users can edit the blocked patterns, and a sample command confirms that a push is refused.

O que faz

  • Install a Claude Code hook for one project or all
  • Block git push and hard resets
  • Merge the hook into existing settings
  • Test that a blocked command is refused