Skip to main content

git-guardrails-claude-code

Install Claude hooks blocking dangerous git commands before execution.

ソース情報

リポジトリ
redpanda-data/ui-harness
ソースの最終更新活動
2026年5月27日 14:03
検出された SKILL.md の言語
英語
スター
34
フォーク
4

インストール方法

デフォルトでは、最初にソースを確認する Prompt が選択されています。直接コマンドに切り替えるか、ローカルコピーをダウンロードすることもできます。

ソースファイルを確認

インストールを決める前に、SKILL.md と SkillsMP に表示されている付属ファイルをお読みください。

ファイルエクスプローラー
2 ファイル

SKILL.md を表示中

SKILL.md
ソースの指示 · 読み取り専用プレビュー
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.
GitHubで見る