What problem does it solve? Long AI coding sessions lose important context when auto-compaction fires at arbitrary points mid-task, discarding variable names, file paths, and partial reasoning needed to finish the work. ## Core Features & Use Cases - Context-size monitoring: Reads token usage from the session transcript and suggests /compact at window-scaled thresholds (160k on a 200k window, 250k on a 1M window), re-reminding every 60k tokens of growth. - Tool-call counting: Tracks tool invocations per session and suggests compaction at a configurable threshold (default 50 calls, then every 25). - Phase-aware guidance: Provides a decision table for compacting at logical boundaries such as research-to-planning or after a failed approach, plus a reference of what survives compaction. - Use Case: During a multi-phase feature build, the PreToolUse hook detects context crossing 160k tokens after the research phase and reminds you to run /compact before implementation, preserving the plan while clearing bulky exploration context. ## Quick Start Install the suggest-compact.js hook for Edit and Write tool calls in your settings.json and let it remind you when to run /compact at logical task boundaries.