Claude Skill MartBrowse skillsQuick linesLearn by videoTerminal guideWhat is a Skill?
← Back to list

Compact Guard

A safety net that preserves your task state and key files across Claude Code context compaction cycles.

UtilitiesBeginner★ 2,911⑂ 294AI score 9/10Last updated: Sep 29, 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 /resume for 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

  1. Mid-refactor low-context warning → run the skill, get a state summary, then compact safely.
  2. Auto-compact fires unexpectedly → follow the recovery steps to re-read your working file and continue.
  3. 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)
  1. Download the ZIP with the button below.
  2. In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
  3. Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
↓ Download 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.

  1. Open your terminal.
  2. Clone the repo: git clone https://github.com/rohitg00/pro-workflow.git
  3. Create the skills directory if needed: mkdir -p ~/.claude/skills
  4. Copy the skill: cp -r pro-workflow/skills/compact-guard ~/.claude/skills/
  5. Verify that ~/.claude/skills/compact-guard/SKILL.md exists.
  6. Restart Claude Code and say something like "save my state before compacting" to trigger it.