Strategic Compact Skill
When This Activates
You should consider compaction when:
- Context usage exceeds 50% (check /cost)
- Switching between unrelated tasks
- After completing a major milestone
- Before starting a complex new investigation
Decision Tree
At 50% context:
- If current task is nearly done → finish first, then compact
- If starting new task → compact NOW with summary of completed work
- If in middle of debugging → save current hypotheses, then compact
At 70% context:
- MANDATORY compact. No exceptions.
- Before compacting, dump current state to a TODO or scratchpad file
At 85%+ context:
- /clear and restart. Compaction at this point loses too much.
- Use session handoff file for continuity
Compact Instructions Template
When running /compact, use this format:
/compact Preserve: [list key files modified], [current task and progress], [decisions made], [test commands used], [any error messages being investigated]. Discard: [exploration tangents], [rejected approaches], [file contents already committed].
Recovery After Compact
After compaction, immediately:
- Re-read the 2-3 most important files for current task
- Check git status to see what was changed
- Run tests to confirm current state
- Resume from where compaction happened