summaryrefslogtreecommitdiff
path: root/plugins/security-guidance/hooks/security_reminder_hook.py
diff options
context:
space:
mode:
authorMohamed Hegazy <mhegazy@anthropic.com>2026-10-19 16:36:23 +0000
committerClaude <noreply@anthropic.com>2026-10-19 16:36:23 +0000
commitdc6c4e2470abdd65ffec47b11fa8273deeed2efe (patch)
treef81c8f65cc18720ddcfb68ee52db459798ae7c5d /plugins/security-guidance/hooks/security_reminder_hook.py
parentea10b213686c90bb1984b2016937310e05336cf3 (diff)
security-guidance: count secret-named data files in the Stop review setmhegazy/sg-secret-named-telemetry
Data files named like secrets.yml or client_secret.json are reviewed like any other file. The Stop hook now reports how many are in its review set, as a count only (secret_named_reviewed, emitted when nonzero), so the share of reviews that include one can be read from telemetry. No change to what is reviewed. Refs anthropics/claude-code#96276
Diffstat (limited to 'plugins/security-guidance/hooks/security_reminder_hook.py')
-rwxr-xr-xplugins/security-guidance/hooks/security_reminder_hook.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/plugins/security-guidance/hooks/security_reminder_hook.py b/plugins/security-guidance/hooks/security_reminder_hook.py
index ea5bab18..9573a35c 100755
--- a/plugins/security-guidance/hooks/security_reminder_hook.py
+++ b/plugins/security-guidance/hooks/security_reminder_hook.py
@@ -2323,6 +2323,9 @@ def handle_stop_hook(input_data):
diff_files = filter_preexisting_from_diff(diff_files, cwd, baseline_sha)
debug_log(f"Stop hook: reviewing {len(diff_files)} changed files (standard diff)")
+ secret_named = gitutil.count_secret_named(diff_files)
+ if secret_named:
+ _TAIL_METRICS["secret_named_reviewed"] = secret_named
import time as _time
stop_review_start = _time.time()