write-hook
Installation
SKILL.md
Claude Code hooks
Behaviours observed in Claude Code web sessions, 2026-08-22 and 2026-08-23 - not inferred from docs.
Injecting context: the mechanism differs per event
| Event | How its output reaches the model |
|---|---|
SessionStart, UserPromptSubmit |
stdout on exit 0 is added to context as-is |
Stop |
stdout is NOT. Emit JSON with hookSpecificOutput.additionalContext |
Plain text on stdout from a Stop hook is the most common way to ship a hook that silently does
nothing: the script runs, the text goes to the debug log, the model never sees it.