OpenClaw Session Cleaner for Openclaw

A maintenance utility designed to safely delete aged session logs and rebuild the session index for OpenClaw agents on Ubuntu ARM.

ccc-3po
v1.0.2
Apr 5, 2026
0
652
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install ccc3po-session-cleaner

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install ccc3po-session-cleaner using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is OpenClaw Session Cleaner?

The OpenClaw Session Cleaner is an essential maintenance tool for developers and system administrators managing long-running AI agents. It addresses the common issue of storage bloat by identifying and removing .jsonl session files that are older than three days. By automating this cleanup process, the skill ensures that your Openclaw Skills deployment remains responsive and your storage usage stays within manageable limits.

Beyond simple file deletion, this skill provides a structural refresh for your agent's data layer. It triggers a rebuild of the central session index, ensuring that the metadata remains perfectly synchronized with the physical files on disk. This is particularly valuable for users running Openclaw Skills on resource-constrained environments like Ubuntu ARM instances.

OpenClaw Session Cleaner Use Cases

  • Managing disk space on cloud servers or ARM-based devices hosting persistent AI agents.
  • Automating routine database maintenance to prevent slow session loading times.
  • Cleaning up temporary session data while retaining the most recent interactions.
  • Troubleshooting session indexing issues within your Openclaw Skills environment.

How OpenClaw Session Cleaner Works

  1. Scans the default session directory located at /home/ubuntu/.openclaw/agents/main/sessions/ to assess current storage usage.
  2. Logs the initial file count and the size of the sessions.json index for transparency.
  3. Executes a safe find-and-delete operation on all session log files (.jsonl) with a modification time older than three days.
  4. Invokes the openclaw session rebuild command to regenerate the session index and ensure data integrity.
  5. Returns a summary report detailing the total number of files removed and the new, optimized size of the index.

OpenClaw Session Cleaner Setup

To use this skill, ensure you are running an OpenClaw instance on an Ubuntu ARM environment with the default directory structure. No additional dependencies are required as it utilizes native Bash commands and the OpenClaw CLI.

# Trigger the automated cleanup
clean sessions

OpenClaw Session Cleaner Data Schema & Taxonomy

File/Directory Path Purpose
~/.openclaw/agents/main/sessions/ The root directory where all agent session data is stored.
*.jsonl Individual transaction logs for specific agent sessions.
sessions.json The central index file used by Openclaw Skills to track and retrieve session history.

OpenClaw Session Cleaner Advanced Features

  • Time-based pruning (mtime +3) to ensure only stagnant data is removed while keeping recent history.
  • Native OpenClaw CLI integration for safe index rebuilding.
  • Real-time disk usage auditing before and after the cleanup process.
  • Optimized for Ubuntu ARM architectures, making it ideal for edge-computing Openclaw Skills.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*