← Back to Skills Marketplace
duolahypercho

OpenClaw Maintenance (Memory + Sessions)

by Duola · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
141
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install hypercho-openclaw-maintenance
Description
Nightly maintenance for OpenClaw — memory organization (sort loose memory files into topic folders with frontmatter and INDEX.md) and session cleanup (purge...
README (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).
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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).
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install hypercho-openclaw-maintenance
  3. After installation, invoke the skill by name or use /hypercho-openclaw-maintenance
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Slug hypercho-openclaw-maintenance
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is 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... It is an AI Agent Skill for Claude Code / OpenClaw, with 141 downloads so far.

How do I install OpenClaw Maintenance (Memory + Sessions)?

Run "/install hypercho-openclaw-maintenance" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is OpenClaw Maintenance (Memory + Sessions) free?

Yes, OpenClaw Maintenance (Memory + Sessions) is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does OpenClaw Maintenance (Memory + Sessions) support?

OpenClaw Maintenance (Memory + Sessions) is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created OpenClaw Maintenance (Memory + Sessions)?

It is built and maintained by Duola (@duolahypercho); the current version is v1.0.0.

💬 Comments