session-compaction-and-restore
यह क्या करती है
यह स्किल समझाती है कि AI एजेंट का संदर्भ compact, restart या refresh होने पर उसकी उपयोगी कार्य-स्थिति कैसे बची रहती है। यह उन ऑपरेटरों और एजेंट्स के लिए है जो लंबे समय चलने वाली seats चलाते हैं जो रीसेट के बाद ठंडी न पड़ें।
कब इस्तेमाल करें
- ✓जब कोई seat compaction के करीब हो या अभी compact हुई हो।
- ✓जब आप सक्रिय काम के लिए restore packet डिज़ाइन करते हैं।
- ✓जब आपको native resume, fork और artifacts से rebuild में से चुनना हो।
Skill का लिंक
https://github.com/mvschwarz/openrig/blob/main/packages/daemon/assets/plugins/openrig-core/skills/session-compaction-and-restore/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“हमारी planner seat compact होने वाली है। ऐसा restore packet डिज़ाइन कीजिए जो केवल फ़ाइल नाम नहीं, उत्पाद का इरादा भी रखे।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
यह restore के तरीके और आम विफलता के कारण समझाती है, ताकि एजेंट विवरण के साथ उत्पाद का इरादा और अगला कदम भी बचाए।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे 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)
The outcomes above ride on three DISTINCT mechanisms; keep them separate:
- Claude built-in
/compact— a Claude Code HARNESS feature, not OpenRig code. OpenRig only emits the literal/compacttoward the pane after a prep turn; there is no compaction algorithm in the OpenRig repo. Provider-owned. - OpenRig-managed restore — the enforcer + hook bridge: a precompact hook
WRITES a restore packet; a bridge READER injects exactly ONE restore directive
back via the harness hook channel (
hookSpecificOutput.additionalContext), seat-isolated. The OpenRig-owned half. - Codex session continuity — resume/rollout tokens (
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."
Claude's own idle compaction while managed compaction is on
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).
- Version boundary: Claude Code supports the key from 2.1.290. Earlier versions ignore it, so idle compaction stays possible there.
- Precedence: it overrides a lower-precedence
idleCompaction: truein user or project settings for those launches. Claude's managed settings still win. - Native threshold auto-compaction is untouched (
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. Nothi
अक्सर पूछे जाने वाले सवाल
restore packet क्या है?
यह एक दस्तावेज़ है जिससे एजेंट रीसेट के बाद अपने मुख्य संदर्भ के साथ सक्रिय काम में लौट सकता है।
क्या native resume और handover एक ही हैं?
नहीं, स्किल कहती है कि runtime resume को handover नहीं समझना चाहिए।
क्या Codex को भी कवर करती है?
हाँ, यह Claude compaction restore के साथ Codex resume और fork के तरीके भी कवर करती है।
जानकारी
लेखक का मूल विवरण
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).
repo: mvschwarz/openrig
लोकप्रियता
- GitHub स्टार
- 8.6k
- रैंकिंग में स्थान
- #12398
- लाइसेंस
- Apache-2.0
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
agent-operated-software
8.6kयह आपके एजेंट को ऐसे चालू ऐप को डिज़ाइन, बनाने या डीबग करने में मदद करती है जिसके लाइव बैकएंड में AI एजेंट शामिल हैं, जैसे Markdown या JSON control plane।
agent-operated-workflows
8.6kयह आपके एजेंट को तय करने में मदद करती है कि कोई सीमित प्रक्रिया AI एजेंट चलाए या साधारण कोड, और सत्यापित सबूत से उसे कैसे फिर से शुरू करे।
applying-a-permission-policy
8.6kयह आपके एजेंट को टीम सेटअप के दौरान AI coding एजेंट की कमांड अनुमतियां सेट करने में मदद करती है, ताकि रोज़ के कमांड कम मंज़ूरी प्रॉम्प्ट के साथ चलें।
claude-compaction-restore
8.6kयह Claude Code एजेंट को compact होने के बाद सहेजे restore map, उसके transcript और छुई गई फ़ाइलों से अपनी कार्य-समझ फिर बनाने में मदद करती है।
मिलती-जुलती skills
add-model-provider
394kयह आपके एजेंट को सुरक्षित कमांड से OpenClaw में नया AI मॉडल प्रोवाइडर जोड़ने, API कीज़ को सादे टेक्स्ट से बचाने और लाइव टेस्ट चलाने देती है।
acp-router
394kयह आपके एजेंट को OpenClaw के ज़रिए Claude Code या Cursor जैसे कोडिंग असिस्टेंट को काम भेजने देती है, ताकि काम उसी टूल में चले।
browser-automation
394kयह आपके एजेंट को लॉगिन, टैब और अटकी वेब पेज से उबरने समेत, वेबसाइट पर चरण-दर-चरण काम करना सिखाती है।