From pro-workflow
Saves critical files, task progress, and working state before context compaction, then restores them after. Use before /compact or when auto-compact triggers.
How this skill is triggered — by the user, by Claude, or both
Slash command
/pro-workflow:compact-guardThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Protect important context through compaction cycles. Based on Claude Code internals: compaction restores max 5 files with 5K tokens each, within a 50K total budget.
Protect important context through compaction cycles. Based on Claude Code internals: compaction restores max 5 files with 5K tokens each, within a 50K total budget.
Use before /compact or when auto-compact warning appears.
POST_COMPACT_MAX_FILES_TO_RESTORE = 5 — only 5 files survivePOST_COMPACT_TOKEN_BUDGET = 50K — total restore budgetPOST_COMPACT_MAX_TOKENS_PER_FILE = 5K — per-file limitcontext_window - 13K bufferBefore compacting, save these to memory or a scratch file:
Before full compaction, try microcompact:
After compaction, immediately:
| Strategy | Token Savings | When |
|---|---|---|
| Delegate grep/search to subagent | 30-60% per search | Always for broad searches |
Read only needed lines (offset/limit) | 50-90% per read | Large files |
| Compact at task boundaries | Preserves coherence | Between logical steps |
Use /resume for fresh start | 100% | Unrelated new task |
After running compact-guard:
COMPACT GUARD
Files to preserve: [list top 5]
Task state: [one sentence]
Decisions: [key choices]
Next step: [immediate action after compact]
Ready to compact. Run /compact now.
npx claudepluginhub rohitg00/pro-workflow --plugin pro-workflowPreserves critical context data before Claude Code's automatic compaction using snapshots, integrity verification, and zero-loss extraction protocols for complex projects.
Suggests manual /compact at logical intervals (e.g., after research, before implementation) to preserve context through task phases. Activates when context pressure builds or after milestones, using a hook script to track tool calls.
Suggests manual context compaction at logical task boundaries (after exploration, milestones, or before context shifts) to preserve task-relevant state instead of relying on arbitrary auto-compaction.