← Back to Skills Marketplace
83
Downloads
0
Stars
0
Active Installs
3
Versions
Install in OpenClaw
/install c3po-session-cleaner
Description
Clean up old OpenClaw session files and keep only active sessions
README (SKILL.md)
\r \r
Clean OpenClaw Sessions\r
\r This skill will safely delete old session files (.jsonl) older than 3 days\r in the OpenClaw main agent session directory.\r \r
cd /home/ubuntu/.openclaw/agents/main/sessions/\r
find . -name "*.jsonl" -type f -mtime +3 -delete 2>/dev/null\r
\r
echo "====================================="\r
echo "✅ Clean completed successfully"\r
echo "Remaining session files: $(ls -l *.jsonl 2>/dev/null | wc -l)"\r
echo "====================================="
Usage Guidance
This skill will run shell commands that delete files. Don't install or enable it unless you trust the exact path and want automatic deletions. If you proceed, request a safer SKILL.md: check the directory exists first (test -d), use an absolute path with find (e.g., find /home/ubuntu/.openclaw/agents/main/sessions -maxdepth 1 -name "*.jsonl" -mtime +3 -print), perform a dry-run (-print) before -delete, avoid suppressing errors, and avoid relying on cd so a failed cd can't cause deletions elsewhere. Also consider requiring an explicit confirmation or making autonomous invocation disallowed until reviewed.
Capability Assessment
Purpose & Capability
The name/description match the SKILL.md: it deletes .jsonl session files older than 3 days in the OpenClaw main agent session directory. The request is proportionate (no extra credentials or unrelated binaries). The instructions hard-code /home/ubuntu/.openclaw..., which makes the skill specific to that user/path and may not work correctly on other systems.
Instruction Scope
The instructions run destructive shell commands (cd to the path, then find . -name "*.jsonl" -mtime +3 -delete) with errors suppressed. There are no existence checks, no dry-run, and no safeguards: if the cd fails or the target directory is a symlink, the find -delete could run in an unexpected working directory and remove files outside the intended scope. Suppressing stderr (2>/dev/null) hides failures that would warn the user.
Install Mechanism
Instruction-only skill with no install spec or code files — lowest install risk. The only runtime action is executing Bash commands from SKILL.md.
Credentials
The skill requests no environment variables, credentials, or config paths — nothing disproportionate for the stated task.
Persistence & Privilege
The skill is not always-enabled and is user-invocable. Autonomous invocation is allowed by default; because the skill performs destructive filesystem operations, allowing autonomous runs increases potential impact and warrants extra safeguards (confirmation, dry-run).
How to Use
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install c3po-session-cleaner - After installation, invoke the skill by name or use
/c3po-session-cleaner - Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.5
- Updated description to clarify that only active session files are kept.
- Added a trigger field: clean sessions.
- Now only old .jsonl session files (>3 days) are deleted; rebuilding sessions.json has been removed.
- Simplified completion message to show only remaining session files.
- Version number updated to 1.0.5.
v1.0.4
- Updated rebuild method to safely reconstruct sessions.json using jq, instead of relying on CLI command.
- Improved descriptions for clarity and emphasized safe cleaning.
- Version format changed from 1.0.3 to 1.03.
- Enhanced output messages for completion and status.
v1.0.3
- Cleans OpenClaw session files older than 3 days automatically.
- Rebuilds the sessions.json index after cleanup.
- Provides a summary including the number of remaining session files and the size of sessions.json.
- Runs entirely using Bash commands for simplicity.
Metadata
Frequently Asked Questions
What is c3po-session-cleaner?
Clean up old OpenClaw session files and keep only active sessions. It is an AI Agent Skill for Claude Code / OpenClaw, with 83 downloads so far.
How do I install c3po-session-cleaner?
Run "/install c3po-session-cleaner" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is c3po-session-cleaner free?
Yes, c3po-session-cleaner is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does c3po-session-cleaner support?
c3po-session-cleaner is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created c3po-session-cleaner?
It is built and maintained by c-3po (@ccc-3po); the current version is v1.0.5.
More Skills