# Claude Compaction Restore

Use when a Claude Code session is about to compact, has just compacted, reached its...

- Repository: https://github.com/mvschwarz/openrig (8541 stars)
- Category: AI and agents
- License: Apache-2.0
- Last updated: 2026-11-01
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add mvschwarz/openrig --skill claude-compaction-restore -g -a claude-code -y`
Codex: `npx skills add mvschwarz/openrig --skill claude-compaction-restore -g -a codex -y`
Cursor: `npx skills add mvschwarz/openrig --skill claude-compaction-restore -g -a cursor -y`
Gemini CLI: `npx skills add mvschwarz/openrig --skill claude-compaction-restore -g -a gemini-cli -y`

## Description

Use when a Claude Code session is about to compact, has just compacted, reached its context limit, resumed after /compact, or must rebuild its working picture of a long-running seat from its own restore map, its JSONL transcript and the files it touched.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Claude Compaction Restore

Compaction keeps facts and loses connections. After a compaction you still know file names, row ids and
decisions as items. What you lose is the web between them: why a file matters, what depends on what, which
decision produced which artifact, what you were about to do next, and how this window relates to the ones
before it. Seats whose value is a wide, long-running picture (planners, orchestrators, reviewers holding a
standard) lose the most.

This skill keeps that picture alive across compactions. Before compacting, you write a **restore map**: a
short summary plus the connections between things that already exist on disk. After compacting, you
re-enter the world, read your own map, and rebuild the picture before acting. Over several compactions the
maps chain into one continuous record: a global context window that outlives any single session.

The previous version of this skill is kept at `reference/SKILL-v1.md` for comparison.

## What survives, and what you write

**Already on disk; point to it, don't copy it:**
- your session JSONL at `~/.claude/projects/<cwd-slug>/<session-uuid>.jsonl` (the post-compaction restore
  request names the exact path). It holds every message and tool call you made, in order. It does not hold
  your reasoning;
- the restore packet the PreCompact hook writes (transcript extract, touched-file triage);
- queue rows and their transitions, mission files (`SPEC.md`, `NOTES.md`, `PROGRESS.md`), your seat's
  `LEARNED.md`, evidence folders, branches and PRs.

The rest: https://github.com/mvschwarz/openrig/blob/HEAD/packages/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/SKILL.md
