<feed xmlns='http://www.w3.org/2005/Atom'>
<title>claude-plugins-official.git/plugins/security-guidance/tests/test_portable_output.py, branch bump/cloud-sql-sqlserver</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: print one JSON document from the SessionStart hook on other hosts</title>
<updated>2026-10-15T16:31:46+00:00</updated>
<author>
<name>Mohamed Hegazy</name>
<email>mhegazy@anthropic.com</email>
</author>
<published>2026-10-15T16:31:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=ced6733eee6aa246e2af55ce0c71e38c01a50141'/>
<id>ced6733eee6aa246e2af55ce0c71e38c01a50141</id>
<content type='text'>
On a host other than Claude Code the SessionStart hook printed an async
declaration line and then a metrics line. A host that reads hook output as
one JSON document with a closed schema rejects that.

In portable mode the hook now skips the async line and prints one object
with only the standard fields. The portable-mode helpers move to _base.py so
both hook scripts share them, and the mode is decided once at start-up.
Output under Claude Code is unchanged.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On a host other than Claude Code the SessionStart hook printed an async
declaration line and then a metrics line. A host that reads hook output as
one JSON document with a closed schema rejects that.

In portable mode the hook now skips the async line and prints one object
with only the standard fields. The portable-mode helpers move to _base.py so
both hook scripts share them, and the mode is decided once at start-up.
Output under Claude Code is unchanged.
</pre>
</div>
</content>
</entry>
<entry>
<title>security-guidance: leave Claude Code only fields out of hook output on other hosts</title>
<updated>2026-10-14T12:12:19+00:00</updated>
<author>
<name>Mohamed Hegazy</name>
<email>mhegazy@anthropic.com</email>
</author>
<published>2026-10-12T18:49:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=26eea79bd04d30a6b38f3a4c89f4596c44a91128'/>
<id>26eea79bd04d30a6b38f3a4c89f4596c44a91128</id>
<content type='text'>
The hooks print metrics and rewakeSummary in their JSON output. A host that validates hook output against a closed schema rejects the whole line, so every Stop and PostToolUse shows a hook error there.

When the host passes PLUGIN_ROOT and does not identify itself as Claude Code, print only the standard fields. Blocking findings and guidance are kept. SECURITY_GUIDANCE_PORTABLE_OUTPUT=1/0 forces it either way. Output under Claude Code is unchanged.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The hooks print metrics and rewakeSummary in their JSON output. A host that validates hook output against a closed schema rejects the whole line, so every Stop and PostToolUse shows a hook error there.

When the host passes PLUGIN_ROOT and does not identify itself as Claude Code, print only the standard fields. Blocking findings and guidance are kept. SECURITY_GUIDANCE_PORTABLE_OUTPUT=1/0 forces it either way. Output under Claude Code is unchanged.
</pre>
</div>
</content>
</entry>
</feed>
