session-compaction-and-restore
Fungsinya
Skill ini menjelaskan bagaimana agent AI menjaga keadaan kerjanya yang berguna ketika konteksnya dipadatkan, di-restart, atau disegarkan. Skill ini ditujukan untuk operator dan agent yang menjalankan seat berumur panjang yang tidak boleh kehilangan konteks setelah reset.
Kapan dipakai
- βSaat sebuah seat mendekati pemadatan atau baru saja dipadatkan.
- βSaat Anda merancang paket pemulihan untuk pekerjaan yang sedang berjalan.
- βSaat Anda harus memilih antara resume bawaan, fork, dan pembangunan ulang dari artefak.
Link skill
https://github.com/mvschwarz/openrig/blob/main/packages/daemon/assets/plugins/openrig-core/skills/session-compaction-and-restore/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βSeat perencana kami akan segera dipadatkan. Rancang paket pemulihan yang menjaga maksud produk, bukan hanya nama file.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Skill menjelaskan mode pemulihan dan mode kegagalan yang umum, sehingga agent menjaga maksud produk dan langkah berikutnya, bukan hanya detailnya.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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
Pertanyaan umum
Apa itu paket pemulihan?
Itu adalah dokumen yang memungkinkan agent kembali ke pekerjaan aktif setelah reset, dengan konteks kuncinya.
Apakah resume bawaan sama dengan serah terima?
Tidak. Skill menyatakan bahwa resume saat runtime tidak boleh disalahartikan sebagai serah terima.
Apakah ini juga mencakup Codex?
Ya, skill mencakup mekanisme resume dan fork Codex bersama pemulihan pemadatan Claude.
Detail
Deskripsi asli dari pembuat
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
Popularitas
- Bintang GitHub
- 8.6k
- Peringkat
- #12398
- Lisensi
- Apache-2.0
- Diperbarui
- 2/11/2026
Komentar
- β¦
Skill lain dari repositori ini
agent-operated-software
8.6kMembantu agent Anda merancang, membangun, atau men-debug aplikasi yang sedang berjalan dengan backend live berisi agent AI, seperti bidang kontrol agent berbasis Markdown atau JSON.
agent-operated-workflows
8.6kMembantu agent Anda memutuskan apakah sebuah prosedur terbatas sebaiknya dijalankan oleh agent AI atau oleh kode biasa, dan cara melanjutkannya dari bukti yang sudah diverifikasi.
applying-a-permission-policy
8.6kMembantu agent Anda mengatur izin perintah yang dipakai agent pengodean AI selama pengaturan tim, agar perintah rutin berjalan dengan lebih sedikit permintaan persetujuan.
claude-compaction-restore
8.6kMembantu agent Claude Code membangun kembali gambaran kerjanya setelah konteksnya dipadatkan, memakai peta pemulihan yang disimpan, transkripnya, dan file yang disentuhnya.
Skill serupa
add-model-provider
394kMemungkinkan agent Anda menghubungkan penyedia model AI baru ke OpenClaw dengan perintah pengaturan yang aman, menjaga kunci API tetap di luar teks biasa, dan menjalankan uji langsung.
acp-router
394kMembantu agent Anda mengirim tugas ke asisten pemrograman seperti Claude Code atau Cursor lewat OpenClaw, sehingga pekerjaan dijalankan di alat tersebut.
browser-automation
394kMengajari agent Anda mengendalikan halaman web langkah demi langkah, termasuk login, tab, dan pemulihan saat halaman berhenti merespons.