Requirements
- Target platform
- OpenClaw
- Install method
- Manual import
- Extraction
- Extract archive
- Prerequisites
- OpenClaw
- Primary doc
- SKILL.md
Structured task snapshot and automatic post-compaction recovery. Captures exact code, decisions, file paths, and task state before context compaction and rec...
Structured task snapshot and automatic post-compaction recovery. Captures exact code, decisions, file paths, and task state before context compaction and rec...
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
Structured task snapshots that survive context compaction. Three-phase protocol: CAPTURE -- Save a structured task snapshot before compaction wipes your context DETECT -- Recognize when compaction has occurred and context is missing RECOVER -- Search memory for the latest snapshot and resume exactly where you left off Uses only OpenClaw built-in tools (memory_search, memory_get, Read, Edit). No scripts, no external databases, no API keys.
When you receive a system message related to compaction (containing "compact", "memory flush", "store durable memories", or "nearing compaction"), execute the CAPTURE protocol instead of writing generic notes. Create a full structured snapshot following the schema above.
After completing a significant unit of work -- implementing a feature, fixing a bug, making an architecture decision -- self-assess: "If compaction happened right now, would I lose critical context?" If yes, create a snapshot. Good times to snapshot: After a design decision that affects multiple files After writing code the user will refer back to After debugging a complex issue (capture the root cause and fix) When switching between subtasks within a larger task
When the user says /big-memory save, "save snapshot", "checkpoint", or "big-memory save", create a snapshot immediately.
Read the current daily log memory/{YYYY-MM-DD}.md using Read. If it does not exist, you will create it. APPEND the snapshot. Never overwrite existing content. Read the file first, then use Edit to append at the end. Alternatively, use Write with the full existing content plus the new snapshot. Precede the snapshot with a horizontal rule and heading: --- ## Task Snapshot -- HH:MM <!-- BIG-MEMORY-SNAPSHOT v1 --> ... <!-- /BIG-MEMORY-SNAPSHOT --> Multiple snapshots in the same file is expected. Each captures a point-in-time state. The most recent snapshot is the source of truth.
Suspect compaction when ANY of these are true: The conversation begins with a summary/compaction block rather than the original exchange You cannot recall specific details (file paths, variable names, exact code) that should be known The user says "you forgot", "we were working on", "remember when", "what was I doing", or similar A system message contains "Auto-compaction complete" or similar
Execute this search: memory_search("BIG-MEMORY-SNAPSHOT") This triggers hybrid vector + BM25 search across all memory files. The HTML comment markers ensure high BM25 relevance scoring. If results are found, use memory_get or Read to retrieve the full file content at the matched path and line range. If no results from the primary search, try broader queries: memory_search("SNAPSHOT Active Goal Next Steps") memory_search("{today's date} task snapshot")
After retrieving a snapshot: Parse the content between <!-- BIG-MEMORY-SNAPSHOT v1 --> and <!-- /BIG-MEMORY-SNAPSHOT --> markers Inform the user: "I detected context was compacted. Restoring task state from snapshot taken at {timestamp}..." Present the recovered state concisely: Goal: {from Active Goal} Phase: {from Current State} Working on: {from Files In Play} Next up: {from Next Steps} Ask: "Does this match where we left off? Anything to update before I continue?" Resume work from the Next Steps section
If no snapshot exists in memory: Search more broadly: memory_search("{project name}"), memory_search("decided"), memory_search("working on") Check MEMORY.md for any relevant long-term notes Tell the user: "I couldn't find a structured snapshot. Can you briefly remind me what we were working on? I'll save a snapshot this time so it won't happen again."
If multiple snapshots are found: Use the one with the most recent timestamp (check the <!-- timestamp: --> comment) If the user indicates the latest is stale, check the next one back
Create a snapshot now. Execute the full CAPTURE protocol: Read {baseDir}/references/TASK-SNAPSHOT.md for the template (first time only) Assess the current task state Fill in all 8 schema sections Append to today's daily log (memory/YYYY-MM-DD.md) Confirm: "Snapshot saved to memory/{date}.md"
Search for and display the most recent snapshot: Execute memory_search("BIG-MEMORY-SNAPSHOT") Retrieve the full snapshot via memory_get or Read Display the recovered state (goal, phase, files, next steps) Ask if the user wants to resume from this state
Show current snapshot information: Search for snapshots in today's daily log Report: number of snapshots today, timestamp of most recent, whether the current task state has diverged from the last snapshot Suggest /big-memory save if no recent snapshot exists, or /big-memory recall if context seems incomplete
Default to status. Show the current state and suggest the most useful action.
For optimal automatic capture, add these settings to your project's openclaw.json. See {baseDir}/references/openclaw-config.md for the full configuration. The most impactful change is replacing the default generic flush prompt: { "agents": { "defaults": { "compaction": { "memoryFlush": { "enabled": true, "softThresholdTokens": 40000, "systemPrompt": "You are capturing structured task state for post-compaction recovery. Follow the BIG-MEMORY-SNAPSHOT schema exactly.", "prompt": "Context compaction is imminent. Create a structured task snapshot following the BIG-MEMORY-SNAPSHOT schema and APPEND it to memory/YYYY-MM-DD.md. Include: active goal, current state, files in play, decisions made, code context (key snippets only), key names/values, blockers, and next steps. Read the existing file first -- never overwrite. Reply NO_FLUSH if nothing worth storing." } } } } } This replaces the default "store durable memories now" with instructions that trigger our structured capture protocol.
Keep code snippets short. Only include lines that matter: function signatures, error-producing code, regex patterns, config values. If the code is in a committed file, reference the file path instead. Don't snapshot trivially. If the conversation is simple Q&A with no state to preserve, skip it. Snapshots are for complex, multi-step tasks. Latest snapshot wins. When multiple snapshots exist, the most recent one is the source of truth. Earlier snapshots provide history but should not override later decisions. Update after corrections. If the user corrects something after recovery, create a new snapshot reflecting the correction. Pair with MEMORY.md. Use MEMORY.md for long-term knowledge (project architecture, conventions, preferences). Use snapshots only for transient task state that needs to survive the next compaction. Snapshot before switching tasks. If you're about to pivot to a different part of the codebase, snapshot the current task so you can return to it.
Agent frameworks, memory systems, reasoning layers, and model-native orchestration.
Largest current source with strong distribution and engagement signals.