<feed xmlns='http://www.w3.org/2005/Atom'>
<title>claude-plugins-official.git/plugins/security-guidance/hooks/sg-python.sh, branch mhegazy/sg-name-broken-python</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>security-guidance: shorter wording, and name every unusable Python</title>
<updated>2026-11-23T20:30:17+00:00</updated>
<author>
<name>Claude</name>
<email>noreply@anthropic.com</email>
</author>
<published>2026-11-23T20:30:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=8b36210d053853c857670bdaf1b1da8bbfd65bec'/>
<id>8b36210d053853c857670bdaf1b1da8bbfd65bec</id>
<content type='text'>
A python3.NN name that answers with another version is now named as well.
The text says "not usable" instead of claiming what the interpreter is,
and points to --version, which is safe in any folder.

Co-authored-by: mhegazy &lt;mhegazy@anthropic.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A python3.NN name that answers with another version is now named as well.
The text says "not usable" instead of claiming what the interpreter is,
and points to --version, which is safe in any folder.

Co-authored-by: mhegazy &lt;mhegazy@anthropic.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>security-guidance: say which Python failed when none works</title>
<updated>2026-11-23T18:47:28+00:00</updated>
<author>
<name>Claude</name>
<email>noreply@anthropic.com</email>
</author>
<published>2026-11-23T18:47:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=c4cdcf736553990e2029418f211179953637fb1b'/>
<id>c4cdcf736553990e2029418f211179953637fb1b</id>
<content type='text'>
When every interpreter the launcher tried failed, its message was the same
as with no Python at all, so a version manager's shim with no version set
read as Python not being installed.

The first line now names python3, python and py -3 with what they did
(an exit code, or no version in their answer), because Claude Code's
terminal shows only the first line of a failed hook. A later line has all
of them. The interpreters' own output is not repeated. Nothing changes in
which interpreter is started, in the exit code or in the number of
processes.

See anthropics/claude-code#86709.

Co-authored-by: mhegazy &lt;mhegazy@anthropic.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When every interpreter the launcher tried failed, its message was the same
as with no Python at all, so a version manager's shim with no version set
read as Python not being installed.

The first line now names python3, python and py -3 with what they did
(an exit code, or no version in their answer), because Claude Code's
terminal shows only the first line of a failed hook. A later line has all
of them. The interpreters' own output is not repeated. Nothing changes in
which interpreter is started, in the exit code or in the number of
processes.

See anthropics/claude-code#86709.

Co-authored-by: mhegazy &lt;mhegazy@anthropic.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge main into mhegazy/sg-one-interpreter-start</title>
<updated>2026-11-20T21:05:18+00:00</updated>
<author>
<name>Claude</name>
<email>noreply@anthropic.com</email>
</author>
<published>2026-11-20T21:05:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=7c963e12ea37a494c138cdcb0231ffe1fa3f5b82'/>
<id>7c963e12ea37a494c138cdcb0231ffe1fa3f5b82</id>
<content type='text'>
Co-authored-by: mhegazy &lt;mhegazy@anthropic.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Co-authored-by: mhegazy &lt;mhegazy@anthropic.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>security-guidance: keep the interpreter check working through a .bat shim</title>
<updated>2026-11-19T19:34:17+00:00</updated>
<author>
<name>Claude</name>
<email>noreply@anthropic.com</email>
</author>
<published>2026-11-19T19:33:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=4fa3475d3a7f58ffe75930c6aa8ae56e80496447'/>
<id>4fa3475d3a7f58ffe75930c6aa8ae56e80496447</id>
<content type='text'>
pyenv-win's python names end in a batch file. In its released version
(3.1.1) cmd.exe read the "&gt;=" in the check as a redirect: every hook left
an empty "(3" file in the project, and the interpreter was rejected. With
no other Python no hook ran.

The check now uses only characters that arrive unchanged. On Windows a
name that loses the argument counts as unable to read the hook script, so
the launcher goes on to its real interpreter.

See #7172.

Co-authored-by: mhegazy &lt;mhegazy@anthropic.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
pyenv-win's python names end in a batch file. In its released version
(3.1.1) cmd.exe read the "&gt;=" in the check as a redirect: every hook left
an empty "(3" file in the project, and the interpreter was rejected. With
no other Python no hook ran.

The check now uses only characters that arrive unchanged. On Windows a
name that loses the argument counts as unable to read the hook script, so
the launcher goes on to its real interpreter.

See #7172.

Co-authored-by: mhegazy &lt;mhegazy@anthropic.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>security-guidance: keep the hook's exit code when launcher-python cannot be opened</title>
<updated>2026-11-18T18:43:08+00:00</updated>
<author>
<name>Claude</name>
<email>noreply@anthropic.com</email>
</author>
<published>2026-11-18T18:43:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=f9f419ea5635419271a0e3259b7f48f2079ad619'/>
<id>f9f419ea5635419271a0e3259b7f48f2079ad619</id>
<content type='text'>
Dropping the entry after a hook that exits non-zero runs under set -e. When the file could not be opened for reading at that moment, the launcher exited 1 in place of the hook's own code, so a review's findings did not reach the session. Also leave the file alone when it is not a regular file.

Co-authored-by: mhegazy &lt;mhegazy@anthropic.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Dropping the entry after a hook that exits non-zero runs under set -e. When the file could not be opened for reading at that moment, the launcher exited 1 in place of the hook's own code, so a review's findings did not reach the session. Also leave the file alone when it is not a regular file.

Co-authored-by: mhegazy &lt;mhegazy@anthropic.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>security-guidance: start Python once per hook on Windows</title>
<updated>2026-11-16T19:22:37+00:00</updated>
<author>
<name>Claude</name>
<email>noreply@anthropic.com</email>
</author>
<published>2026-11-16T19:04:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=4d504c2006d2ca687fe64a3795706327538e5f66'/>
<id>4d504c2006d2ca687fe64a3795706327538e5f66</id>
<content type='text'>
The launcher started the chosen name twice per hook, to check it and to run the hook, and through every link in its path. Remember the checked interpreter for a day, by its path with the links resolved, where it is certain which file it is, and start only that.

Co-authored-by: mhegazy &lt;mhegazy@anthropic.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The launcher started the chosen name twice per hook, to check it and to run the hook, and through every link in its path. Remember the checked interpreter for a day, by its path with the links resolved, where it is certain which file it is, and start only that.

Co-authored-by: mhegazy &lt;mhegazy@anthropic.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>security-guidance: edit hook no longer waits on App Installer's python alias</title>
<updated>2026-11-13T00:02:54+00:00</updated>
<author>
<name>Mohamed Hegazy</name>
<email>mhegazy@anthropic.com</email>
</author>
<published>2026-11-13T00:02:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=c7b7669ca7813f139450726852e1183ba3309606'/>
<id>c7b7669ca7813f139450726852e1183ba3309606</id>
<content type='text'>
On Windows without a packaged Python, python3 under WindowsApps is App
Installer's alias, which is not a Python. The launcher started it on every
hook. Starting it waits for Windows' package services, so while those are
stuck every hook in every session waits with them, and the edit hook had no
time limit of its own: each Edit or Write then took 600 seconds.

- The launcher tells that alias by where its link leads and does not start
  it. Which interpreter runs the hook is unchanged. Aliases of a packaged
  Python are still probed.
- The edit hook gets a 60 second limit.

Refs #6348, #3870, #6315

Co-authored-by: mhegazy &lt;mhegazy@anthropic.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On Windows without a packaged Python, python3 under WindowsApps is App
Installer's alias, which is not a Python. The launcher started it on every
hook. Starting it waits for Windows' package services, so while those are
stuck every hook in every session waits with them, and the edit hook had no
time limit of its own: each Edit or Write then took 600 seconds.

- The launcher tells that alias by where its link leads and does not start
  it. Which interpreter runs the hook is unchanged. Aliases of a packaged
  Python are still probed.
- The edit hook gets a 60 second limit.

Refs #6348, #3870, #6315

Co-authored-by: mhegazy &lt;mhegazy@anthropic.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>security-guidance: set an environment variable for the launcher's interpreter probes</title>
<updated>2026-11-09T18:55:10+00:00</updated>
<author>
<name>Mohamed Hegazy</name>
<email>mhegazy@anthropic.com</email>
</author>
<published>2026-11-09T18:55:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=f3700b581c4f4df3b69cba3e276b23042f1bf200'/>
<id>f3700b581c4f4df3b69cba3e276b23042f1bf200</id>
<content type='text'>
sg-python.sh asks a candidate interpreter for its version and, for a
packaged Windows alias, for its real path, with `python -c`. Both calls
import only os and sys, so they now run with PYTHONSAFEPATH=1, which tells
Python not to add its usual first entry to the import path.

The variable is set for those two calls alone, so the hook starts with the
same environment as before. Python older than 3.11 ignores the variable.

Co-authored-by: mhegazy &lt;mhegazy@anthropic.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
sg-python.sh asks a candidate interpreter for its version and, for a
packaged Windows alias, for its real path, with `python -c`. Both calls
import only os and sys, so they now run with PYTHONSAFEPATH=1, which tells
Python not to add its usual first entry to the import path.

The variable is set for those two calls alone, so the hook starts with the
same environment as before. Python older than 3.11 ignores the variable.

Co-authored-by: mhegazy &lt;mhegazy@anthropic.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>security-guidance: stop starting the packaged Python alias on every hook</title>
<updated>2026-10-27T20:11:58+00:00</updated>
<author>
<name>mhegazy</name>
<email>mhegazy@users.noreply.github.com</email>
</author>
<published>2026-10-27T20:11:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=70ef2c2ed7001343cc954bb6ea8060d9475639bb'/>
<id>70ef2c2ed7001343cc954bb6ea8060d9475639bb</id>
<content type='text'>
On Windows with the Python Install Manager, python, python3 and py are
packaged aliases under ...\Microsoft\WindowsApps, and each start of one
makes Windows run an App Installer update check for the package. The
launcher started the chosen alias twice per hook (probe, then the hook),
on every Edit, prompt and Stop. See anthropics/claude-code#98929.

When the name that answers is such an alias and its interpreter is a
regular python*.exe elsewhere, the launcher now checks that interpreter
once (same version, reads the hook script when started by itself), runs
the hook with it, and keeps its path in the state folder for a day.
Later hooks start it directly: one process, none through the alias.

The remembered path is used only while PATH and the hook folder are
unchanged and the file is still there. A hook that fails on it empties
the entry so the next hook searches again. Not used while VIRTUAL_ENV is
set. Other systems, regular installs and Microsoft Store Python are
unchanged.

Hooks report launcher_direct (1 remembered, 2 just checked) as the last
metric key on rows they already send.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On Windows with the Python Install Manager, python, python3 and py are
packaged aliases under ...\Microsoft\WindowsApps, and each start of one
makes Windows run an App Installer update check for the package. The
launcher started the chosen alias twice per hook (probe, then the hook),
on every Edit, prompt and Stop. See anthropics/claude-code#98929.

When the name that answers is such an alias and its interpreter is a
regular python*.exe elsewhere, the launcher now checks that interpreter
once (same version, reads the hook script when started by itself), runs
the hook with it, and keeps its path in the state folder for a day.
Later hooks start it directly: one process, none through the alias.

The remembered path is used only while PATH and the hook folder are
unchanged and the file is still there. A hook that fails on it empties
the entry so the next hook searches again. Not used while VIRTUAL_ENV is
set. Other systems, regular installs and Microsoft Store Python are
unchanged.

Hooks report launcher_direct (1 remembered, 2 just checked) as the last
metric key on rows they already send.
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'main' into mhegazy/sg-launcher-probe-timing</title>
<updated>2026-10-20T22:36:29+00:00</updated>
<author>
<name>Claude</name>
<email>noreply@anthropic.com</email>
</author>
<published>2026-10-20T22:36:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=6d4e17c8c4d45de2eba6dce119e56fff18ae43b1'/>
<id>6d4e17c8c4d45de2eba6dce119e56fff18ae43b1</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
