Suggests manual context compaction at logical intervals to preserve context through task phases rather than arbitrary auto-compaction.
Suggests manual /compact at strategic points in your workflow rather than relying on arbitrary auto-compaction.
Auto-compaction triggers at arbitrary points:
Strategic compaction at logical boundaries:
The suggest-compact.sh script runs on PreToolUse (Edit/Write) and:
| Phase Transition | Compact? | Why |
|---|---|---|
| Research → Planning | Yes | Research context is bulky; plan is the distilled output |
| Planning → Implementation | Yes | Plan is in TodoWrite or a file; free up context for code |
| Implementation → Testing | Maybe | Keep if tests reference recent code; compact if switching focus |
| Debugging → Next feature | Yes | Debug traces pollute context for unrelated work |
| Mid-implementation | No | Losing variable names, file paths, and partial state is costly |
| After a failed approach | Yes | Clear the dead-end reasoning before trying a new approach |
| Persists | Lost |
|---|---|
| CLAUDE.md instructions | Intermediate reasoning and analysis |
| TodoWrite task list | File contents you previously read |
| Memory files | Multi-step conversation context |
| Git state (commits, branches) | Tool call history and counts |
| Files on disk | Nuanced user preferences stated verbally |
/compact with a summary — /compact Focus on implementing X next