Skip to content

Session Compaction and Restore

Keeps AI agent seats working through context compaction, restarts, and restores without losing intent.

Stars
8,553
Licence
Apache-2.0
Files
1 file

What it does

This skill teaches an AI coding agent how to keep long-running work intact when its conversation memory gets trimmed (compaction), crashes, or is restarted. It explains how to tell apart three ways of picking work back up: resuming the same session, forking it into a new one, or rebuilding understanding from saved notes (a restore packet). It also covers the CLI commands OpenRig provides to check readiness and trigger compaction or restores.

Great for

  • Developers running long-lived AI agent seats inside the OpenRig multi-agent system
  • Operators who need to restart or refresh agents without losing active workflow state
  • Teams designing durable handoff or restore packets for ongoing work

Skip it if

  • Fresh sessions with no working state to preserve, since there is nothing to restore
  • Users unfamiliar with OpenRig, since most guidance depends on its CLI commands and seat model
  • Creating a new agent from a primed source, which is covered by sibling skills such as session-source-fork instead

Try asking

  • “My Claude seat is near its context limit. Walk me through compacting it and restoring its working state.”
  • “Check which of my running rigs are ready for a safe restore.”
  • “Design a restore packet so a rebuilt agent keeps the product intent of this workflow, not just the details.”
  • “Explain whether I should resume, fork, or rebuild this agent seat after a restart.”
Step-by-step guide: how to use Session Compaction and RestoreInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 1 original files, the Apache-2.0 licence and an attribution note.

    session-compaction-and-restore.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip session-compaction-and-restore.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip session-compaction-and-restore.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Treat the restore packet as the source of truth and use the CLI only as the trigger, as the skill recommends.
  • Run rig compact-plan first, since it is read-only and only reports what would happen.
  • Do not confuse rig restore (a whole rig snapshot for infrastructure) with session-context restore; they are different mechanisms.

What's inside

  • SKILL.md

Redistributed unmodified from mvschwarz/openrig under the Apache-2.0 licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.