Savemaintenance
Deterministic reconciliation of conversation-log.md, FTS5 index, and saved conversations — one-shot fix or maintenance run Sister skill to the save skill, only get this if you are …
Mirza42
@mirza42
What This Skill Does
Repairs and reconciles a three-tier memory system (conversation log, FTS5 index, and saved conversation files) by detecting orphans, missing entries, stale indexes, and drift between the log and files on disk. Runs as a deterministic pipeline with backup, reconcile, rebuild, and audit steps.
Replaces manual auditing and patching of conversation logs and indexes by automating the full reconciliation pipeline with dry-run preview and timestamped backups.
When to Use It
- Run weekly maintenance to keep conversation log and FTS5 index in sync
- Fix orphaned log entries after manually deleting saved conversation files
- Re-index saved conversations after adding files outside the normal save workflow
- Audit the memory system for coherence after bulk operations or file renames
- Preview changes with a dry run before applying any repairs
- Restore from a snapshot after a failed reconciliation or accidental data loss
Install
$ openclaw skills install @mirza42/savemaintenancesavemaintenance — Memory System Reconcile Pipeline
One-shot tool for keeping the three-tier memory system coherent. Cross-references the conversation log against files on disk, rebuilds the FTS5 index, runs a full audit. Zero external dependencies.
The Problem
The three-tier memory system (log → FTS5 index → files) is designed for consistency, but things drift:
- Files get deleted but their log entries remain (orphans)
- Files get added outside the save workflow but never get indexed
- The FTS5 index gets stale
- The topic map and stub index need regeneration
savemaintenance is the repair pipeline for all of the above. Run it weekly, or after any bulk operation on saved conversations.
Usage
# Copy the pipeline to the workspace
cp -r {baseDir}/. ~/.openclaw/workspace/savemaintenance/
# Dry run first — see what would change
cd ~/.openclaw/workspace/savemaintenance && python3 full-reconcile.py --dry
# Full repair: backup → reconcile → rebuild → audit
./run.sh
# Or run individual steps
python3 full-reconcile.py --step backup
python3 full-reconcile.py --step reconcile
python3 full-reconcile.py --step rebuild
python3 full-reconcile.py --step audit
What It Does
1. Backup
Copies conversation-log.md and topic-index.json to timestamped backups.
2. Reconcile
- Removes log entries where the
.mdfile no longer exists - Adds entries for
.mdfiles not in the log (reads# Titlefrom file content) - Sorts all entries by date descending
- Updates the header count
3. Rebuild
Regenerates the FTS5 index at /dev/shm/memory-index.db from scratch.
4. Audit
Reports: orphan entries, missing files, index coherence, directory hygiene.
Scripts
| File | Purpose |
|---|---|
run.sh | Entry point — snapshot then full reconcile |
full-reconcile.py | Core pipeline (backup → reconcile → rebuild → audit) |
snapshot.py | Manual snapshot/restore tool |
README.md | Full documentation |
Snapshots
python3 snapshot.py # Auto-timestamped snapshot
python3 snapshot.py take <tag> # Named snapshot
python3 snapshot.py list # List all snapshots
Snapshots go to backups/ by default.
Edge Cases Handled
- Empty log file — creates a fresh log from scratch
- New files added between runs — adds them without removing existing entries
- Deleted files still in log — entries are removed
- Renamed files — detected as "dead entry + new orphan" pair
- Dry run — preview changes without writing anything
Default Paths
| Path | Default |
|---|---|
| Saved conversations | ~/.openclaw/workspace/saved/ |
| Conversation log | ~/.openclaw/workspace/saved/conversation-log.md |
| Memory index | /dev/shm/memory-index.db |
| Backup dir | ~/.openclaw/workspace/savemaintenance/backups/ |
Set OPENCLAW_WORKSPACE env var to override ~/.openclaw/workspace.
Dependencies
- Python 3.8+ (standard library only — no pip packages)
- SQLite3 FTS5 (bundled with Python)
- The
saveskill from ClawHub (for memory-index.py)
Top skills in this category
Self-Improving + Proactive Agent
@ivangdavilaSelf-reflection + Self-criticism + Self-learning + Self-organizing memory. Agent evaluates its own work, catches mistakes, and improves permanently. Use when...
ontology
@oswalpalashTyped knowledge graph for structured agent memory and composable skills. Use when creating/querying entities (Person, Project, Task, Event, Document), linkin...
Humanizer
@biostartechnologyRemove signs of AI-generated writing from text. Use when editing or reviewing text to make it sound more natural and human-written. Based on Wikipedia's comprehensive "Signs of AI writing" guide. Detects and fixes patterns including: inflated symbolism, promotional language, superficial -ing analyses, vague attributions, em dash overuse, rule of three, AI vocabulary words, negative parallelisms, and excessive conjunctive phrases.
Obsidian
@steipeteWork with Obsidian vaults (plain Markdown notes) and automate via obsidian-cli.
YouTube Watcher
@michaelgatharaFetch and read transcripts from YouTube videos. Use when you need to summarize a video, answer questions about its content, or extract information from it.