5.3 KiB
memory-continuity
OpenClaw skill for short-term working continuity — so your agent can pick up
exactly where it left off after a gateway crash, /new, model fallback, or
context compaction.
What problem does this solve?
When your gateway dies mid-conversation, or you hit /new to start fresh, or
the model falls back to a different provider — your agent loses its working
context. Long-term memory can tell it what it knows, but not what it was
doing. This skill fills that gap.
One-line summary: Long-term memory = what you know. This skill = what you are doing right now.
Quick Start
Install
# Go to your OpenClaw workspace skills directory
cd ~/.openclaw/workspace/skills/
# Clone
git clone https://github.com/dtzp555-max/memory-continuity.git
# That's it. No npm install, no API keys, no database.
Test it
- Start a conversation with your agent about a multi-step task
- Chat for a few turns, make some decisions
- Check: does
memory/CURRENT_STATE.mdexist in your workspace? Does it reflect what you were doing? - Type
/newto start a fresh session - The agent should read
CURRENT_STATE.mdand ask: "Last session we were working on X. Want to continue?"
If step 5 works, the skill is doing its job.
Run the doctor
python3 scripts/continuity_doctor.py --workspace ~/.openclaw/workspace
Sample output:
Continuity Doctor — scanning: /Users/you/.openclaw/workspace
============================================================
[OK] memory/CURRENT_STATE.md exists
[OK] CURRENT_STATE.md is fresh (0.3h old)
[OK] Template compliance: all sections present
[WARNING] Unsurfaced Results section is not empty — review needed
[INFO] Found 3 session archive(s), latest: 2026-03-12_14-30.md
Overall status: WARNING
How it works
The skill installs a behavioral protocol via SKILL.md. When loaded, the agent
follows these rules:
- Session start: Read
memory/CURRENT_STATE.md, brief the user, wait for confirmation - During work: Overwrite the state file at key moments (decisions, completed steps, errors, before long tool calls, every ~10 turns)
- Session end /
/new: Final state save + archive a timestamped snapshot
The state file uses a fixed template:
# Current State
> Last updated: 2026-03-12T14:30:00Z
## Objective
Build the user authentication module
## Current Step
Completed JWT token generation, starting refresh endpoint
## Key Decisions
- Using RS256 for token signing (user approved)
- Token expiry: 15 minutes access, 7 days refresh
## Next Action
Implement POST /auth/refresh endpoint
## Blockers
None
## Unsurfaced Results
None
The entire file is designed to be read in 15 seconds. It is overwritten (not appended) on every update, keeping it permanently short.
Architecture position
This skill occupies a specific niche. Here is how it relates to other tools:
| Layer | Tool | What it stores |
|---|---|---|
| Working state | memory-continuity (this skill) | What you are doing right now |
| Stable facts | OpenClaw native markdown memory | Preferences, decisions, knowledge |
| Retrieval | memory-lancedb-pro / similar | Searchable long-term history |
These layers are complementary. This skill has zero dependency on any
database or external memory plugin. It works with plain markdown files that
live in your workspace and can be backed up with git or cp.
File structure
memory-continuity/
├── SKILL.md # Core skill (loaded by OpenClaw)
├── README.md # This file
├── LICENSE # MIT
├── references/
│ ├── template.md # CURRENT_STATE.md blank template
│ └── doctor-spec.md # Doctor check specifications
└── scripts/
└── continuity_doctor.py # Diagnostic tool (reports only, no auto-repair)
At runtime, the skill creates these files in your workspace:
$WORKSPACE/
└── memory/
├── CURRENT_STATE.md # Live workbench (overwritten each update)
└── session_archive/ # Timestamped snapshots from past sessions
├── 2026-03-12_14-30.md
└── ...
Design principles
- Zero dependencies. No database, no API, no npm packages. Just files.
- Backup = copy. The entire state is in
memory/. Back it up however you back up your workspace. - Overwrite, don't append. CURRENT_STATE.md is a workbench, not a journal. It stays short because it is replaced on every update.
- Diagnose, don't auto-repair. The doctor script flags problems for you to fix. Automated repair of state files is too risky at this stage.
- Complement, don't compete. This skill does not replace long-term memory. It solves a different problem (crash recovery vs knowledge retrieval).
Current status
v0.2 — Draft / early version
What works:
- SKILL.md protocol with discipline rules
- CURRENT_STATE.md template
- Continuity doctor diagnostic script
- Session archive on
/new
Planned:
- Plugin version with
command:newandbefore_agent_starthooks (for guaranteed save/restore without relying on agent self-discipline) - More real-world validation across different gateway configurations
- Sub-agent continuity handover protocol
License
MIT