The hook now asks and listens. It writes the receiver's vocabulary — a version,
what was observed, the session, the context and its kind — alongside everything
it already recorded, reads the answer, and when that answer carries an identity
puts it in front of the context through additionalContext. That is the only
channel that reaches the model itself.
Saying it once is the receiver's job, not this program's: there is one of these
processes per event, so a hook that tried to remember what it had already said
would be a hook keeping state across processes. The receiver answers with a name
the first time a context needs one and stays quiet afterwards. A context that
acts without ever having been announced is named on that first call, so
SubagentStart is a shortcut rather than a dependency. Eleven of the seventeen
wired events map to noted — they happened, and they change nothing about what
a context is owed. A receiver that could not do what was asked says why, and
that goes to the error log rather than being swallowed.
The second commit removes the ticket. Nothing redeemed it — no client reads
DIDBOT_TICKET, and the receiver only counted it — so what shipped was a
mechanism that ran on every qualifying call and was never checked, which is
worse than one that does not exist. Removing the command rewrite also removes
the permissionDecision: "allow" that carried it, so a command naming this
project is no longer auto-approved past the user's prompt, and the hook no
longer sends a command line at all. It can come back with the client that
redeems it.
SubagentStart {"hookSpecificOutput": {"hookEventName": "SubagentStart",
"additionalContext": "Your agent identity on this machine
is did:web:kk-a1.agents.localhost%3A3117."}}
PreToolUse, already named (no output)
PreToolUse, never announced {"hookSpecificOutput": {"hookEventName": "PreToolUse",
"additionalContext": "… did:web:kk-a2.agents.localhost…"}}
SessionStart {"hookSpecificOutput": {"hookEventName": "SessionStart",
"additionalContext": "… did:web:sess-k.agents.localhost…"}}
Notification (no output)
🤖 Generated with Claude Code