← Back to Skills Marketplace
artwebs

Lite Session Cleaner

by liu hongbin · GitHub ↗ · v1.1.0 · MIT-0
cross-platform ✓ Security Clean
101
Downloads
0
Stars
0
Active Installs
2
Versions
Install in OpenClaw
/install lite-session-cleaner
Description
Automatically cleans up inactive sessions (older than 1 hour) and sends a notification.
README (SKILL.md)

Session Cleaner Skill

This skill is designed to be run via a cron job or periodic task to monitor and prune stale sessions.

Usage

The skill relies on openclaw sessions_list to identify old sessions and openclaw sessions_kill to terminate them. It can be integrated into a TaskFlow or run as a standalone script via exec.

Implementation Logic

  1. Identify: Use sessions_list to retrieve all active sessions.
  2. Filter: Compare the last_activity timestamp of each session with the current time.
  3. Action: For sessions where current_time - last_activity > 3600 seconds:
    • Send a message to the session's target channel (e.g., via message tool) stating: "当前会话已经结束".
    • Execute sessions_kill \x3Csession_id>.
  4. Log: Record the cleaning action in the daily log.

Requirements

  • openclaw CLI installed and accessible.
  • Access to session metadata.
Usage Guidance
This skill appears to do what it says (find and kill sessions older than 1 hour and notify). Before installing: 1) Ensure the openclaw CLI will be available to the agent at runtime (SKILL.md expects exec calls to openclaw). 2) Update the sample script to call the real CLI or API (the provided clean_script.py currently simulates behavior). 3) Change the hard-coded /root path to a configurable workspace path (to avoid requiring root and to match your deployment). 4) Review privacy: the skill saves conversation summaries (message history) to disk — confirm you are comfortable storing that data, secure the directory, and consider retention/rotation. 5) Ensure send_notification and kill_session are implemented with the actual messaging and session APIs rather than simple prints before running as a cron job. If you need these changes and assurances, treat the current package as a template rather than a production-ready skill.
Capability Analysis
Type: OpenClaw Skill Name: lite-session-cleaner Version: 1.1.0 The skill implements a session management utility designed to identify and terminate inactive sessions. The core logic in `clean_script.py` uses mock functions to simulate listing sessions, summarizing their history, and terminating them, while saving summary logs to a local directory. The behavior is entirely consistent with the stated purpose in `SKILL.md` and lacks any indicators of malicious intent, data exfiltration, or unauthorized execution.
Capability Assessment
Purpose & Capability
Name/description (clean inactive sessions, notify) matches the SKILL.md steps (list sessions, kill stale ones, send notification). The included Python simulates the same workflow rather than invoking the openclaw CLI directly — that is plausible for an example script, but it means the repo's code is not actually performing the declared CLI calls. The script also saves session summaries (conversation content) to disk, which is reasonable for logging but not explicitly called out in the high-level description.
Instruction Scope
SKILL.md instructs the agent to use openclaw sessions_list/sessions_kill and to notify channels; it does not request unrelated files, credentials, or external endpoints. The Python file mirrors the logical steps (identify, summarize, notify, kill) but uses simulated functions and prints rather than performing CLI/API calls — scope stays within session management and logging.
Install Mechanism
No install spec is present (instruction-only), which is the lowest-risk pattern. There are no downloads or external install URLs to evaluate.
Credentials
The skill declares no required env vars or credentials, which is consistent with its purpose. However, the Python script writes summaries to a hard-coded path under /root/.openclaw/workspace/skills/..., which may require elevated permissions and may not match actual runtime install locations. The script stores conversation summaries (potentially sensitive data) on disk without access controls or mention of retention/purging.
Persistence & Privilege
always is false and the skill does not request persistent system-wide privileges or modify other skills' configuration. Autonomous invocation is allowed (default) but not combined with any broad, unexplained credentials.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install lite-session-cleaner
  3. After installation, invoke the skill by name or use /lite-session-cleaner
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.1.0
- Added session summary file for an executed cleaning session (summaries/session_2_20260421_220650.json). - Updated clean_script.py with changes to support or log new session summary data.
v1.0.0
Initial release: Automatically cleans up inactive sessions over 1 hour old. - Identifies and terminates sessions inactive for over 1 hour using openclaw commands. - Sends a notification message to affected session channels before terminating. - Logs all cleanup actions for audit purposes. - Designed for use with cron jobs or periodic schedulers.
Metadata
Slug lite-session-cleaner
Version 1.1.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 2
Frequently Asked Questions

What is Lite Session Cleaner?

Automatically cleans up inactive sessions (older than 1 hour) and sends a notification. It is an AI Agent Skill for Claude Code / OpenClaw, with 101 downloads so far.

How do I install Lite Session Cleaner?

Run "/install lite-session-cleaner" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Lite Session Cleaner free?

Yes, Lite Session Cleaner is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Lite Session Cleaner support?

Lite Session Cleaner is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Lite Session Cleaner?

It is built and maintained by liu hongbin (@artwebs); the current version is v1.1.0.

💬 Comments