{"version":"2.1.267","anchor":"hooks-engine-gains-sessioncompact-sessionreceive-uireso","canonical_anchor":"hooks-engine-gains-sessioncompact-sessionreceive-uireso","heading":"Hooks engine gains session.compact, session.receive, ui.resolve event contracts","tier":"use","area":"Hooks","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.267\/e\/hooks-engine-gains-sessioncompact-sessionreceive-uireso","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.267","markdown":"### Hooks engine gains session.compact, session.receive, ui.resolve event contracts\n\nThe plugin hooks system adds validated event types for session compaction, session receive, and UI resolution\n\n**Unclear.** What a session.receive or ui.resolve hook actually lets a plugin do isn't detailed beyond the validation rules.\n\n**What**\n\nClaude Code's plugin hooks engine now validates three new kinds of hook events:\n\n- `session.compact`, for hooking into conversation compaction (summarizing older context to free up space)\n\n- `session.receive`\n\n- `ui.resolve`\n\nA hook for `session.compact` must now return either `{ messages }` (a replacement set of messages) or `{ skip: reason }` to opt out, and the shape of `messages` is checked. Separately, a `provider` field on the arguments passed to `tool.describe`, `command.describe` and `agent.offer` hooks is now fixed and can no longer be overridden by a hook.\n\n**Why**\n\nThese changes give plugins defined, checked contracts for reacting to compaction and other events, and stop a hook from spoofing which provider a tool or command claims to come from.\n\n- Area: Hooks\n- Names: `session.compact`, `session.receive`, `ui.resolve`\n- Tier: Use it now\n- Useful: 4\/5\n- Signal: 4\/5"}