Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add mvschwarz/openrig --skill session-compaction-and-restoregit clone --depth 1 https://github.com/mvschwarz/openrigWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/mvschwarz/openrig/session-compaction-and-restore)<a href="https://agentmods.dev/skills/mvschwarz/openrig/session-compaction-and-restore"><img src="https://agentmods.dev/badge/skills/mvschwarz/openrig/session-compaction-and-restore.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00088 | $0.01866 |
| Opus 5 | $0.00044 | $0.00933 |
| Sonnet 5 | $0.00018 | $0.00373 |
| Haiku 4.5 | $0.00009 | $0.00187 |
Grade B, and why
session-compaction-and-restore scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Reads agent configuration directoriesmediumAgent snooping
.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.
Precise nuance: OpenRig *does* write `~/.codex/config.toml` — but only to install How it starts
The opening of the file, as written. The whole thing — 164 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Session Compaction and Restore
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.
Use this when
- A seat is approaching compaction or just compacted
- Designing a high-fidelity restore packet for an active workflow
- Distinguishing native runtime resume vs fork vs artifact-backed mental-model rebuild
- Reasoning about what should be preserved vs reconstructable
- Auditing a restore for product-intent preservation (not just detail preservation)
Don't use this when
- The session is fresh and has no working state to preserve
- The intent is to create a new seat from a primed source — that's
session-source-forkoragent-starters - The packet is a one-off snapshot for human review — restore packets are for re-entering active work
The 5 distinctions (do not collapse)
Per the cross-runtime restore/reentry packet standard:
| Mode | What it means | Outcome literal |
|---|---|---|
| Native resume | Continue the same managed seat with native runtime token | resumed |
| Fork | New managed seat from prior native runtime conversation; new post-fork token | forked |
| Rebuild | Fresh-launch seeded with operator-declared artifacts in trust-precedence order | rebuilt |
| Artifact-backed mental-model rebuild | Restored seat derives understanding from a packet rather than native runtime continuity | (case of rebuilt) |
| Fresh launch | New agent without prior continuity | fresh |
These are load-bearing distinctions. Do NOT collapse fork into
artifact-backed reentry; do NOT collapse rebuild into fork.
The three mechanisms — who owns each (verified vs main d37a08ad, 2026-07-21)
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 7d ago First seen · 164 lines · 88 tokens per session scan B 2e785328d6e8
session-compaction-and-restore is a skill published in the GitHub repository mvschwarz/openrig (65 stars, last pushed yesterday), licensed Apache-2.0. It adds 88 tokens to every session and 1,866 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
handoff
Write a compact, decision-ready handoff so the next session (or the user) can continue without reconstructing the current one. Use when the session is ending, context is running low, the user asks for a handoff / "pass the baton" / "hand off", or a long-running operation needs a durable state checkpoint.
durable-session-state
Persist plans, scope decisions, evidence, and reviewer/critic verdicts to durable files during long or multi-phase tasks so work survives context compaction, session resumes, and handoffs. Use for swarm-mode tasks, before context grows large, when recording approval gates, and when resuming after compaction or a…
semantix
Install and use the semantix memory kernel as a middleware in your agent: extract user preferences / workflows / experience from past sessions, retrieve and inject them on demand. One binary + your agent's own tools.
compact-now
Operator-triggered proactive compaction — Chrono externalizes load-bearing state (active decisions, open tasks, next action) to a snapshot + a durable Vault learning note before invoking Claude Code's native /compact, then resumes from the snapshot. Use when the operator says "/compact-now" / "compact now" or when…
continuous-learning
Use when a mistake, correction, or surprise taught the workspace something that must stick — a retro or postmortem, the same agent error corrected twice, a resolved bug's root cause, scattered notes-to-self — and route that lesson to the durable surface that fires next time. NOT a forward choice with alternatives…
init
Turn on Rekal memory in the current repository by running rekal init. Use when the user asks to initialize or set up Rekal here, or when a rekal command reported the repository is not initialized. Once per repository. Do not offer this merely because a repo lacks a .rekal/ store — most repos do not want one.