Git guardrails claude code

From redpanda-data/ui-harness · View interactive version

Git guardrails claude code is an AI agent skill from the GitHub repository redpanda-data/ui-harness. Install Claude hooks blocking dangerous git commands before execution.

How to use this skill

Skill file

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:
  1. chmod +x hook.
  2. Add PreToolUse Bash command in chosen settings:
{"hooks":{"PreToolUse":[{"matcher":"Bash","hooks":[{"type":"command","command":".claude/hooks/block-dangerous-git.sh"}]}]}}
  1. Test with blocked command. Confirm hook denies.
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.