openclaw-maintenance

Nightly maintenance for OpenClaw — memory organization (sort loose memory files into topic folders with frontmatter and INDEX.md) and session cleanup (purge tombstones, old cron sessions, orphans across all agents). Use when memory files are disorganized, session folders are bloated, disk space is low, or to set up automated daily maintenance. Triggers on "clean sessions", "organize memory", "maintenance", "session bloat", "memory cleanup", "free disk space", "nightly cleanup".

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "openclaw-maintenance" with this command: npx skills add duolahypercho/hypercho-openclaw-maintenance

OpenClaw Maintenance

Two scripts that keep your OpenClaw instance lean: memory organization and session cleanup.

1. Memory Organizer

Sorts loose .md files from ~/.openclaw/workspace/memory/ root into topic subfolders.

What it does

  • Scans memory/*.md for files sitting in the root (not already in a subfolder)
  • Routes each file to a topic folder based on keyword matching:
    • cabinet/ — agent, cron, delegation, cabinet agent names
    • content/ — post, blog, marketing, seo, clips
    • products/ — copanion, hypercho, feature, ui, roadmap
    • technical/ — bug, error, config, docs, gateway
    • x/ — twitter, viral, engagement, followers
    • user/ — ziwen, founder, personal
    • daily/ — fallback for everything else
  • Adds YAML frontmatter (topic, date, tags) if missing
  • Updates INDEX.md in each topic folder with the new file
  • Idempotent — safe to run repeatedly
  • No LLM dependency — pure keyword matching

Run

python3 <skill_dir>/scripts/memory_organize.py

2. Session Cleanup

Cleans session storage across ALL registered agents.

What it cleans

TargetRetentionAction
Tombstones (.reset.*, .deleted.*, .bak-*)0 daysAlways delete
Cron session .jsonl files7 daysDelete after 7 days
Orphan .jsonl (on disk, not in sessions.json)0 daysDelete
Stale sessions.json entries (cron, file missing)0 daysRemove entry
Non-cron sessions30 daysKeep
Main sessionsForeverNever touched
Active sessions (.lock)ForeverNever touched

Safety

  • Auto-discovers agents by scanning ~/.openclaw/agents/*/sessions/
  • Backs up sessions.json before modifying
  • Never touches locked/active sessions

Run

# All agents
python3 <skill_dir>/scripts/session_cleanup.py

# Preview only
python3 <skill_dir>/scripts/session_cleanup.py --dry-run

# Single agent
python3 <skill_dir>/scripts/session_cleanup.py --agent main

Cron Setup

Set up a single midnight cron that runs both scripts:

Schedule: 0 0 * * * (midnight local time)
Model: any cheap/fast model
Thinking: low
Timeout: 600s
Delivery: none

Cron task message:

Single task only: run memory organizer and session cleanup.

Command 1 (memory):
bash -lc 'python3 <skill_dir>/scripts/memory_organize.py'

Command 2 (sessions):
bash -lc 'python3 <skill_dir>/scripts/session_cleanup.py'

Return ONLY the combined stdout (no extra commentary).

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Huo15 Openclaw Enhance

火一五·克劳德·龙虾增强插件 v5.7.8 — 全面适配 openclaw 2026.4.24:peerDep ^4.24 + build/compat 同步到 4.24 + 14 处 api.on 全部去掉 as any 改成 typed hook(hookName 联合类型 + handler 自动推断 Pl...

Registry SourceRecently Updated
General

Content Trend Analyzer

Aggregates and analyzes content trends across platforms to identify hot topics, user intent, content gaps, and generates data-driven article outlines.

Registry SourceRecently Updated
General

Prompt Debugger

Debug prompts that produce unexpected AI outputs — diagnose failure modes, identify ambiguity and conflicting instructions, test variations, compare model re...

Registry SourceRecently Updated
General

Indie Maker News

独行者 Daily - 变现雷达。读对一条新闻,少走一年弯路。每天5分钟,给创业者装上商业雷达。聚焦一人公司、副业、创业变现资讯,智能分类,行动导向。用户下载即能用,无需本地部署!

Registry SourceRecently Updated