compact-recovery
Skill0 starsChanged 5 months agoMITView on GitHub
State-recovery skill for after a context compact. Use when the user
In this repository3 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- adversarial-reviewSkill
- new-projectSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 13 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈13
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 22
Do not auto-trigger. This skill is user-invoked only.
- Distinctive: line 37
Do not guess at current state from your compact summary.
- Very specific: line 41
Use mcp__filesystem__ tools only.
- Distinctive: line 44
Read the workspace CLAUDE.md at the root of the user's selected Cowork folder.
- Distinctive: line 51
If the workspace CLAUDE.md does not exist or cannot be found, say so and ask the user where their workspace folder is before continuing.
- Distinctive: line 62
Read the full SESSION file.
- Very specific: line 72
Read projects/[project-name]/CLAUDE.md.
- Distinctive: line 75
If it doesn't exist, note it but continue — the SESSION file is the primary source.
- Distinctive: line 97
After presenting the brief, stop completely.
- Distinctive: line 101
Ask "shall I proceed?" and then proceed anyway
- Distinctive: line 103
Wait for the user to explicitly confirm — "yes, that's right" or "here's what's actually happening." Treat any correction as ground truth.
- Distinctive: line 120
When helping a user set up the kit, or when they ask how to recover after a compact, tell them to add this to the Standing Instructions …
- Distinctive: line 125
If I say "I think we just compacted," "catch me up," or "confirm current state," use the compact-recovery skill.
- Distinctive: line 154
Multiple active projects: Ask which project was active when the compact happened before reading SESSION files.
- Distinctive: line 161
User says the brief is wrong: Do not argue. Accept the correction, restate your updated understanding, and confirm once more before …
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Trigger
Activate this skill when the user says any of the following (or close variations):
- "I think we just compacted"
- "catch me up"
- "can you catch up on where we are?"
- "confirm current state"
- "what were we working on?"
- "I think something got compressed"
- "did we just compact?"
Do not auto-trigger. This skill is user-invoked only. If the user is simply asking for a status update mid-conversation without concern about compaction, respond conversationally rather than invoking the full recovery protocol.
Behavior
Step 1 — Acknowledge and set expectations
Say something like:
"On it. Let me read your context files and build a picture of where we are. I'll show you what I find before we do anything else."
Do not guess at current state from your compact summary. Go read the files.
Step 2 — Read the workspace CLAUDE.md
Use mcp__filesystem__ tools only. Do not use the built-in Read tool — it
uses sandbox paths and cannot access the user's filesystem.
Read the workspace CLAUDE.md at the root of the user's selected Cowork
folder. Extract:
- NEXT ACTION field — the single most reliable indicator of current task
- Current Projects section — identifies active project(s) and context file paths
- Standing Instructions — behavioral rules in effect for this workspace
If the workspace CLAUDE.md does not exist or cannot be found, say so and
ask the user where their workspace folder is before continuing.
Step 3 — Find and read the active project's SESSION file
From the Current Projects section, identify the active project folder
(e.g., projects/crm-vendor-evaluation/).
Find the most recent SESSION_*.md file in that folder. If multiple SESSION
files exist, use the one with the most recent date in the filename.
Read the full SESSION file. Pay particular attention to:
- NEXT ACTION field at the top
- When Resuming This Session section — written specifically for situations like this
- The most recent continuation section — the most current record of what was completed and what comes next
Step 4 — Read the project CLAUDE.md (if it exists)
Read projects/[project-name]/CLAUDE.md. Extract current goal, status, and
any task-level context.
If it doesn't exist, note it but continue — the SESSION file is the primary source.
Step 5 — Synthesize and present the current-state brief
Present your findings in this format:
"Here's what I understand about where we are:
Project: [project name] What's been completed: [2–4 bullet points from the SESSION file] What's in progress / was interrupted: [if anything was mid-flight] NEXT ACTION (from your context files): [exact NEXT ACTION text, verbatim]
Does this match your understanding? If anything's off — something missing, something wrong — tell me before we continue."
Quote the NEXT ACTION verbatim. Don't paraphrase in a way that could introduce errors.
Step 6 — Hard stop for confirmation
After presenting the brief, stop completely. Do not:
- Begin the next task
- Suggest what to do next
- Ask "shall I proceed?" and then proceed anyway
Wait for the user to explicitly confirm — "yes, that's right" or "here's what's actually happening." Treat any correction as ground truth. Restate your updated understanding and confirm once more before beginning any work.
This confirmation gate is non-negotiable. The entire value of this skill depends on it. A compact summary is an approximation. The user is the only reliable source of truth about whether that approximation is accurate.
Setup & Discovery
This section tells Claude what to say when a user asks how to use or discover this skill.
What to add to the workspace CLAUDE.md
When helping a user set up the kit, or when they ask how to recover after a
compact, tell them to add this to the Standing Instructions section of
their workspace CLAUDE.md:
### 13. Compact Recovery
If I say "I think we just compacted," "catch me up," or "confirm current
state," use the compact-recovery skill. Read my workspace CLAUDE.md and
the most recent SESSION file for the active project. Show me a
current-state brief and wait for my confirmation before doing anything.Note: not strictly required — trigger phrases are sufficient. But adding it makes the behavior explicit and ensures it survives across sessions.
What the README references
The README's "Going Deeper" section should include:
"If Claude seems to have lost context mid-session, say 'catch me up' and it will read your files and confirm what it knows before continuing."
What SAVE_WORKFLOW references
The "What To Do After a Compact" section should say:
"Say: 'I think we just compacted. Please invoke the compact recovery skill before we go any further.' Claude will read your context files and confirm current state before doing anything."
Edge cases
No SESSION file found: Tell the user. Ask if there's a session file
elsewhere, or if the project is new. Fall back to the workspace CLAUDE.md
alone and note the limitation.
Multiple active projects: Ask which project was active when the compact happened before reading SESSION files.
NEXT ACTION appears stale: Surface it verbatim anyway, and note: "This NEXT ACTION may be stale. The SESSION file suggests we were actually working on [X]. Does that sound right?"
User says the brief is wrong: Do not argue. Accept the correction, restate your updated understanding, and confirm once more before proceeding.
No workspace CLAUDE.md: Say so and offer to help them set it up, or ask where their context files are.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

