diff options
| author | Mohamed Hegazy <mhegazy@anthropic.com> | 2026-10-15 16:31:04 +0000 |
|---|---|---|
| committer | Claude <noreply@anthropic.com> | 2026-10-15 16:31:04 +0000 |
| commit | 8876c9951efd618ef5a889dd1a6479bdb73b70bd (patch) | |
| tree | 0807071f9262de3351fd3aa58ddb89ae6a5eec76 /plugins/security-guidance/hooks/diffstate.py | |
| parent | 8f814f49002ff824e8a9ba43cf96112dc7f5948d (diff) | |
security-guidance: skip the untracked-file listing when the Stop review is off
UserPromptSubmit listed every untracked file in the worktree and stored the
result in the session state on each prompt, for a snapshot that only the Stop
review reads. With ENABLE_STOP_REVIEW=0 or ENABLE_CODE_SECURITY_REVIEW=0 the
Stop hook skips before reading it, so the listing is now skipped too. The
stash baseline is still captured for the Write pattern filter.
When the review is switched back on, the next prompt takes a fresh snapshot,
including after an interrupted turn whose baseline is kept.
Refs #6612
Diffstat (limited to 'plugins/security-guidance/hooks/diffstate.py')
| -rw-r--r-- | plugins/security-guidance/hooks/diffstate.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/security-guidance/hooks/diffstate.py b/plugins/security-guidance/hooks/diffstate.py index be839212..f50382e6 100644 --- a/plugins/security-guidance/hooks/diffstate.py +++ b/plugins/security-guidance/hooks/diffstate.py @@ -198,7 +198,8 @@ def capture_git_baseline(cwd): NOTE: `git stash create` does NOT capture untracked files. UPS pairs this SHA with a `_list_untracked()` snapshot stored as `untracked_at_baseline`, and `compute_v2_review_set` subtracts that set so pre-existing untracked - files are not reviewed as Claude-authored. + files are not reviewed as Claude-authored. UPS takes no snapshot while the + Stop review, its only reader, is switched off. """ # stdout is a SHA so text=True is safe on stdout, but a non-ASCII # filename in `git stash create`'s STDERR warning (e.g. a worktree |
