# Strategic Compact

> Intelligent context compaction advisor. Use when context exceeds 50% or when switching between major tasks. Guides when and how to compact for maximum context preservation.

- Skill: `rhythmmittal19/strategic-compact` (Agent Skill)
- Install (CLI): `npx skillmds@latest add rhythmmittal19/strategic-compact`
- Raw SKILL.md: https://api.skillmd.com/api/skills/rhythmmittal19/strategic-compact/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: RhythmMittal19 (https://skillmd.com/u/rhythmmittal19)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/rhythmmittal19/strategic-compact

---


# 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:
1. Re-read the 2-3 most important files for current task
2. Check git status to see what was changed
3. Run tests to confirm current state
4. Resume from where compaction happened

