<feed xmlns='http://www.w3.org/2005/Atom'>
<title>claude-plugins-official.git/plugins/security-guidance/hooks/diffstate.py, branch bump/snowflake-cortex-code</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 #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>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>
<entry>
<title>security-guidance: report how Stop reviews relate to the session's own edits</title>
<updated>2026-10-19T16:29:33+00:00</updated>
<author>
<name>Mohamed Hegazy</name>
<email>mhegazy@anthropic.com</email>
</author>
<published>2026-10-15T22:10:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=6d551545b1c5e4df76649cfd365f79b20de36020'/>
<id>6d551545b1c5e4df76649cfd365f79b20de36020</id>
<content type='text'>
The Stop review takes its file list from git state, so it can cover files
the session's edit tools never wrote. Add one count-only metric,
review_scope, to Stop rows: whether the edit-tool paths lie inside the
reviewed repo, how many reviewed files no edit tool wrote, and whether the
turn-start snapshot was a real one. No change to what is reviewed.

Refs #4524
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The Stop review takes its file list from git state, so it can cover files
the session's edit tools never wrote. Add one count-only metric,
review_scope, to Stop rows: whether the edit-tool paths lie inside the
reviewed repo, how many reviewed files no edit tool wrote, and whether the
turn-start snapshot was a real one. No change to what is reviewed.

Refs #4524
</pre>
</div>
</content>
</entry>
<entry>
<title>security-guidance: find a rewritten file's earlier version from a repo subdirectory</title>
<updated>2026-10-19T16:29:25+00:00</updated>
<author>
<name>Mohamed Hegazy</name>
<email>mhegazy@anthropic.com</email>
</author>
<published>2026-10-14T16:31:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=f5ce0a810148d3d86cd7ac99b007289fd8e3fb15'/>
<id>f5ce0a810148d3d86cd7ac99b007289fd8e3fb15</id>
<content type='text'>
A full-file Write is checked against the file as it was at the start of the turn, so risky calls that were already there are not reported as new. The lookup passed git a path relative to the session directory, which git reads from the repo root, so it failed for any session started below the root, and on Windows for any path with a separator. Ask for ./&lt;path&gt; with forward slashes.

Fixes #5684
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A full-file Write is checked against the file as it was at the start of the turn, so risky calls that were already there are not reported as new. The lookup passed git a path relative to the session directory, which git reads from the repo root, so it failed for any session started below the root, and on Windows for any path with a separator. Ask for ./&lt;path&gt; with forward slashes.

Fixes #5684
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge pull request #6588 from anthropics/mhegazy/sg-inflight-reviews</title>
<updated>2026-10-15T22:41:24+00:00</updated>
<author>
<name>Mohamed Hegazy</name>
<email>8000722+mhegazy@users.noreply.github.com</email>
</author>
<published>2026-10-15T22:41:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=18de88a51e19589dbf2524b27eb72919721c3e15'/>
<id>18de88a51e19589dbf2524b27eb72919721c3e15</id>
<content type='text'>
security-guidance: do not review a commit twice while its first review is running</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
security-guidance: do not review a commit twice while its first review is running</pre>
</div>
</content>
</entry>
<entry>
<title>security-guidance: do not review a commit twice while its first review is running</title>
<updated>2026-10-15T22:40:32+00:00</updated>
<author>
<name>Mohamed Hegazy</name>
<email>mhegazy@anthropic.com</email>
</author>
<published>2026-10-13T20:52:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=7e05205b41cbd5d3c8884f7effc8688c10e2cf00'/>
<id>7e05205b41cbd5d3c8884f7effc8688c10e2cf00</id>
<content type='text'>
A commit review records its commits only once it has a verdict. A push
(or the next commit's reflog scan) that started before then reviewed the
same diff again. A running review now holds a lock file per commit in the
git dir; a push review waits for it and skips what it recorded, and the
reflog scan leaves those commits to it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A commit review records its commits only once it has a verdict. A push
(or the next commit's reflog scan) that started before then reviewed the
same diff again. A running review now holds a lock file per commit in the
git dir; a push review waits for it and skips what it recorded, and the
reflog scan leaves those commits to it.
</pre>
</div>
</content>
</entry>
</feed>
