What
In stream-json input mode, hooks are no longer fixed at first connect. The process that owns the stdin stream can send a second initialize whose hooks replace the earlier set, and the reply's hooks_applied says whether that took effect.
Details
- The documented schema for stdin was changed to drop hooks from the list of one-time session setup.
- A new internal call retires outstanding SDK host hook callbacks: any
hook_callbackrequest still in flight is cancelled and answered with a supplied fallback rather than left hanging.
Evidence
hooks sent by the process that owns this stream replace the earlier set (see hooks_applied on the response)
Strings lifted out of the shipped bundle, so the claim above can be checked against them.
Names in the bundleinitializehooks_applied
The entry above is what we published on the day. These lines were added later, as Anthropic's own pages caught up, and they sit beside the original rather than replacing it.
Added since
A small documentation edit on Agent SDK reference - TypeScript touched a line naming initialize after this was published.
* `true`: Claude Code registered the hooks. A session's first initialize returns this value. A repeated initialize sent over the CLI's stdin also returns `true`. In that case the hooks in the new request replace the hooks registered earlie…agent-sdk/typescript see the edit
Confirmed since
Anthropic's documentation has since written up initialize, on Credentials.
The MCP method that failed (for example `initialize` or `tools/list`).api/beta/vaults/credentials see the edit
One source agreesOne thing we can check says the same as this entry.
Anthropic's documentation agrees
Anthropic's documentation has since written up initialize, on Credentials.