1. Purpose
This document records OpenClaw’s current workflow for long-term memory archiving, compression, pre-reset preparation, and post-reset recovery, so it can keep being used later without drifting.
After a round of work, a lot of information usually ends up scattered across chats, sessions, temporary files, and plain human memory. As time passes, that easily turns into situations like “we did this before, but can’t pick it back up” or “I remember this existed, but can’t find the proper entry point anymore.”
Once these workflows are written down in one place, future wrap-ups, handoffs, /new, and /reset can all follow the same process. You can tell where information should go, what still needs to be filled in, and where to resume when coming back.
This document can be used directly as an execution guide. Memory updates, project wrap-up, reset preparation, and post-reset recovery should all follow the rules here.
2. Current Official Memory Structure
The current long-term memory is fixed into four layers:
sessionsmemory/*.mdmemory/topics/*.mdMEMORY.md
Their responsibilities are as follows.
2.1 sessions
- Stores raw chronological records
- Used for full replay
- Not intended for fast recovery
- Not used directly as long-term summaries
2.2 memory/*.md
- Stores date-level or project-level summaries
- Records high-value conclusions
- Records current status, key paths, key decisions, risks, and next steps
- Does not accumulate large raw logs
- Does not accumulate command-by-command history
2.3 memory/topics/*.md
- Stores topic-level overviews
- Compresses multiple
memory/*.mdfiles under the same topic into one more layer - Represents the current official understanding of that topic
- Suitable for priority reading after a reset
2.4 MEMORY.md
- Used only as a long-term index
- Contains only dates, topics, one-line conclusions, tags, and paths
- Not written as long-form body content
- Does not repeat detailed content
One-sentence rule:
- sessions keep the raw record
memory/*.mdkeep summariesmemory/topics/*.mdkeep topic overviewsMEMORY.mdkeeps only the index
3. What Should Go Into Long-Term Memory
The following content should go into memory/ or memory/topics/:
- Key configuration changes
- New nodes or service integrations
- Newly implemented scripts or workflows
- Important troubleshooting conclusions
- Key decisions and why they were made
- Paths, entry points, and methods that are likely to be reused later
- Anything the boss explicitly says to “remember”
- The official status at project wrap-up
The following content should not go directly into long-term memory:
- Temporary trial-and-error process
- Unconfirmed guesses
- Large raw logs
- Continuous command history
- Casual chat
- Duplicate information
- One-off temporary file notes
4. Archiving Workflow
“Archiving” here means formally writing the parts of the current round of work that are truly worth keeping into the memory system, rather than leaving them only in chat.
4.1 Daily Archiving Triggers
If any of the following happens on a given day, it should be archived:
- A new service, node, or entry point
- A key configuration change
- A new workflow or rule is put in place
- An important troubleshooting conclusion
- The boss says “remember this”
- There is a high chance the work will continue within the next 7 days
If none of the above happens:
- Do not force a long summary
- Keeping the raw session is enough
4.2 Daily Archiving Steps
- Review the key session or key file changes from that day
- Extract the following:
- What was done
- Current status
- Key paths
- Key decisions
- Risks / pitfalls
- How to continue next time
- Write it into
memory/YYYY-MM-DD.md - Add an index entry in
MEMORY.md - If it belongs to an existing topic, update the corresponding
memory/topics/*.md
4.3 Large Project Archiving Steps
If the work involves cross-VPS, cross-claw, real deployment, real production launch, or long-term maintenance, use the large-project workflow:
- Collect evidence
- Official path
- Official entry point
- Official script
- Current official status
- Clean up junk
- tmp
- Temporary downloads
- Temporary archives
- One-off scripts
- Debug leftovers
- Miswritten files
- Write a date summary into
memory/*.md - Write or update a topic file in
memory/topics/*.md - Update the
MEMORY.mdindex - Confirm it has entered the backup pipeline
5. Compression Workflow
“Compression” does not mean deleting memory. It means organizing raw history into a structure that is easy to take over, reuse, and continue developing.
5.1 Anchors That Must Be Preserved During Compression
When compressing long-term memory, the following must not be lost:
- Current official status
- Official path / official entry point / official script
- Key decisions and why they were made
- High-frequency risks and pitfalls
- How to continue next time
- Traceback anchors (corresponding summary files or sessions)
5.2 Compression Triggers
If any of the following happens, a compression pass should be done:
- An important project is being wrapped up
- A topic has accumulated more than 3
memory/*.mdfiles - A single summary exceeds 150–200 lines
MEMORY.mdexceeds 120 lines- A topic has entered long-term maintenance
- Before
/new,/reset, handoff, or archive
5.3 Project-Level Compression Steps
- Read the relevant sessions or daily summaries
- Extract conclusions, status, anchors, and risks
- Write them into
memory/YYYY-MM-DD.mdor a project summary file - Add an index entry to
MEMORY.md
5.4 Topic-Level Compression Steps
- Gather 3 or more date summaries under the same topic
- Merge repeated conclusions
- Converge them into the current official status
- Write into
memory/topics/*.md - Make
MEMORY.mdpoint to the topic file first
6. MEMORY.md Index Protocol
MEMORY.md should only keep:
- Date
- One-line conclusion
- Tags
- Corresponding path
Example format:
- 2026-03-08: The long-term memory structure was consolidated into
sessions / memory / topics / MEMORY, anddaily_chat/was explicitly dropped as an official long-term record entry point. Seememory/2026-03-08.mdandmemory/RESET_REHAB.md. #memory #reset
Prohibited actions:
- Do not turn
MEMORY.mdinto a second body document - Do not copy large sections from
memory/*.mdintoMEMORY.md - Do not pile logs, commands, or chat into
MEMORY.md
7. The Current Role of daily_chat/
The current rule has already settled:
daily_chat/is no longer used as an official long-term memory entry point- Long-term information, archiving, backfilling, retrospectives, and topic compression should all be written into
memory/ormemory/topics/ MEMORY.mdremains index-only
Why:
daily_chat/is closer to a daily process log- If long-term content stays only in
daily_chat/, later you run into “it was recorded, but never formally entered into the long-term structure” - Long-term assets need to live in a layer that supports recovery, compression, and indexing
8. Pre-Reset Workflow
When preparing for /new, /reset, or when the context is obviously getting too heavy, follow the steps below.
8.1 Pre-Reset Checklist
- Confirm that important conclusions from the day have already entered
memory/ormemory/topics/ - Confirm that
MEMORY.mdalready has the relevant index entry - Confirm that any topic that needs to be kept long-term has been updated
- Update
memory/RESET_REHAB.md - Only then perform the reset
8.2 Minimum Actions Before Reset
If time is tight, do at least these 4 steps:
- Update
memory/YYYY-MM-DD.md(if there was important progress today) - Add an index entry in
MEMORY.md - Update
memory/RESET_REHAB.md - Then reset
8.3 Prohibited Actions Before Reset
- Do not reset before important information has been written down
- Do not leave important conclusions only in session history
- Do not assume “I remember it” means the memory has already been archived
9. Post-Reset Recovery Workflow
After a reset, do not start by scrolling old sessions. The current official approach is to start from the recovery entry point.
9.1 Reading Order
Read in this order:
MEMORY.mdmemory/topics/*.mdmemory/YYYY-MM-DD.md- sessions
9.2 Why This Order
Read MEMORY.md first
Use it to quickly locate what long-term topics currently exist, what important changes happened recently, and where to continue reading.
Then read topics
Use them to restore the current official understanding quickly, instead of getting trapped in date-based history.
Then read date summaries
Use them to fill in the recent evolution details.
Only replay sessions at the end
Go into session history only when raw evidence or full context is actually needed.
9.3 Minimum Recovery Actions
If time is tight after reset, the minimum is:
- Read
MEMORY.md - Read
memory/topics/backup.md - Read
memory/topics/team-claw-map.md - Then read the topic that matches the current issue
10. The Role of RESET_REHAB.md
memory/RESET_REHAB.md is not a complete history. It is a recovery entry point.
Its responsibilities are:
- Telling you what to read first after reset
- Telling you what the most important long-term topics currently are
- Telling you which topic to jump to for different problems
- Telling you what the minimum recovery action is
It does not replace memory/*.md, topics, or sessions.
Its job is to shorten the reading path after reset.
11. The Relationship Between Backups and the Memory System
Current long-term retention has already shifted to a two-track structure:
- Workspace whitelist backup
- Incremental session backup
Why:
- The entire workspace is no longer synced, to avoid junk, cache, and mistakenly downloaded projects polluting long-term backups
- Raw details are handled through session replay
- High-value long-term information goes into
memory/ - Keeping only
MEMORY.mdis not enough, because that leads to “an index pointing to empty air”
Current principles:
- session handles raw replay
memory/handles compressed summariestopicshandle topic overviewsMEMORY.mdhandles entry-point discovery- backups make sure these official assets do not get lost
12. Supplemental Rules for Stage Wrap-Up
It has now been formally fixed that after each claw finishes a project or stage, it must proactively complete the following:
archiveretrocleanup
A stage receipt should include at least:
archive_written=yes/noretro_written=yes/nocleanup=yes/noleftover=none/...
The meaning of this rule is:
- Without evidence, it does not count as completed
- Without archiving, it does not count as a long-term asset
- Without cleanup, it does not count as properly wrapped up
13. One-Line Execution Version
Daily Version
Important progress happened → write
memory/YYYY-MM-DD.md
Add an index entry inMEMORY.md
If there is an existing topic → update the corresponding topic
Project Wrap-Up Version
Collect evidence first
Clean up junk next
Then writememory/
Then write / updatetopics
Then updateMEMORY.md
Finally confirm it is in backup
Pre-Reset Version
First confirm important information has been written down
UpdateMEMORY.md
UpdateRESET_REHAB.md
Then reset
Post-Reset Version
Read
MEMORY.mdfirst
Then readtopics
Then read date summaries
Look at sessions only at the end
14. Current Overall Principles
The overall principles of the memory system are now fixed as follows.
- Text > Brain
- sessions keep the raw record
memory/*.mdkeep summariesmemory/topics/*.mdkeep topic overviewsMEMORY.mdkeeps only the index- Long-term information goes into
memory/in a unified way;daily_chat/is no longer treated as an official long-term entry point - Before reset, update memory first, then update the recovery entry point
- After reset, go through topics first instead of starting from old sessions
- When a project ends, cleanup comes first, then archiving, then retrospective
- Without evidence, it does not count as formally completed
#OpenClaw #Memory #Workflow #Reset #Archive