- name
Use when reasoning about what survives compaction/context-loss/restart/seat-refresh, designing a high-fidelity restore packet, or distinguishing native runtime resume vs fork vs artifact-backed mental
SKILL.md
The skill file stays in the publisher's repository.
Paste the copied command in a terminal. It installs this SKILL.md into that agent.
npx skills add mvschwarz/openrig --skill session-compaction-and-restore -a cursor -yPaste the copied command in a terminal. It installs this SKILL.md into that agent.
npx skills add mvschwarz/openrig --skill session-compaction-and-restore -a claude-code -yPaste the copied command in a terminal. It installs this SKILL.md into that agent.
npx skills add mvschwarz/openrig --skill session-compaction-and-restore -a codex -yPaste the copied command in a terminal. It installs this SKILL.md into that agent.
npx skills add mvschwarz/openrig --skill session-compaction-and-restore -a grok -ySend the copied message in a Grok Bot chat. The Bot fetches this SKILL.md from GitHub and adds it to the skills all your Bots share.
Install this skill: https://github.com/mvschwarz/openrig/tree/HEAD/packages/daemon/assets/plugins/openrig-core/skills/session-compaction-and-restoreFrom the publisher
Preserving useful working state across compaction, context loss, restart, or seat refresh. Includes Claude compaction restore, Codex resume/fork mechanics, transcript-based mental-model rebuilds, and durable handoff packets.
Long-lived seats are valuable only if they can survive context pressure. If compaction turns a senior seat into a cold-started agent, users will avoid persistent topologies and fall back to throwaway agents.
session-source-fork or agent-startersPer the cross-runtime restore/reentry packet standard:
These are load-bearing distinctions. Do NOT collapse fork into
artifact-backed reentry; do NOT collapse rebuild into fork.
The outcomes above ride on three DISTINCT mechanisms; keep them separate:
/compact — a Claude Code HARNESS feature, not OpenRig
code. OpenRig only emits the literal /compact toward the pane after a prep
turn; there is no compaction algorithm in the OpenRig repo. Provider-owned.hookSpecificOutput.additionalContext),
seat-isolated. The OpenRig-owned half.codex resume <token>),
a separate path from the Claude mechanisms. Never conflate with Claude restore.Safety boundary (ties to native-session-file-lab-boundary): no supported
OpenRig path EDITS provider-owned native session / auth / transcript files to
inject context. Context enters ONLY through sanctioned channels: the hook
additionalContext, a normal user message via rig send, or Codex resume tokens.
Precise nuance: OpenRig does write ~/.codex/config.toml — but only to install
OpenRig activity hooks and [features], never session or auth state. So the
rule is "never edits native session/auth/transcript files," NOT "never touches any
provider-owned file."
While policies.claude_compaction.enabled is true with a valid threshold (the enforcer treats any other
threshold as off), every Claude session OpenRig launches (fresh, fork, resume and restore; ordinary, kernel,
team-default and full-bypass seats) carries idleCompaction: false in its one --settings value. Claude Code then
doesn't compact an idle session on its own, so managed seats compact through OpenRig's sequence (restore map, then
/compact at the threshold).
idleCompaction: true in user or project settings for those
launches. Claude's managed settings still win.autoCompactEnabled, DISABLE_AUTO_COMPACT). Where the enforcer
has no fresh status-line usage sample for a seat, it doesn't compact that seat, and native auto-compaction is then
the only compaction. Nothing guarantees a native fallback.Managed compaction/restore is driven by five shipped verbs — pick per intent, and stay durable-substrate-first (the packet/artifacts are the truth; the CLI is the trigger):
rig compact <session> — guided managed compaction for ONE Claude seat
(prep → /compact → restore → audit). Non-Claude seats rejected. ~180s.rig compact-plan — READ-ONLY triage; does not compact. Flags --rig,
--refresh, --threshold-tokens, --threshold-percent. (Codex seats flagged
codex_not_managed_by_claude_compact_in_place.)rig restore-check — restore-readiness probe across running rigs; read-only;
exit 0/1/2. Flags --full, --ready, --rig, --no-queue, --no-hooks.rig restore-packet {write,read,validate} — the cross-runtime restore
packet (v0): write / read / validate the durable packet this skill's contract defines.rig restore <snapshotId> --rig <rigId> — ⚠ RIG SNAPSHOT restore (infra), a
DIFFERENT mechanism — NOT session-context restore. Do not conflate.Re-entering project context, on any runtime. A restore packet carries the work in flight, not the project's
declared intent and context files. rig context work-install lists what the project declares; read the pieces the
restored task needs. --deliver prints them all, and when several projects are declared (--json lists the
ids), select one with --project <id> instead of guessing.
Proof should include a deliberate compaction/restart of a seat with active work, followed by measured recovery: identity, current workflow, next owner, relevant files, and constraints all restored without human re-briefing.
The cross-runtime restore/reentry packet standard v0 defines:
Plus a 6-item restored-seat acceptance checklist.
Source-trust ranking applies when restored seat ingests packet evidence:
rig whoami > target rigspec > bounded latest transcript > full
transcript > touched-files > restore-summary.json.
A restore may consume transcripts, durable messages, startup context, checkpoints and a restore packet. Inventory the surfaces actually present for this seat, with their source, freshness and purpose. Do not infer that a named surface exists or grants write authority.
The active project/rig policy and task authorization determine what may be
written. Treat provider-owned conversation records as evidence to read through
supported tooling. For placement and durable context, load
skills/openrig-operating-model/SKILL.md with rig context get; for the
selected startup path, use skills/core/agent-startup-and-context-ingestion/SKILL.md.
A packet or marker proves retained/delivered evidence, not successful provider
restoration; measure the resumed seat against the proof standard above.
Before a planned compaction, restart or long pause, write the seat's authored recap
with rig context recap-write --file <draft>. Its format is
in seat-continuity-and-handover, "Write the seat's recap before a handover". A
rebuild reads it before LEARNED.md, and a profile source of seat:RECAP.md serves
it after a restore.
claude-compaction-restore skill — the Claude Code restore SOP (PreCompact hook + JSONL restore script for post-compaction recovery)session-source-fork skill — fork mode for native-runtime-continuity-based restorationseat-continuity-and-handover skill — occupant-creation primitives (resume/fork/rebuild/fresh) that this primitive instantiatesopenrig-operating-model skill — placement and authority of durable context© 2026 Skills Rack.
---name: session-compaction-and-restoredescription: Use when reasoning about what survives compaction/context-loss/restart/seat-refresh, designing a high-fidelity…---# packages/daemon/assets/plugins/openrig-core/skills/session-compaction-and-restore/SKILL.mdOverview
Use when reasoning about what survives compaction/context-loss/restart/seat-refresh, designing a high-fidelity restore packet, or distinguishing native runtime resume vs fork vs artifact-backed mental-model rebuild. Covers the 4 failure modes that prevent honest restore (compacted seat drops hot potato; restore packet preserves details but loses product intent; runtime resume mistaken for handover or fork; rebuilt seat starts with stale instructions).
FAQ
Download packages/daemon/assets/plugins/openrig-core/skills/session-compaction-and-restore/SKILL.md from the publisher, or copy the path and open the repository. PlugMCP lists the skill and does not host the file.
The publisher keeps it at https://github.com/mvschwarz/openrig.
Claude, Cursor, Codex, and Grok Build can read a SKILL.md you add from the publisher's repository. Grok Bot installs it when you send the skill's GitHub folder link in a chat.