{"name":"PreCompact","slug":"precompact","family":"hook","title":"Hook events","noun":"hook event","description":"Before context compaction","description_source":"docs","described_by":{"doc":"claude-code\/hooks","title":"Hooks reference"},"presence":{"first_seen":null,"removed_in":null,"in_current_build":false,"newest_mined":"2.1.309","builds":0,"mined_builds":150,"first_cited":{"version":"2.1.21","released_at":"2026-01-28 01:37:44","spans":2}},"aliases":[],"entries":[{"version":"2.1.290","anchor":"compaction-precompact-hook-trigger-reports-auto-vs-manual","heading":"PreCompact hooks are now told when compaction was automatic","line":"The PreCompact hook now receives a trigger of auto for automatic compaction instead of always manual","released_at":"2026-10-05 18:12:44","reason":"found in this entry's text, named in this entry"},{"version":"2.1.229","anchor":"hooks-are-handed-a-session-object-instead-of-reading-globals","heading":"Hooks are handed a session object instead of reading globals","line":"Hooks now get an explicit session with id, working directory and project root instead of guessing from globals.","released_at":"2026-08-12 19:28:48","reason":"found in this entry's text"},{"version":"2.1.228","anchor":"subagents-doing-delegated-observation-no-longer-trigger-comp","heading":"Subagents doing delegated observation no longer trigger compact hooks","line":"Observation subagents no longer fire your PostCompact hooks when they compact.","released_at":"2026-08-11 17:45:45","reason":"named in this entry, found in this entry's text"},{"version":"2.1.124","anchor":"update-config-skill-prompt-rewritten","heading":"update-config skill prompt rewritten","line":null,"released_at":"2026-04-30 01:39:41","reason":"found in this entry's text"},{"version":"2.1.105","anchor":"reactive-compaction-gradual-rollout","heading":"Reactive Compaction [Gradual Rollout]","line":null,"released_at":"2026-04-13 19:51:19","reason":"found in this entry's text"},{"version":"2.1.105","anchor":"precompact-hook-support","heading":"PreCompact Hook Support","line":null,"released_at":"2026-04-13 19:51:19","reason":"found in this entry's text"},{"version":"2.1.21","anchor":"enhanced-hook-system-for-sdk-integration","heading":"Enhanced Hook System for SDK Integration","line":null,"released_at":"2026-01-28 01:37:44","reason":"found in this entry's text"},{"version":"1.0.48","anchor":"new-features","heading":"New Features","line":null,"released_at":"2025-07-10 01:03:27","reason":"found in this entry's text"}],"entries_total":8,"docs":[{"source":"claude-code","path":"hooks","title":"Hooks reference","documented":true},{"source":"claude-code","path":"agent-sdk\/hooks","title":"Intercept and control agent behavior with hooks","documented":true},{"source":"claude-code","path":"agent-sdk\/agent-loop","title":"How the agent loop works","documented":false},{"source":"claude-code","path":"agent-sdk\/python","title":"Agent SDK reference - Python","documented":false},{"source":"claude-code","path":"agent-sdk\/typescript","title":"Agent SDK reference - TypeScript","documented":false},{"source":"claude-code","path":"cli-reference","title":"CLI reference","documented":false},{"source":"claude-code","path":"context-window","title":"Explore the context window","documented":false},{"source":"claude-code","path":"hooks-guide","title":"Automate actions with hooks","documented":false},{"source":"claude-code","path":"whats-new\/2026-w16","title":"Week 16 \u00b7 April 13\u201317, 2026","documented":false}],"docs_total":9,"gates":[],"related":[],"url":"https:\/\/changelogs.core-directive.com\/reference\/hook\/precompact","family_url":"https:\/\/changelogs.core-directive.com\/reference\/hook.json"}