← Back to Skills Marketplace
394
Downloads
0
Stars
4
Active Installs
1
Versions
Install in OpenClaw
/install session-cleaner
Description
Clean up stale OpenClaw session files. Keep the current main session and all group chat sessions; move everything else to a backup directory. Use when perfor...
Usage Guidance
This script appears to do exactly what it claims, but review and take these precautions before running: 1) Run with --dry-run first to see which files would be moved. 2) Inspect a few session .jsonl files to confirm the grep patterns ("sessionKey" and "to") match your expected session formats. 3) Ensure you run it as the intended user (don’t run as root if you only mean to clean your personal sessions) because $HOME determines the target directory. 4) Be aware the script relies on standard utilities (numfmt, stat variants); on minimal systems some utilities may be missing. 5) Because moved files are placed under sessions/backup, they are recoverable, but verify backup location matches your retention policy. If any of these points are concerning, do not install or run until you’ve validated them.
Capability Analysis
Type: OpenClaw Skill
Name: session-cleaner
Version: 1.0.0
The session-cleaner skill is a maintenance utility designed to manage OpenClaw session transcripts. The bash script (scripts/clean-sessions.sh) identifies and preserves active main and group chat sessions while moving older or secondary session files to a local backup directory (~/.openclaw/agents/main/sessions/backup). The logic is transparent, lacks network activity or data exfiltration, and provides a dry-run mode for safety.
Capability Assessment
Purpose & Capability
Name/description match the behavior. The script operates only on ~/.openclaw/agents/main/sessions and implements the stated keep/move rules (keep current main and group sessions, move others to sessions/backup). No unexpected credentials, binaries, or unrelated resources are required.
Instruction Scope
SKILL.md instructs the agent to run the included shell script (optionally with --dry-run). The script only reads session files in the specified sessions directory and inspects them for sessionKey/to fields to decide retention; it does not call external network endpoints, read unrelated system files, or reference environment variables beyond $HOME. Behavior is narrow and in-scope.
Install Mechanism
No install spec — instruction-only with a bundled script. Nothing is downloaded or written to system locations outside the user's sessions directory. Low install risk.
Credentials
No required environment variables, no credentials, and no config paths beyond the documented ~/.openclaw path. The script uses standard POSIX utilities (grep, stat, mv, mkdir, ls, numfmt) which are reasonable for the task.
Persistence & Privilege
always:false and no mechanism to modify other skills or global agent settings. The script only modifies files under the user's sessions directory (moves to a local backup), so requested persistence/privileges are proportional to the described purpose.
How to Use
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install session-cleaner - After installation, invoke the skill by name or use
/session-cleaner - Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release: clean up stale OpenClaw session files
Metadata
Frequently Asked Questions
What is Session Cleaner?
Clean up stale OpenClaw session files. Keep the current main session and all group chat sessions; move everything else to a backup directory. Use when perfor... It is an AI Agent Skill for Claude Code / OpenClaw, with 394 downloads so far.
How do I install Session Cleaner?
Run "/install session-cleaner" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Session Cleaner free?
Yes, Session Cleaner is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Session Cleaner support?
Session Cleaner is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Session Cleaner?
It is built and maintained by Madoka (@guoqunabc); the current version is v1.0.0.
More Skills