← 返回 Skills 市场
duolahypercho

OpenClaw Maintenance (Memory + Sessions)

作者 Duola · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
141
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install hypercho-openclaw-maintenance
功能描述
Nightly maintenance for OpenClaw — memory organization (sort loose memory files into topic folders with frontmatter and INDEX.md) and session cleanup (purge...
使用说明 (SKILL.md)

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 \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.json before 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).
安全使用建议
This package appears to do exactly what it claims: tidy .md memories and prune session files under ~/.openclaw. Before enabling a nightly cron or running for real: 1) run session_cleanup.py --dry-run to preview changes; 2) inspect the scripts (they're included) to confirm behavior and retention windows; 3) back up ~/.openclaw/agents/*/sessions/sessions.json (the script already writes a .json.bak but double-check); 4) be cautious about pasting the 'Full Self-Contained Prompt' into any agent — that prompt instructs an agent to write and run scripts and create cron jobs and should only be used if you trust the agent and have reviewed the code. If you want extra safety, run the scripts under a user account with limited data or test on a copy of your workspace first.
功能分析
Type: OpenClaw Skill Name: hypercho-openclaw-maintenance Version: 1.0.0 The skill bundle provides legitimate maintenance utilities for the OpenClaw environment. The scripts `memory_organize.py` and `session_cleanup.py` are designed to organize markdown files into topic-based subfolders and purge old or orphaned session data within the `~/.openclaw` directory. The logic is deterministic, well-documented, and lacks any indicators of data exfiltration, unauthorized remote execution, or malicious intent. While `session_cleanup.py` performs file deletions, it does so according to clear retention policies and includes safety features like dry-run support and file backups.
能力评估
Purpose & Capability
Name/description match the included scripts. All file operations are confined to ~/.openclaw (workspace and agents). No unrelated binaries, network endpoints, or credentials are required.
Instruction Scope
SKILL.md and the two Python scripts stay within the maintenance scope (move .md files, add frontmatter, update INDEX.md, and remove tombstones/orphan/old session files). One notable addition: references/setup-prompt.md contains a 'Full Self-Contained Prompt' that tells an agent to write the scripts to disk, run them, and create a cron job — if pasted into an agent, that gives the agent the ability to create/modify files and set up cron without installing the packaged scripts. Recommend reviewing scripts and using --dry-run before executing.
Install Mechanism
No install spec (instruction-only). The skill includes the scripts in the package; nothing is downloaded from external URLs or installed automatically.
Credentials
No environment variables, credentials, or config paths are requested. The scripts operate on standard per-user OpenClaw directories under the home directory.
Persistence & Privilege
always:false and normal autonomous invocation. The skill does not request persistent elevated privileges or modify other skills' configs. Cron setup is explicit and requires user action (or the 'self-contained prompt' if run by an agent).
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install hypercho-openclaw-maintenance
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /hypercho-openclaw-maintenance 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: nightly memory organization (sort files into topic folders with frontmatter/INDEX) + session cleanup (purge tombstones, old crons, orphans across all agents). Includes setup prompts for users with and without ClawHub.
元数据
Slug hypercho-openclaw-maintenance
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

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。

💬 留言讨论