{"version":"2.1.327","anchor":"sdk-validates-hooks-and-initconfig-before-sending-initialize","canonical_anchor":"sdk-validates-hooks-and-initconfig-before-sending-initialize","heading":"SDK checks hooks and startup options before starting a session","tier":"notice","area":"SDK","scope":"individual","heads_up":true,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.327\/e\/sdk-validates-hooks-and-initconfig-before-sending-initialize","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.327","markdown":"### SDK checks hooks and startup options before starting a session\n\nThe SDK now checks hooks and each initConfig value before starting, and refuses to start with an error naming the bad option\n\n**What**\n\nBefore the Agent SDK (the library for running Claude Code from your own program) starts a session, it now checks two kinds of options:\n\n- `hooks`: each entry must be a list of matchers, and each matcher must have its own list of hooks. Hooks are your own commands that run at set points in a session.\n\n- each `initConfig` value.\n\nIf one is malformed, the session is not started and the error names the option that could not be sent, for example that a hooks entry must be an array of matchers.\n\n**Why**\n\nA mistake in your hook setup now shows up straight away with a clear message pointing at the problem, instead of surfacing later in a harder-to-read way.\n\n- Area: SDK\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 2\/5\n- Scope: individual\n- Heads-up: yes"}