What problem does it solve? Long AI coding sessions lose important context when auto-compaction triggers at arbitrary mid-task points, discarding variable names, file paths, and partial reasoning at the worst possible moment. ## Core Features & Use Cases - Threshold-Based Suggestions: A PreToolUse hook counts Edit/Write tool calls and suggests running /compact after a configurable threshold (default 50 calls), with reminders every 25 calls afterward. - Phase-Aware Compaction Guidance: Provides a decision table for when to compact (research to planning, after debugging, after milestones) and when not to (mid-implementation). - Context Survival Reference: Documents what persists through compaction (CLAUDE.md, TodoWrite tasks, memory files, git state) versus what is lost (conversation context, tool history). - Use Case: During a long multi-phase feature build, the hook reminds you to compact after finalizing your plan, so implementation starts with a fresh context window while the plan survives in TodoWrite. ## Quick Start Add the suggest-compact hook to your Claude settings.json PreToolUse matchers for Edit and Write, then follow its suggestions to run /compact at logical phase transitions.