summaryrefslogtreecommitdiff
path: root/plugins/security-guidance/README.md
diff options
context:
space:
mode:
authorMohamed Hegazy <mhegazy@anthropic.com>2026-10-15 16:31:46 +0000
committerClaude <noreply@anthropic.com>2026-10-15 16:31:46 +0000
commitced6733eee6aa246e2af55ce0c71e38c01a50141 (patch)
tree1c7abeca25d5625d06934d3ea1141cf554edcd92 /plugins/security-guidance/README.md
parentd876712c3801b10bb1258da9b8f71fa7b41320e4 (diff)
security-guidance: print one JSON document from the SessionStart hook on other hostsmhegazy/sg-portable-session-start
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.
Diffstat (limited to 'plugins/security-guidance/README.md')
-rw-r--r--plugins/security-guidance/README.md2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/security-guidance/README.md b/plugins/security-guidance/README.md
index 61bd2449..610b3446 100644
--- a/plugins/security-guidance/README.md
+++ b/plugins/security-guidance/README.md
@@ -64,7 +64,7 @@ SECURITY_REVIEW_MODEL=claude-opus-5-5
SECURITY_GUIDANCE_PORTABLE_OUTPUT=1 # default: detected
```
-The hooks' JSON output carries two fields that only Claude Code reads (`metrics` and `rewakeSummary`). A host that validates hook output against a closed schema rejects them. In portable mode they are left out and only the standard fields remain (`decision`, `reason`, `systemMessage`, `hookSpecificOutput`). It turns on by itself when the host passes `PLUGIN_ROOT` and does not identify itself as Claude Code; set the variable to `1` or `0` to force it either way.
+The hooks' JSON output carries two fields that only Claude Code reads (`metrics` and `rewakeSummary`), and the SessionStart hook prints a separate `{"async": ...}` line first. A host that validates hook output against a closed schema rejects them. In portable mode they are left out, so every hook prints one JSON object with only the standard fields (`decision`, `reason`, `systemMessage`, `hookSpecificOutput`), and the SessionStart hook runs to completion before the host continues. It turns on by itself when the host passes `PLUGIN_ROOT` and does not identify itself as Claude Code; set the variable to `1` or `0` to force it either way.
### Higher-recall mode