compact-guard
Smart context compaction with state preservation. Saves critical files, task progress, and working state before compaction, restores after. Use before manual compact or when auto-compact triggers.
Install
With your agent
Install OMGSkills skill "rohitg00/pro-workflow:skills/compact-guard" into this agent's normal skills directory: call the OMGSkills MCP get_install_plan tool for your agent and run the script it returns (it installs only the pinned commit and verifies SKILL.md), and stop if MCP or the pin is unavailable. Do not overwrite or change existing skills without asking me.
Manual command
git clone https://github.com/rohitg00/pro-workflow /tmp/pro-workflow && ln -s /tmp/pro-workflow/skills/compact-guard ~/.claude/skills/compact-guard
From README
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) POSTCOMPACTMAXFILESTORESTORE = 5 — only 5 files survive POSTCOMPACTTOKENBUDGET = 50K — total restore budget POSTCOMPACTMAXTOKENSPERFILE = 5K — per-file limit Auto-compact fires at contextwindow - 13K buffer 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?
More from this repo
context-engineering
Master the four operations of context engineering — Write, Select, Compress, Isolate.
auto-setup
Auto-configure quality gates, hooks, and settings for a new project.
batch-orchestration
Decompose large-scale changes into independent units and spawn parallel agents in isolated worktrees.
