Compact Guard
A safety net that preserves your task state and key files across Claude Code context compaction cycles.
UtilitiesBeginner★ 2,803⑂ 278AI score 9/10Last updated: Aug 31, 2026
What it does
- Before you run
/compact(or when an auto-compact warning appears), it walks a checklist capturing current task, files in progress, decisions made, blockers, and next steps. - Prioritizes which files to preserve based on Claude Code's restore limits: max 5 files, 5K tokens per file, 50K total budget.
- Provides a post-compact recovery routine: re-read the active file, check the task list, resume from saved next steps.
- Includes a prevention table — delegate broad searches to subagents, read files with
offset/limit, compact at task boundaries, or/resumefor unrelated work.
Who it's for
- Claude Code users who have lost context to a surprise auto-compact in long sessions.
- Developers exploring large codebases where token burn is fast.
- Anyone doing multi-file refactors or migrations that must survive compaction.
Examples
- Mid-refactor low-context warning → run the skill, get a state summary, then compact safely.
- Auto-compact fires unexpectedly → follow the recovery steps to re-read your working file and continue.
- Before a repo-wide grep → apply the subagent delegation strategy to keep the main context clean.
· · · Install guide · · ·
Try it now, no install
Paste this into Claude to use the skill without installing anything.
Read the instructions in this file and follow them to help me: https://raw.githubusercontent.com/rohitg00/pro-workflow/HEAD/skills/compact-guard/SKILL.md What I want: (describe your task here)
If Claude can't open the link, open it yourself and paste the contents instead.
↓ If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the skills/compact-guard folder from the GitHub repo rohitg00/pro-workflow into my ~/.claude/skills/compact-guard/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/rohitg00/pro-workflow.git /tmp/pro-workflow && mkdir -p ~/.claude/skills && cp -r /tmp/pro-workflow/skills/compact-guard ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Open your terminal.
- Clone the repo:
git clone https://github.com/rohitg00/pro-workflow.git - Create the skills directory if needed:
mkdir -p ~/.claude/skills - Copy the skill:
cp -r pro-workflow/skills/compact-guard ~/.claude/skills/ - Verify that
~/.claude/skills/compact-guard/SKILL.mdexists. - Restart Claude Code and say something like "save my state before compacting" to trigger it.