savemaintenance for Openclaw

savemaintenance is an Openclaw Skills maintenance pipeline that backs up, reconciles, rebuilds, and audits the three-tier memory system in one deterministic run.

mirza42
v1.0.0
Jul 19, 2026
0
306
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install savemaintenance

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install savemaintenance using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is savemaintenance?

savemaintenance is an Openclaw Skills utility for keeping the conversation-log.md  FTS5 index  saved files stack coherent. It detects drift between the log and the filesystem, regenerates the SQLite FTS5 index from scratch, and delivers a reproducible maintenance pass with zero external dependencies.

Use it when saved conversations are edited outside the normal save flow, when files go missing, or when the index becomes stale. The workflow is designed for safe repairs: it snapshots first, supports dry runs, and handles empty logs, renamed files, and bulk imports without manual cleanup.

savemaintenance Use Cases

  • Run weekly to prevent drift in the Openclaw Skills memory system.
  • Repair after bulk moves, deletes, or manual edits to saved conversation files.
  • Rebuild a stale or corrupted FTS5 index from the current filesystem state.
  • Add files that were created outside the save workflow and never indexed.
  • Remove orphan log entries for files that no longer exist.
  • Validate the integrity of the saved conversation workspace before or after maintenance.
  • Preview changes with --dry before writing anything.

How savemaintenance Works

  1. Copy the skill into ~/.openclaw/workspace/savemaintenance/ so the pipeline runs inside the workspace.
  2. Create a timestamped backup of conversation-log.md and topic-index.json before making changes.
  3. Reconcile the log against the saved conversation directory: delete dead entries, add missing files by reading their # Title, sort by newest first, and refresh the header count.
  4. Rebuild memory-index.db at /dev/shm/memory-index.db from scratch using SQLite FTS5.
  5. Audit the workspace for orphan entries, missing files, index coherence, and directory hygiene.
  6. Finish with a full run.sh maintenance pass or use step-based execution and dry run mode for targeted repairs.

savemaintenance Setup

  1. Confirm Python 3.8+ is installed and the save skill has already provided memory-index.py.
  2. Create the workspace directories required by savemaintenance.
  3. Verify the saved conversations directory exists.
  4. Copy the skill files into the workspace and run a dry run before the full repair.
  5. Optionally set OPENCLAW_WORKSPACE if you do not use the default workspace path.
mkdir -p ~/.openclaw/workspace/savemaintenance
mkdir -p ~/.openclaw/workspace/savemaintenance/backups
mkdir -p ~/.openclaw/workspace/savemaintenance/snapshots
test -d ~/.openclaw/workspace/saved || echo 'WARN: ~/.openclaw/workspace/saved/ does not exist yet (run save skill setup first)'
test -f ~/.openclaw/workspace/saved/memory-index.py || echo 'WARN: memory-index.py not found - install the save skill first'
cp -r {baseDir}/. ~/.openclaw/workspace/savemaintenance/
cd ~/.openclaw/workspace/savemaintenance && python3 full-reconcile.py --dry
./run.sh
export OPENCLAW_WORKSPACE="$HOME/.openclaw/workspace"

No pip packages are required; the skill uses Python standard library modules and bundled SQLite FTS5 support.

savemaintenance Data Schema & Taxonomy

Primary artifacts

Artifact Default path Purpose
Saved conversations ~/.openclaw/workspace/saved/ Source directory containing conversation .md files
Conversation log ~/.openclaw/workspace/saved/conversation-log.md Canonical Markdown log of saved conversations
Topic index ~/.openclaw/workspace/saved/topic-index.json Companion metadata file that is backed up during maintenance
Memory index /dev/shm/memory-index.db Rebuilt SQLite FTS5 database used for search coherence
Backup directory ~/.openclaw/workspace/savemaintenance/backups/ Timestamped backups of log and topic index
Snapshot directory ~/.openclaw/workspace/savemaintenance/snapshots/ Manual snapshot and restore artifacts

File and record conventions

  • conversation-log.md entries are sorted by date descending after reconciliation.
  • The header count is refreshed automatically so the log reflects the actual number of entries.
  • When a new .md file is discovered, the title is extracted from the first # Title line in the file content.
  • Deleted files are removed from the log as dead entries.
  • Files present on disk but missing from the log are added as new orphan-to-log reconciliations.
  • run.sh, full-reconcile.py, snapshot.py, and README.md live in the savemaintenance workspace and implement the pipeline and supporting tooling.

Metadata taxonomy

Term Meaning
Dead entry A log record whose referenced .md file no longer exists
Orphan file A saved conversation file on disk that is not represented in the log
Coherent index A freshly rebuilt FTS5 database aligned to the current file set
Directory hygiene Audit signal for missing files, drift, or unexpected workspace state
Snapshot tag Named restore point created with snapshot.py take <tag>

Path override

  • Set OPENCLAW_WORKSPACE to point the skill at a custom workspace root instead of ~/.openclaw/workspace.

savemaintenance Advanced Features

  • Dry-run preview mode with --dry to validate planned changes before writing.
  • Step-wise control with --step backup, --step reconcile, --step rebuild, and --step audit for targeted maintenance.
  • Full automation via run.sh, which snapshots first and then runs the complete pipeline.
  • Manual snapshot and restore support through snapshot.py with auto-timestamped snapshots and named tags.
  • Deterministic FTS5 rebuilds from scratch in /dev/shm/memory-index.db for clean search state regeneration.
  • Edge-case recovery for empty logs, renamed files, newly added files, and deleted-file cleanup.
  • OPENCLAW_WORKSPACE override for non-default workspace layouts and portable Openclaw Skills setups.
  • Standard-library-only implementation with no pip dependencies, making deployment lightweight and repeatable.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*