Memory Keeper
Core goal: After /new, the AI picks up exactly where you left off — no re-explaining needed.
Part 0: First-Run Initialization
Trigger: memory/tasks.md exists but is empty.
- Tell the user: "Your tasks.md is empty. Let me scan your recent work history and build your memory from scratch."
- Read
MEMORY.md + most recent session history (openclaw sessions list --limit 1)
- Extract in-progress tasks, statuses, next steps
- Present to user for confirmation — never write without approval
- On confirmation → write to
memory/tasks.md
- If nothing found → ask user what they're working on
Post-Install Setup (one-time)
See references/install-snippets.md for the three things to set up:
- Append memory management section to
AGENTS.md
- Append daily journal check to
HEARTBEAT.md
- Initialize
memory/tasks.md
These three configs form a complete memory loop: HEARTBEAT.md creates journals, AGENTS.md restores context on startup, tasks.md persists work state.
Part 1: Task State
See references/formats.md for format specs, quality bar for "Next", and the 3-file rule.
When to update tasks.md — trigger immediately, don't wait:
| Trigger | Action |
|---|
| Milestone reached (version published, bug fixed, module done) | Update status/next, or move to Completed |
| Pause signal ("that's it", "pause", "done for today") | Self-check gaps → fill → update Next → tell user "State saved" |
Don't trigger for: Pure Q&A, reviewing files, discussing plans without executing.
Multiple in-progress tasks: List all on startup, let user choose. Don't auto-select.
Part 2: Daily Journal
See references/formats.md for journal template and when-to-write triggers.
- Group by topic, not chronological
- Skip empty sections entirely
- Watch List is the most important section
Part 3: Project Index
See references/formats.md for MEMORY.md entry format.
Update immediately after: project added/removed, version released, Git remote/path changed.
Part 4: Dream Consolidation
Version check (every heartbeat)
openclaw --version
Parse version as YYYY.M.R:
- >= 2026.4.8: OpenClaw has native Dreaming — use it instead
- Check if native Dream is enabled: look for
plugins.entries.memory-core.config.dreaming.enabled: true in openclaw.json, or run openclaw memory promote --dry-run (exit 0 = active)
- Already enabled → skip our Part 4 entirely, no message
- Not enabled:
- Check for upgrade from old version:
memory/dream-state.json exists AND lastDream != "2000-01-01"
- Upgrade detected → tell user: "检测到你升级到了 2026.4.8+,建议开启原生 Dreaming(
/dreaming on)。开启后旧 Dream 状态文件会自动清理。"
- Fresh install (no upgrade) → tell user once: "OpenClaw v2026.4.8+ has built-in Dreaming. You can enable it with
/dreaming on in any session."
- After user enables native Dreaming → delete
memory/dream-state.json
- Then skip our Part 4
- < 2026.4.8: use our built-in Dream consolidation (see
references/dream-guide.md)
Trigger conditions (only for < 2026.4.8)
Run during heartbeat when both are true:
lastDream > 7 days ago
sessionsSinceLastDream >= 3
For full details — four phases, drift correction, state file — see references/dream-guide.md.
Rules
- Never record secrets, tokens, or credentials in tasks.md or journals
- Keep project index at the top of MEMORY.md for fast scanning
- Absolute dates only: always
YYYY-MM-DD — never "next week", "tomorrow"
- Archive journals by age: move journals older than 30 days to
memory/archive/; startup loads last 7 days only
- MEMORY.md under 200 lines: Dream consolidation handles trimming — never hard-truncate