From 77ac332a413638ba1a44c359f223b5d33cad25c0 Mon Sep 17 00:00:00 2001 From: gastown/crew/max Date: Tue, 20 Jan 2026 20:26:43 -0800 Subject: [PATCH] fix(hooks): add PreToolUse pr-workflow guard to settings templates The gt tap guard pr-workflow command was added in 37f465bde but the PreToolUse hooks were never added to the embedded settings templates. This caused polecats to be created without the PR-blocking hooks, allowing PR #833 to slip through despite the overlays having the hooks. Adds the pr-workflow guard hooks to both settings-autonomous.json and settings-interactive.json templates to block: - gh pr create - git checkout -b (feature branches) - git switch -c (feature branches) Co-Authored-By: Claude Opus 4.5 --- .../claude/config/settings-autonomous.json | 29 +++++++++++++++++++ .../claude/config/settings-interactive.json | 29 +++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/internal/claude/config/settings-autonomous.json b/internal/claude/config/settings-autonomous.json index 54c119e9..a15ff772 100644 --- a/internal/claude/config/settings-autonomous.json +++ b/internal/claude/config/settings-autonomous.json @@ -3,6 +3,35 @@ "beads@beads-marketplace": false }, "hooks": { + "PreToolUse": [ + { + "matcher": "Bash(gh pr create*)", + "hooks": [ + { + "type": "command", + "command": "export PATH=\"$HOME/go/bin:$HOME/.local/bin:$PATH\" && gt tap guard pr-workflow" + } + ] + }, + { + "matcher": "Bash(git checkout -b*)", + "hooks": [ + { + "type": "command", + "command": "export PATH=\"$HOME/go/bin:$HOME/.local/bin:$PATH\" && gt tap guard pr-workflow" + } + ] + }, + { + "matcher": "Bash(git switch -c*)", + "hooks": [ + { + "type": "command", + "command": "export PATH=\"$HOME/go/bin:$HOME/.local/bin:$PATH\" && gt tap guard pr-workflow" + } + ] + } + ], "SessionStart": [ { "matcher": "", diff --git a/internal/claude/config/settings-interactive.json b/internal/claude/config/settings-interactive.json index 9fbef9e2..e138893c 100644 --- a/internal/claude/config/settings-interactive.json +++ b/internal/claude/config/settings-interactive.json @@ -3,6 +3,35 @@ "beads@beads-marketplace": false }, "hooks": { + "PreToolUse": [ + { + "matcher": "Bash(gh pr create*)", + "hooks": [ + { + "type": "command", + "command": "export PATH=\"$HOME/go/bin:$HOME/.local/bin:$PATH\" && gt tap guard pr-workflow" + } + ] + }, + { + "matcher": "Bash(git checkout -b*)", + "hooks": [ + { + "type": "command", + "command": "export PATH=\"$HOME/go/bin:$HOME/.local/bin:$PATH\" && gt tap guard pr-workflow" + } + ] + }, + { + "matcher": "Bash(git switch -c*)", + "hooks": [ + { + "type": "command", + "command": "export PATH=\"$HOME/go/bin:$HOME/.local/bin:$PATH\" && gt tap guard pr-workflow" + } + ] + } + ], "SessionStart": [ { "matcher": "",