diff options
| author | Octavian Guzu <oct@anthropic.com> | 2026-10-09 11:33:29 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-10-09 11:33:29 +0100 |
| commit | 8206942d3ec08519557bd750858d689d082bea7c (patch) | |
| tree | 8c14b9343a31baac772c76a44dfde961bf1a5d47 /plugins | |
| parent | 315c4e48967d9541c29c3c656441dded353ca7aa (diff) | |
| parent | 3752f0e092cb0fec08e68f80aa4d54849423a8b0 (diff) | |
Merge pull request #6393 from anthropics/mhegazy/sg-drop-subagent-review
security-guidance: stop reviewing on every subagent finish
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/security-guidance/hooks/hooks.json | 13 | ||||
| -rw-r--r-- | plugins/security-guidance/tests/test_repo_resolution.py | 8 |
2 files changed, 5 insertions, 16 deletions
diff --git a/plugins/security-guidance/hooks/hooks.json b/plugins/security-guidance/hooks/hooks.json index 22734270..a4723026 100644 --- a/plugins/security-guidance/hooks/hooks.json +++ b/plugins/security-guidance/hooks/hooks.json @@ -106,19 +106,6 @@ } ] } - ], - "SubagentStop": [ - { - "hooks": [ - { - "type": "command", - "command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/sg-python.sh\" \"${CLAUDE_PLUGIN_ROOT}/hooks/security_reminder_hook.py\"", - "asyncRewake": true, - "rewakeMessage": "Background security review feedback — address or acknowledge the findings below, then continue with the user's original request or continue waiting for their reply. This is supplementary, not a replacement for your previous response:", - "rewakeSummary": "Background security review found issues" - } - ] - } ] } } diff --git a/plugins/security-guidance/tests/test_repo_resolution.py b/plugins/security-guidance/tests/test_repo_resolution.py index f6b8d352..8bcf24b9 100644 --- a/plugins/security-guidance/tests/test_repo_resolution.py +++ b/plugins/security-guidance/tests/test_repo_resolution.py @@ -222,9 +222,11 @@ class TestRegexes: class TestHooksJson: def test_matchers_and_events(self): cfg = json.loads((HOOKS_DIR / "hooks.json").read_text()) - assert "SubagentStop" in cfg["hooks"] - assert cfg["hooks"]["SubagentStop"][0]["hooks"][0]["command"] == \ - cfg["hooks"]["Stop"][0]["hooks"][0]["command"] + # Stop already reviews what subagents changed during the turn. + assert "SubagentStop" not in cfg["hooks"] + stop = cfg["hooks"]["Stop"][0]["hooks"][0] + assert stop["command"].endswith('security_reminder_hook.py"') + assert stop["asyncRewake"] is True bash = [g for g in cfg["hooks"]["PostToolUse"] if g.get("matcher") == "Bash"][0] ifs = {h.get("if") for h in bash["hooks"]} assert {"Bash(git commit:*)", "Bash(git push:*)", "Bash(git -C * commit *)", |
