Session Cleanup Skill for Openclaw

A professional-grade cleanup utility for Claw-family agents that tracks and removes temporary files, scripts, and software dependencies generated during active coding sessions.

chaobs
v1.4.0
Apr 17, 2026
0
697
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install super-session-cleanup

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 super-session-cleanup 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 Session Cleanup Skill?

The Session Cleanup skill is an essential tool for developers using Openclaw Skills to maintain a pristine local environment. It provides an automated lifecycle for managing the 'digital exhaust' produced during AI-assisted development, such as transient test scripts, experimental Python packages, and temporary data files. By creating a persistent tracking log, the skill ensures that even if a session is interrupted, all created artifacts can be identified and safely removed later.

This skill is particularly valuable for users of the Claw-family (OpenClaw, WorkBuddy, QClaw) who frequently install temporary libraries or generate demo outputs. It utilizes a sophisticated two-phase approach—Tracking and Cleanup—to offer both automated safety and granular user control over what stays and what goes.

Session Cleanup Skill Use Cases

  • Automatically purging demo scripts, test outputs, and temporary images written to disk during a development session.
  • Uninstalling experimental Python (pip) or Node.js (npm) packages that were only needed for a specific task.
  • Removing transient Openclaw Skills that were initialized for testing purposes.
  • Cleaning up system-level software installed via package managers like Homebrew, Apt, or Winget.
  • Maintaining a clutter-free workspace by identifying and deleting scratch files without manual intervention.

How Session Cleanup Skill Works

  1. Initiation: The user triggers tracking at the start of a session, which creates a persistent session-track.json file in the workspace.
  2. Silent Monitoring: The skill automatically monitors every subsequent tool call (like file writing or command execution) to log created files and installed packages.
  3. Categorization: Detected artifacts are grouped into categories such as temporary files, pip packages, npm packages, system software, and skills.
  4. Review: On demand, the skill generates a Markdown checklist of all tracked items for user review.
  5. Intelligent Deletion: Safe items like temp files are moved to the system trash automatically, while dependencies require explicit user confirmation before uninstallation.
  6. Reset: Once cleanup is complete, the tracking log is deleted, returning the workspace to its original state.

Session Cleanup Skill Setup

To enable this skill within your environment, ensure you have the necessary scripts in your skill directory. You can initialize tracking with a simple command to your agent:

# Trigger via natural language or direct command
"Start session cleanup tracking"

The skill will automatically handle the creation of the tracking manifest at .workbuddy/session-track.json. Ensure your agent has permissions to execute pip, npm, or system package managers if you intend to track software installations.

Session Cleanup Skill Data Schema & Taxonomy

The skill maintains state using a structured JSON schema to ensure reliability across session resets:

Key Description
started_at ISO-8601 timestamp of session start
workspace The absolute path to the active project directory
items A categorized object containing arrays for temp_files, pip_packages, npm_packages, system_software, and skills
skip_list A list of files or packages explicitly marked by the user to be preserved

Session Cleanup Skill Advanced Features

  • Trash-First Safety: Prioritizes moving files to the Recycle Bin or OS Trash (via PowerShell, AppleScript, or GIO) rather than permanent deletion.
  • Batch Processing: Automatically switches to a dedicated Python cleanup script for batches larger than 5 items to maximize efficiency.
  • Smart Filtering: Supports substring matching and a skip_list to protect important files from accidental deletion.
  • Cross-Platform Support: Custom uninstallation logic for Windows (Winget/Choco), macOS (Homebrew), and Linux (Apt).
  • Persistent Logging: The manifest survives token overflows and agent restarts, ensuring no artifact is forgotten in your Openclaw Skills workflow.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*