| name | workspace-memory-maintainer |
| description | Maintain OpenClaw workspace memory files by checking health, creating rollups, backing up memory state, and updating heartbeat-state keys safely. Use when memory logs become noisy, heartbeat state drifts, or weekly recaps are needed. |
Workspace Memory Maintainer
Overview
Maintain memory structure and state with safe, explicit operations.
Prefer health checks and dry-run rollups before writing files.
Quick Start
- Health check memory layout:
./scripts/memory_health_check.sh
- Preview rollup (no write):
./scripts/memory_rollup.sh --limit 3
- Write rollup file:
./scripts/memory_rollup.sh --limit 3 --write
- Update heartbeat state key:
./scripts/memory_state_update.sh --key lastNewsReport --value 2026-03-07
Workflow
Step 1: Verify memory paths
- Confirm workspace and memory directories exist.
- Confirm
heartbeat-state.json is valid JSON.
Step 2: Backup before mutation
- Create a compressed backup of memory directory.
- Continue with edits only after backup succeeds.
Step 3: Generate rollup
- Aggregate latest memory markdown entries.
- Keep concise operational summary in one file.
Step 4: Update state keys
- Write only intended keys.
- Re-check state JSON formatting after update.
Guardrails
- Do not overwrite memory files without backup.
- Keep rollup deterministic and timestamped.
- Avoid storing raw secrets in memory notes.
Resources
scripts/memory_health_check.sh: memory status checks.
scripts/memory_backup.sh: create memory backup archive.
scripts/memory_rollup.sh: generate and optionally write rollups.
scripts/memory_state_update.sh: update heartbeat-state keys.
references/memory-maintenance-playbook.md: maintenance policy.
Example Requests
- "Dùng workspace-memory-maintainer kiểm tra memory và trạng thái heartbeat."
- "Dùng workspace-memory-maintainer tạo rollup 3 file gần nhất và ghi file mới."
- "Dùng workspace-memory-maintainer cập nhật lastNewsReport về hôm nay."
Load references/memory-maintenance-playbook.md for cleanup and retention decisions.