claude-compaction-restore
できること
このスキルは、AIのコーディングエージェントが、メモリが圧縮された際に長いタスクの理解を保てるよう支援します。長いセッションを動かすエージェント、たとえばチームのプランナーやレビューアー向けです。
使う場面
- ✓Claude Codeのセッションが圧縮される直前、または圧縮されたばかりのとき。
- ✓/compactの後に、エージェントが再開して作業の全体像を取り戻す必要があるとき。
- ✓長く動いている席が、ファイルと判断のつながりを保つ必要があるとき。
スキルのリンク
https://github.com/mvschwarz/openrig/blob/main/packages/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“私のClaudeのセッションが圧縮され、計画を見失いました。復元用のメモとトランスクリプトから、計画を組み直すのを手伝ってください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
圧縮の前に、このスキルは重要な点とそのつながりを示す短いマップを保存します。圧縮の後は、そのマップとトランスクリプトを読み、行動する前に全体像を取り戻します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
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'sLEARNED.md, evidence folders, branches and PRs.
Only in your head; write it down:
- why each important thing matters, and to whom;
- how things relate: depends on, supersedes, answers, contradicts, was produced by, is owned by;
- decisions and the reasons for them, options you rejected, judgment and taste you applied;
- where you were in time: what earlier windows established, what this window did, what comes next and who authorizes it;
- where to look deeper: which JSONL range or file answers which question.
The map is the second list, pinned to the first.
Two restore classes
Every restored seat must come back competent. It should understand the OpenRig world and its command surface, the project, its own role, and where it stands in time. Some seats also need the global picture.
Both classes read the same thing: the ranked reading list in your own map, in order. They differ only in how far down the list they go.
| Class | Who | Reads |
|---|---|---|
| Default | drivers, builders, reviewers, QA, and any seat not listed below | Tier 1: the top of the list, to about 100k of real context |
| High-context | orchestrators, planners, advisors, leads: any seat that makes product, scope or routing decisions | Tier 1 and Tier 2, to about 200k of real context |
The tiers are real context added by the restore, on top of what the compaction summary leaves (about 60k).
These budgets assume a context window of about 1M tokens; on a smaller window, scale them to about 10% and
20% of it. File size is a poor guide to that cost: in OpenRig's own runs, real context grew 1.7 to 2 times the bytes ÷ 4 estimate,
because of line numbers on reads, tool output and your own reasoning. So rank to about 50k of bytes ÷ 4 for
Tier 1 and about 100k for Tier 2, and check real usage at each checkpoint with
rig compact-plan --json (your seat's estimatedUsedTokens).
Tier 2 buys width, not depth: more sources, more connections, more of the mission's history and the wider
worlds, not the same files read more fully. Choose your class from your role (rig whoami --json). A per-seat
instruction file or your own map can name the class explicitly, and that overrides the role default. In both
classes, transcripts and the session JSONL appear only as targeted line ranges, never as whole files.
If there is no ranked list (no preparation turn happened), use this default order. Default seats stop at about 100k of real context:
- the post-compaction world profile;
- the mission or slice
SPEC.mdandNOTES.md; - rows you hold.
High-context seats then add, to about 200k:
- the full System World install;
- the full Project World, public and private;
- the mission's
PROGRESS.mdand recent returns; - previous maps and
RESTOREDnotes; LEARNED.md.
If You Are About To Compact
You are about to lose every connection you have built. Spend this turn making them durable.
- Think back before writing. Walk the session and, throu
よくある質問
圧縮で何が失われますか?
ファイル名や判断などの事実は残りますが、なぜそのファイルが重要かといった事実同士のつながりが失われます。
復元用のマップはどこに保存されますか?
ディスクに書き込まれ、スキルは既存のセッションのトランスクリプトを複製せず、そこを指します。
誰にとって特に有用ですか?
プランナー、オーケストレーター、レビューアーなど、作業の広い全体像を保持する長時間動くエージェントです。
詳細
作者による元の説明
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.
repo: mvschwarz/openrig
人気
- GitHubのスター
- 8.6k
- ランキング
- #12385
- ライセンス
- Apache-2.0
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
agent-operated-software
8.6kエージェントが、AIエージェントを稼働中のバックエンドに含む継続的なアプリを設計、構築、デバッグできるよう支援します。MarkdownやJSONのエージェント制御層を含みます。
agent-operated-workflows
8.6kエージェントが、限定された定型の手順をAIエージェントが動かすべきか通常のコードが動かすべきかを判断し、検証済みの証拠から再開する方法を決められるよう支援します。
applying-a-permission-policy
8.6kエージェントが、チームの設定時に使うコマンドの許可を設定し、通常のコマンドが承認の確認を何度も求めないよう支援します。
delegating-work
8.6kエージェントが、タスクを自分で行うか、サブエージェントに任せるか、すでに文脈を持つチームメイトに任せるかを決め、その作業者への指示の仕方を決められるよう支援します。
似ているスキル
add-model-provider
394k安全なセットアップコマンドで新しいAIモデルプロバイダーをOpenClawに接続し、APIキーを平文で残さず、ライブテストを行うようエージェントを支援します。
acp-router
394kClaude CodeやCursorなどのコーディングアシスタントに、OpenClaw経由でタスクを渡し、その作業がそのツール内で行われるようエージェントを支援します。
browser-automation
394kログイン、タブ、応答しなくなったページからの復旧を含め、Webページを段階的に操作するようエージェントに教えます。