{"name":"session.compact","slug":"session-compact","family":"setting","title":"Settings keys","noun":"settings key","description":"A new `session.compact` plugin hook can intercept and rewrite conversation compaction","description_source":"entry","described_by":{"version":"2.1.267","anchor":"compaction-can-now-be-intercepted-and-rewritten-by-a-session"},"presence":{"first_seen":null,"removed_in":null,"in_current_build":false,"newest_mined":"2.1.319","builds":0,"mined_builds":159,"first_cited":{"version":"2.1.267","released_at":"2026-09-09 18:25:42","spans":4}},"aliases":[],"entries":[{"version":"2.1.299","anchor":"plugin-hook-modules-managed-policy-restrictions-and-new-ses","heading":"Plugin hook modules get more events and organization policy limits","line":"Plugin hook modules can respond to more events, while plugins people install themselves face limits where an organization manages Claude Code","released_at":"2026-10-14 00:23:19","reason":"found in this entry's text"},{"version":"2.1.275","anchor":"new-pluginsession-lifecycle-hook-events-sessionend-and-ses","heading":"New plugin\/session lifecycle hook events session.end and session.measure","line":"Two new lifecycle events, `session.end` and `session.measure`, added for plugins and hooks","released_at":"2026-09-17 20:20:31","reason":"found in this entry's text"},{"version":"2.1.267","anchor":"compaction-can-now-be-intercepted-and-rewritten-by-a-session","heading":"Compaction can now be intercepted and rewritten by a session.compact plugin hook","line":"A new `session.compact` plugin hook can intercept and rewrite conversation compaction","released_at":"2026-09-09 18:25:42","reason":"found in this entry's text, named in this entry"},{"version":"2.1.267","anchor":"hooks-engine-gains-sessioncompact-sessionreceive-uireso","heading":"Hooks engine gains session.compact, session.receive, ui.resolve event contracts","line":"The plugin hooks system adds validated event types for session compaction, session receive, and UI resolution","released_at":"2026-09-09 18:25:42","reason":"found in this entry's text, named in this entry"},{"version":"2.1.267","anchor":"precomputed-compaction-gains-a-veto-mechanism-to-avoid-repea","heading":"Precomputed compaction gains a veto mechanism to avoid repeat attempts","line":"Precomputed compaction now remembers when a plugin hook rejected it, to avoid retrying the same attempt","released_at":"2026-09-09 18:25:42","reason":"found in this entry's text"},{"version":"2.1.267","anchor":"sessioncompact-implementation-gated-by-disable-compact","heading":"session.compact implementation gated by DISABLE_COMPACT","line":"session.compact now blocks itself while DISABLE_COMPACT is set or a turn is still running","released_at":"2026-09-09 18:25:42","reason":"found in this entry's text"},{"version":"2.1.267","anchor":"compaction-path-records-whether-it-was-replaced-by-hook-vs","heading":"Compaction path records whether it was 'replaced by hook' vs core-run","line":"Compaction now records when a hook fully replaced Claude Code's own summarization logic","released_at":"2026-09-09 18:25:42","reason":"found in this entry's text"}],"entries_total":7,"docs":[{"source":"claude-code","path":"plugins\/mods\/admin","title":"Manage mods for your organization","documented":false},{"source":"claude-code","path":"plugins\/mods\/reference","title":"Mods reference","documented":false}],"docs_total":2,"gates":[],"related":[{"name":"session","slug":"session","description":"A per-session workshop document gets snapshotted with your session files and is only writable in plan mode."},{"name":"session.attach","slug":"session-attach","description":"Plugin hooks can now react to tool-call dry-runs, config changes, and session attach\/detach events."},{"name":"session.authorize","slug":"session-authorize","description":"Plugins gain $.session.authorize(), which mints an auth handle for the session."},{"name":"session.detach","slug":"session-detach","description":"Plugin hooks can now react to tool-call dry-runs, config changes, and session attach\/detach events."},{"name":"session.end","slug":"session-end","description":"Two new lifecycle events, `session.end` and `session.measure`, added for plugins and hooks"},{"name":"session.measure","slug":"session-measure","description":"Two new lifecycle events, `session.end` and `session.measure`, added for plugins and hooks"},{"name":"session.receive","slug":"session-receive","description":"A new `session.compact` plugin hook can intercept and rewrite conversation compaction"},{"name":"session.root","slug":"session-root","description":"Plugin API policy list adds session.root, prompt.read, and ui.panes as permitted actions"},{"name":"session.send","slug":"session-send","description":"Plugin hooks can now listen for a new session.send event, alongside session.receive\/detach\/end"},{"name":"session.start","slug":"session-start","description":"Two hook events arrive: session.start fires on terminal session start, and prompt.context is registered but has no emitter here."}],"url":"https:\/\/changelogs.core-directive.com\/reference\/setting\/session-compact","family_url":"https:\/\/changelogs.core-directive.com\/reference\/setting.json"}