
Compact Guard
Claude's compaction system only restores 5 files at 5K tokens each after wiping context, which means you lose everything else without warning. This skill gives you a pre-flight checklist: save your current task, list the files you're editing, note any decisions made, and identify blockers before you hit /compact. It also suggests microcompact strategies like using subagents for heavy searches or reading files with line limits to delay the inevitable. The output is a simple state snapshot you can reference after compaction to get back on track. Honestly just a structured reminder to write things down before your context gets nuked, but that's exactly what you need when the auto-compact warning appears mid-session.
- skills.sh installs
- 189
- GitHub stars
- 2.9K
- last updated
- Jun 8, 2026
Install
$ npx -y skills add rohitg00/pro-workflow --skill compact-guard --agent claude-codeInstalls into .claude/skills of the current project.
Files
Compact Guard
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.
Trigger
Use before /compact or when auto-compact warning appears.
Key Constants (from Claude Code source)
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 limit- Auto-compact fires at
context_window - 13Kbuffer
Pre-Compact Checklist
Before compacting, save these to memory or a scratch file:
- Current task — What are you working on? One sentence.
- Files in progress — Which files are being edited? (max 5 — compaction only restores 5)
- Decisions made — Any architectural choices made this session
- Blockers — What's preventing progress?
- Next steps — What to do immediately after compact
Strategy: Microcompact First
Sponsors
Details
- Repository
- github.com/rohitg00/pro-workflow
- Category
- Automation & Workflows
- First seen
- Jun 11, 2026
More from rohitg00/pro-workflow
All 35- Insights186
- Replay Learnings184
- Parallel Worktrees180
- Llm Council175
- Cost Tracker172
- Context Engineering171
- Mcp Audit169
- Orchestrate167
- Thoroughness Scoring166
- Auto Setup165
- File Watcher165
- Safe Mode164
- Plan Interrogate163
- Batch Orchestration162
- Bug Capture162
- Agent Teams161
- Permission Tuner161
- Sprint Status159
- Llm Gate158
- Wiki Query157
- Wiki Builder156
- Survey Generator154
- Wiki Research Loop154
- Wiki Viewer153