<feed xmlns='http://www.w3.org/2005/Atom'>
<title>claude-plugins-official.git/plugins/security-guidance/hooks/diffstate.py, branch check-plugin-version-bumps</title>
<subtitle>Official Claude Code plugin directory
</subtitle>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/'/>
<entry>
<title>Merge pull request #6836 from anthropics/mhegazy/sg-diff-seen-count</title>
<updated>2026-10-26T23:02:51+00:00</updated>
<author>
<name>Mohamed Hegazy</name>
<email>8000722+mhegazy@users.noreply.github.com</email>
</author>
<published>2026-10-26T23:02:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=ced0aa953bf0689e48308de3405bf276421dce63'/>
<id>ced0aa953bf0689e48308de3405bf276421dce63</id>
<content type='text'>
security-guidance: count reviews of a diff that was already reviewed</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
security-guidance: count reviews of a diff that was already reviewed</pre>
</div>
</content>
</entry>
<entry>
<title>security-guidance: report where a slow prompt's time goes</title>
<updated>2026-10-22T17:11:25+00:00</updated>
<author>
<name>Mohamed Hegazy</name>
<email>mhegazy@anthropic.com</email>
</author>
<published>2026-10-22T17:11:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=22aea1e9b9b4e4efa98237d4d52154f973b47fec'/>
<id>22aea1e9b9b4e4efa98237d4d52154f973b47fec</id>
<content type='text'>
Prompts that wait a second or more in the UserPromptSubmit hook send one
metrics row: total, baseline and untracked listing time, index size, and
whether the repository is on a Windows drive under WSL. Measures only;
capture is unchanged. See #6854.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Prompts that wait a second or more in the UserPromptSubmit hook send one
metrics row: total, baseline and untracked listing time, index size, and
whether the repository is on a Windows drive under WSL. Measures only;
capture is unchanged. See #6854.
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'main' into mhegazy/sg-diff-seen-count</title>
<updated>2026-10-22T00:12:11+00:00</updated>
<author>
<name>Mohamed Hegazy</name>
<email>mhegazy@anthropic.com</email>
</author>
<published>2026-10-22T00:12:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=de9e075c828f2c4438d26571dc6046472381a085'/>
<id>de9e075c828f2c4438d26571dc6046472381a085</id>
<content type='text'>
Keeps both sides in emit_metrics: diff_seen stays after the other review
tail keys, and the launcher probe keys stay after everything else.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Keeps both sides in emit_metrics: diff_seen stays after the other review
tail keys, and the launcher probe keys stay after everything else.
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge pull request #6837 from anthropics/mhegazy/sg-index-copy-gitlinks</title>
<updated>2026-10-21T23:58:27+00:00</updated>
<author>
<name>Mohamed Hegazy</name>
<email>8000722+mhegazy@users.noreply.github.com</email>
</author>
<published>2026-10-21T23:58:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=234c3a4a443e3aa79dfe9ac86e931d50fc43e6da'/>
<id>234c3a4a443e3aa79dfe9ac86e931d50fc43e6da</id>
<content type='text'>
security-guidance: keep nested repositories out of the index copy</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
security-guidance: keep nested repositories out of the index copy</pre>
</div>
</content>
</entry>
<entry>
<title>security-guidance: find the earlier version of a file reached through a symlinked folder</title>
<updated>2026-10-20T23:24:19+00:00</updated>
<author>
<name>Mohamed Hegazy</name>
<email>mhegazy@anthropic.com</email>
</author>
<published>2026-10-20T23:24:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=218862e1b0814b66361e9d215c409a10df2304ae'/>
<id>218862e1b0814b66361e9d215c409a10df2304ae</id>
<content type='text'>
When the tool's path and the session directory name the same repo through
different symlinks (/tmp and /var on macOS), the relative path between the two
spellings left the repo and the lookup found nothing, so a rewrite re-reported
code that was already in the file. The lookup now tries again with both paths
resolved. The first attempt is unchanged.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When the tool's path and the session directory name the same repo through
different symlinks (/tmp and /var on macOS), the relative path between the two
spellings left the repo and the lookup found nothing, so a rewrite re-reported
code that was already in the file. The lookup now tries again with both paths
resolved. The first attempt is unchanged.
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'main' into mhegazy/sg-baseline-subdir</title>
<updated>2026-10-20T23:09:46+00:00</updated>
<author>
<name>Mohamed Hegazy</name>
<email>mhegazy@anthropic.com</email>
</author>
<published>2026-10-20T23:09:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=8d582c39ac3868b5d85cd5a06497b3a02e11c5dd'/>
<id>8d582c39ac3868b5d85cd5a06497b3a02e11c5dd</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>security-guidance: keep nested repositories out of the index copy</title>
<updated>2026-10-20T23:00:54+00:00</updated>
<author>
<name>Claude</name>
<email>noreply@anthropic.com</email>
</author>
<published>2026-10-20T23:00:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=a00d13d77ba7bf13a9d2ae0db5f7e24aeb4b12b2'/>
<id>a00d13d77ba7bf13a9d2ae0db5f7e24aeb4b12b2</id>
<content type='text'>
The hooks run `git stash create` (the turn baseline) and
`git add --intent-to-add` (untracked files) on a throwaway copy of the
index. A nested repository that the index records is a gitlink entry
there. `git stash create` takes no --ignore-submodules option and
`git add` reads the gitlinks its paths cover, so both started a second
git inside that directory.

Before anything runs on the copy, remove the gitlink entry of every
nested repository from the copy, never from the real index. If that
removal fails, do not use the copy at all: the baseline falls back to
HEAD and runs no stash create, and the diff reads the real index with
--ignore-submodules=all. A gitlink whose directory has no `.git` (a
submodule that is not checked out) stays; git starts nothing there.

Run the intent-to-add `git add` with literal pathspecs, in that one
call's environment only.

The index file is scanned for a gitlink's mode bytes first, so a
repository without one starts no extra git process.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The hooks run `git stash create` (the turn baseline) and
`git add --intent-to-add` (untracked files) on a throwaway copy of the
index. A nested repository that the index records is a gitlink entry
there. `git stash create` takes no --ignore-submodules option and
`git add` reads the gitlinks its paths cover, so both started a second
git inside that directory.

Before anything runs on the copy, remove the gitlink entry of every
nested repository from the copy, never from the real index. If that
removal fails, do not use the copy at all: the baseline falls back to
HEAD and runs no stash create, and the diff reads the real index with
--ignore-submodules=all. A gitlink whose directory has no `.git` (a
submodule that is not checked out) stays; git starts nothing there.

Run the intent-to-add `git add` with literal pathspecs, in that one
call's environment only.

The index file is scanned for a gitlink's mode bytes first, so a
repository without one starts no extra git process.
</pre>
</div>
</content>
</entry>
<entry>
<title>security-guidance: count reviews of a diff that was already reviewed</title>
<updated>2026-10-20T22:59:48+00:00</updated>
<author>
<name>Mohamed Hegazy</name>
<email>mhegazy@anthropic.com</email>
</author>
<published>2026-10-20T22:59:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=437cb57a9d19329a8e6ef3ed79e19adb45e83d50'/>
<id>437cb57a9d19329a8e6ef3ed79e19adb45e83d50</id>
<content type='text'>
A change that comes back under a new commit (undo and re-commit, rebase
before the first push) is unknown to the reviewed-shas record, so the
commit or push review runs on it again. Nothing says how often.

Each commit and push review now notes a hash of every hunk it is sent in
.git/sg-reviewed-diffs, once when it starts and once when it has a
verdict, and reports one new metric, diff_seen:

  0  some hunk was never reviewed in this clone
  1  all were seen, but a review of one has no verdict (yet)
  2  all had a finished review, on different repo contents
  3  all had a finished review, on the same tree
 -1  the record could not be read or written

Count only: no review is skipped, delayed or changed. The record is
bounded (1 MB, 7 days), is not written in portable output mode, and its
lock is never waited on for more than half a second.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A change that comes back under a new commit (undo and re-commit, rebase
before the first push) is unknown to the reviewed-shas record, so the
commit or push review runs on it again. Nothing says how often.

Each commit and push review now notes a hash of every hunk it is sent in
.git/sg-reviewed-diffs, once when it starts and once when it has a
verdict, and reports one new metric, diff_seen:

  0  some hunk was never reviewed in this clone
  1  all were seen, but a review of one has no verdict (yet)
  2  all had a finished review, on different repo contents
  3  all had a finished review, on the same tree
 -1  the record could not be read or written

Count only: no review is skipped, delayed or changed. The record is
bounded (1 MB, 7 days), is not written in portable output mode, and its
lock is never waited on for more than half a second.
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'main' into mhegazy/sg-stop-scope-telemetry</title>
<updated>2026-10-20T20:35:31+00:00</updated>
<author>
<name>Claude</name>
<email>noreply@anthropic.com</email>
</author>
<published>2026-10-20T20:29:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=3b1114ffc69b73ef80f64d8647e3ad632141801c'/>
<id>3b1114ffc69b73ef80f64d8647e3ad632141801c</id>
<content type='text'>
Resolves the overlap with the baseline-origin change in security_reminder_hook.py: both sets of state keys are stored beside the baseline.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Resolves the overlap with the baseline-origin change in security_reminder_hook.py: both sets of state keys are stored beside the baseline.
</pre>
</div>
</content>
</entry>
<entry>
<title>security-guidance: do not review against a baseline from another checkout</title>
<updated>2026-10-19T16:51:24+00:00</updated>
<author>
<name>Mohamed Hegazy</name>
<email>mhegazy@anthropic.com</email>
</author>
<published>2026-10-19T16:51:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=307800f0aaa7b285390bd1702055881f48098b2d'/>
<id>307800f0aaa7b285390bd1702055881f48098b2d</id>
<content type='text'>
The turn baseline (stash SHA, HEAD, untracked snapshot) is kept per
session, and the Stop review used it in whatever checkout the turn ended
in. After the session entered another worktree, that worktree's older
commits looked like commits made this turn and its files were diffed
against the first checkout's, so code committed long before was reviewed
and reported again (anthropics/claude-code#102567).

The prompt hook now stores the repo root and the prompt time beside the
baseline. When the Stop review runs in a different checkout it leaves the
baseline out and uses what that checkout can say for itself: its own HEAD
when the turn began (from its reflog) for the commit range, HEAD for file
contents, and file times to leave out uncommitted files last written
before the turn. A baseline taken after a finding records the checkout it
was taken in.

A prompt in a folder that is not a repo no longer replaces the untracked
snapshot of the kept baseline with an empty one, which made every
untracked file in the repo look new at the next Stop.

Stop rows carry `bl_origin`: 0 same checkout, 1 another worktree, 2
another repository, 3 a folder that is gone, 4 no baseline; plus 10 or 20
when the baseline is an earlier turn's.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The turn baseline (stash SHA, HEAD, untracked snapshot) is kept per
session, and the Stop review used it in whatever checkout the turn ended
in. After the session entered another worktree, that worktree's older
commits looked like commits made this turn and its files were diffed
against the first checkout's, so code committed long before was reviewed
and reported again (anthropics/claude-code#102567).

The prompt hook now stores the repo root and the prompt time beside the
baseline. When the Stop review runs in a different checkout it leaves the
baseline out and uses what that checkout can say for itself: its own HEAD
when the turn began (from its reflog) for the commit range, HEAD for file
contents, and file times to leave out uncommitted files last written
before the turn. A baseline taken after a finding records the checkout it
was taken in.

A prompt in a folder that is not a repo no longer replaces the untracked
snapshot of the kept baseline with an empty one, which made every
untracked file in the repo look new at the next Stop.

Stop rows carry `bl_origin`: 0 same checkout, 1 another worktree, 2
another repository, 3 a folder that is gone, 4 no baseline; plus 10 or 20
when the baseline is an earlier turn's.
</pre>
</div>
</content>
</entry>
</feed>
