/install 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/*.mdfor 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 namescontent/— post, blog, marketing, seo, clipsproducts/— copanion, hypercho, feature, ui, roadmaptechnical/— bug, error, config, docs, gatewayx/— twitter, viral, engagement, followersuser/— ziwen, founder, personaldaily/— fallback for everything else
- Adds YAML frontmatter (topic, date, tags) if missing
- Updates
INDEX.mdin each topic folder with the new file - Idempotent — safe to run repeatedly
- No LLM dependency — pure keyword matching
Run
python3 \x3Cskill_dir>/scripts/memory_organize.py
2. Session Cleanup
Cleans session storage across ALL registered agents.
What it cleans
| Target | Retention | Action |
|---|---|---|
Tombstones (.reset.*, .deleted.*, .bak-*) |
0 days | Always delete |
Cron session .jsonl files |
7 days | Delete after 7 days |
Orphan .jsonl (on disk, not in sessions.json) |
0 days | Delete |
| Stale sessions.json entries (cron, file missing) | 0 days | Remove entry |
| Non-cron sessions | 30 days | Keep |
| Main sessions | Forever | Never touched |
Active sessions (.lock) |
Forever | Never touched |
Safety
- Auto-discovers agents by scanning
~/.openclaw/agents/*/sessions/ - Backs up
sessions.jsonbefore modifying - Never touches locked/active sessions
Run
# All agents
python3 \x3Cskill_dir>/scripts/session_cleanup.py
# Preview only
python3 \x3Cskill_dir>/scripts/session_cleanup.py --dry-run
# Single agent
python3 \x3Cskill_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 \x3Cskill_dir>/scripts/memory_organize.py'
Command 2 (sessions):
bash -lc 'python3 \x3Cskill_dir>/scripts/session_cleanup.py'
Return ONLY the combined stdout (no extra commentary).
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install hypercho-openclaw-maintenance - 安装完成后,直接呼叫该 Skill 的名称或使用
/hypercho-openclaw-maintenance触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
OpenClaw Maintenance (Memory + Sessions) 是什么?
Nightly maintenance for OpenClaw — memory organization (sort loose memory files into topic folders with frontmatter and INDEX.md) and session cleanup (purge... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 141 次。
如何安装 OpenClaw Maintenance (Memory + Sessions)?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install hypercho-openclaw-maintenance」即可一键安装,无需额外配置。
OpenClaw Maintenance (Memory + Sessions) 是免费的吗?
是的,OpenClaw Maintenance (Memory + Sessions) 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
OpenClaw Maintenance (Memory + Sessions) 支持哪些平台?
OpenClaw Maintenance (Memory + Sessions) 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 OpenClaw Maintenance (Memory + Sessions)?
由 Duola(@duolahypercho)开发并维护,当前版本 v1.0.0。