/git-guardrails-claude-code
幫你在 Claude Code 裡裝上 hook,擋掉危險的 git 指令(像 push、reset --hard、clean、branch -D 這類)在真正執行之前先攔下來,避免 agent 手滑做出不可逆的操作。
- 安裝次數
- 52.6 萬
- 專案星數
- 31 萬 ★
- 授權
- MIT
- 專案更新
- 2026-11-01
什麼時候用
想預防 Claude Code 誤跑破壞性 git 指令、或想加一層 git 安全網時用。
怎麼裝
npx skills add https://github.com/mattpocock/skills --skill git-guardrails-claude-code安裝前請先看過原文內容。中文說明是 AI 翻譯,不保證安全。
原文
Set up Claude Code hooks to block dangerous git commands (push, reset --hard, clean, branch -D, etc.) before they execute. Use when user wants to prevent destructive git operations, add git safety hooks, or block git push/reset in Claude Code.