Install
openclaw skills install context-memory-recoveryUse when a user asks an OpenClaw, Hermes, or similar file-backed agent to preserve, recover, checkpoint, or restore working context across new sessions, mode...
openclaw skills install context-memory-recoveryThis skill gives file-backed agents a practical continuity protocol. It is for OpenClaw, Hermes, and similar agents that can read and write workspace files.
Core principle: continuity is file-based, not chat-based. If information matters later, write it down.
Agents lose working context after:
This skill creates a repeatable recovery chain so a fresh agent can quickly answer:
Use this hierarchy when saving or recovering context:
SESSION-STATE.md — immediate operational recovery filememory/YYYY-MM-DD.md — daily continuity logMEMORY.md — durable long-term memory and standing rulesIf chat history conflicts with saved files, trust the files unless there is strong evidence they are stale.
SESSION-STATE.mdWorkspace-root file for immediate recovery. Keep it short, structured, and operational. It must not become a diary.
Required structure:
# SESSION-STATE.md
Last Updated: YYYY-MM-DD HH:MM TZ
Agent: <agent name / role>
Workspace: <path if known>
## Current Mission
- <one-line mission>
## Active Tasks
- [ ] <task> — status / owner / next action
## Latest Decisions
- <decision> — <date/time or source if useful>
## Blockers
- <blocker> — <what is needed to unblock>
## Important User Preferences
- <preference or standing instruction>
## Next Step If Session Restarts
- <single safest next action>
Agent-specific naming is allowed when the environment already has a standard name, for example:
CLAUDE-JUNIOR-SESSION-STATE.mdMAESTRO-SESSION-STATE.mdTEMPO-SESSION-STATE.mdIf no agent-specific standard exists, use SESSION-STATE.md.
memory/YYYY-MM-DD.mdDaily operational memory. Use it for:
This file may be more detailed than SESSION-STATE.md, but keep it practical.
Recommended entry format:
- HH:MM TZ: <event/decision>. Evidence: <file/job/commit/tool result if useful>. Next: <next action if any>.
MEMORY.mdDurable long-term memory only. Use it for:
Do not pollute MEMORY.md with temporary task noise.
When continuity may matter, before serious work:
SESSION-STATE.md.memory/YYYY-MM-DD.md if it exists.MEMORY.md if available and appropriate for the privacy context.Put it in memoryWhen the user says exactly or clearly intends:
Put it in memoryPut it it memoryremember thiswe may need this laterget ready for a new modelTreat it as a save command. The exact phrase Put it in memory remains the hard trigger; nearby obvious typos should be honored rather than ignored.
Save workflow:
memory/YYYY-MM-DD.md with the relevant event, decision, task state, or preference.MEMORY.md only if the information is durable, long-term, or a standing rule/preference/decision.Done
No extra words. No punctuation. No emoji. No explanation.
Initiate context memory recoveryWhen the user says exactly or clearly intends:
Initiate context memory recoveryinitiate from recoveryrecover from memorystart context recoveryTreat it as a recovery command.
Recovery workflow:
memory/YYYY-MM-DD.md if it exists.MEMORY.md if available and appropriate for the privacy context.Do not replace this with a generic summary. Do not claim recovery occurred unless the files were actually read.
Update the recovery file whenever continuity matters, especially when:
Checkpoint before likely continuity breaks. Do not wait until context is already lost.
| Information | Session State | Daily Memory | Long-Term Memory |
|---|---|---|---|
| Current task and next step | Yes | Yes | No |
| Temporary blocker | Yes | Yes | No |
| Completed task evidence | Optional | Yes | No |
| Durable user preference | Yes if operationally relevant | Yes | Yes |
| Standing operating rule | Yes if active | Yes | Yes |
| File path needed tomorrow | Yes | Yes | Maybe |
| One-off detail unlikely to matter | No | Optional | No |
| Credentials/secrets | Avoid plaintext | Avoid plaintext | Avoid plaintext |
Before reading or exposing durable memory, consider the chat context.
MEMORY.md may usually be read if available.When first installing or adopting this protocol for an agent:
SESSION-STATE.md.memory/ if missing.memory/YYYY-MM-DD.md if useful.First-adoption checklist:
- [ ] Recovery file exists at workspace root
- [ ] Required sections are present
- [ ] Today's daily memory file exists or is intentionally absent
- [ ] Durable rules are in MEMORY.md when appropriate
- [ ] Trigger phrases are documented
- [ ] Next restart action is clear
After recovery, keep the user-facing answer concise:
Recovered.
Current mission: <one line>
Next step: <one line>
Blocker: <none / one line>
If the trigger requires immediate continuation and no report is needed, continue work instead of summarizing.
SESSION-STATE.md short and operational.# SESSION-STATE.md
Last Updated: 2026-04-30 20:05 SGT
Agent: workspace assistant
Workspace: /path/to/workspace
## Current Mission
- Prepare a reusable file-based recovery protocol for future sessions.
## Active Tasks
- [ ] Review the draft skill — confirm whether it is ready to install or publish.
## Latest Decisions
- Use files as the source of truth when chat history and memory files disagree.
## Blockers
- Awaiting user approval before public publishing.
## Important User Preferences
- Keep recovery files short, operational, and easy for a fresh agent to follow.
- Reply exactly `Done` after completing a save triggered by `Put it in memory`.
## Next Step If Session Restarts
- Read this file, then continue from the active task list without relying on chat history.