← 返回 Skills 市场
Lite Session Cleaner
作者
liu hongbin
· GitHub ↗
· v1.1.0
· MIT-0
101
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install lite-session-cleaner
功能描述
Automatically cleans up inactive sessions (older than 1 hour) and sends a notification.
使用说明 (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
- Identify: Use
sessions_listto retrieve all active sessions. - Filter: Compare the
last_activitytimestamp of each session with the current time. - Action: For sessions where
current_time - last_activity > 3600seconds:- Send a message to the session's target channel (e.g., via
messagetool) stating: "当前会话已经结束". - Execute
sessions_kill \x3Csession_id>.
- Send a message to the session's target channel (e.g., via
- Log: Record the cleaning action in the daily log.
Requirements
openclawCLI installed and accessible.- Access to session metadata.
安全使用建议
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.
功能分析
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.
能力评估
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.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install lite-session-cleaner - 安装完成后,直接呼叫该 Skill 的名称或使用
/lite-session-cleaner触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
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.
元数据
常见问题
Lite Session Cleaner 是什么?
Automatically cleans up inactive sessions (older than 1 hour) and sends a notification. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 101 次。
如何安装 Lite Session Cleaner?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install lite-session-cleaner」即可一键安装,无需额外配置。
Lite Session Cleaner 是免费的吗?
是的,Lite Session Cleaner 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Lite Session Cleaner 支持哪些平台?
Lite Session Cleaner 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Lite Session Cleaner?
由 liu hongbin(@artwebs)开发并维护,当前版本 v1.1.0。
推荐 Skills