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 claude-compaction-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/claude-compaction-restore)<a href="https://agentmods.dev/skills/mvschwarz/openrig/claude-compaction-restore"><img src="https://agentmods.dev/badge/skills/mvschwarz/openrig/claude-compaction-restore.svg" alt="Measured on agentmods" height="20"></a>- NVIDIA SkillSpector warn
SkillSpector: 1 finding, up to medium
These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →
- medium Rogue Agent · line 34 Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
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.00049 | $0.02091 |
| Opus 5 | $0.00024 | $0.01045 |
| Sonnet 5 | $0.00010 | $0.00418 |
| Haiku 4.5 | $0.00005 | $0.00209 |
Grade A, and why
claude-compaction-restore scanned grade A with 0 findings 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 8d 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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 167 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Claude Compaction Restore
Use this skill to preserve continuity before Claude Code compacts and to restore continuity after compaction. Do the work described here; do not merely explain the protocol.
If You Are About To Compact
Prepare durable continuity before the context boundary.
- Identify the active task, queue item, mission/slice, branch or commit, and current working directory.
- Record the current state: decisions made, files changed, commands/tests run, evidence produced, blockers, caveats, and the next concrete step.
- Create or update a durable mental-model restore map. This map is the main artifact future-you will use to rebuild context after compaction.
- In the restore map, write an ASCII file/folder tree of every path that
mattered to your working mental model during this session. Include:
- the active queue item or mission packet;
- mission notes, progress, decisions, and evidence files;
- Claude memory/project notes you used or wrote, especially when the memory folder is shared by many agents;
- files with active edits or recently inspected source;
- root instructions such as
AGENTS.md,CLAUDE.md, orREADME.md; - as-built docs, codemaps, conventions, skills, and product docs needed before code/review work;
- source files, tests, scripts, UI evidence, screenshots, logs, or reports that shaped your current state.
- For every file or folder in the tree, add a short note explaining why it matters and whether it is required reading after compaction.
- Write any important glue context that is not already on disk into the handoff/restore map. This includes assumptions, partial conclusions, failed paths, and why the listed files fit together.
- In the compaction summary, include the restore map path and the top required reading paths from that map.
If You Just Compacted
Treat your memory as unreliable until you restore from durable evidence. Restoration is your current task. Do not wait for a future user request or a new task assignment before reading the required files.
What ships with it
4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 8d ago First seen · 167 lines · 49 tokens per session scan A 6f64609f32bc
claude-compaction-restore is a skill published in the GitHub repository mvschwarz/openrig (66 stars, last pushed yesterday), licensed Apache-2.0. It adds 49 tokens to every session and 2,091 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. 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.