{"version":"2.1.238","anchor":"hooks-can-be-replaced-by-sending-initialize-again","canonical_anchor":"hooks-can-be-replaced-by-sending-initialize-again","heading":"Hooks can be replaced by sending initialize again","tier":"use","area":"Hooks","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.238\/e\/hooks-can-be-replaced-by-sending-initialize-again","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.238","markdown":"### Hooks can be replaced by sending `initialize` again\n\nA stream-json host can send initialize again to swap out its hooks mid-session.\n\n**What**\n\nIn 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.\n\n**Details**\n\n- The documented schema for stdin was changed to drop hooks from the list of one-time session setup.\n- A new internal call retires outstanding SDK host hook callbacks: any `hook_callback` request still in flight is cancelled and answered with a supplied fallback rather than left hanging.\n\n**Evidence**\n\n`hooks sent by the process that owns this stream replace the earlier set (see hooks_applied on the response)`\n\n- Area: Hooks\n- Names: `initialize`, `hooks_applied`\n- Tier: Use it now\n- Useful: 3\/5\n- Signal: 3\/5"}