← 返回 Skills 市场
Session Cleanup
作者
xaiohuangningde
· GitHub ↗
· v1.0.0
594
总下载
0
收藏
7
当前安装
1
版本数
在 OpenClaw 中安装
/install session-cleanup
功能描述
定期清理过期会话,评估并保存有价值信息,自动清理无价值会话。
安全使用建议
Do not install or schedule this skill as-is. The implementation and docs disagree: the README promises evaluating and saving valuable sessions but the shipped script simply removes files (and targets /root/.openclaw). Before using consider: 1) fix the WORKSPACE to use the appropriate user home (e.g., $HOME/.openclaw) or accept a directory argument; 2) implement or remove the promised 'value evaluation and saving' step if you expect retention; 3) add a dry-run mode, whitelist/blacklist, and explicit confirmation before deletion; 4) log and save backups of deleted files (or move to a quarantine folder) to avoid permanent loss; 5) test as a non-root user on a sample dataset; 6) review and correct the cron installation approach rather than blindly adding a weekly root cron. If you cannot verify these changes, consider the skill unsafe because it can delete important session data unexpectedly.
功能分析
Type: OpenClaw Skill
Name: session-cleanup
Version: 1.0.0
The skill bundle is classified as suspicious due to the `cleanup.sh` script performing `rm -f` operations on files within the OpenClaw workspace, which is hardcoded to `/root/.openclaw`. While the script's purpose is legitimate file cleanup, running such a script with implied root privileges (operating in `/root`) introduces a risk of arbitrary file deletion via symlink attacks if an attacker could place a malicious symlink in one of the targeted directories. This represents a risky capability without clear malicious intent.
能力评估
Purpose & Capability
SKILL.md claims the skill will 'evaluate session value and save important information' (关键词评估并保存到记忆). The shipped cleanup.sh performs only time-based deletions (rm) under a hard-coded WORKSPACE (/root/.openclaw) and does not implement any keyword matching, evaluation, or saving. Also SKILL.md references ~/.openclaw paths and a run.sh for cron, while the script uses /root/.openclaw — this mismatch indicates the implementation does not match the stated purpose.
Instruction Scope
The runtime script deletes files from multiple application directories (cron runs, delivery-queue, telegram, subagents, memory temp files, backups) using find + rm without content inspection or backups. It operates on /root/.openclaw (not the user's home as SKILL.md implies). There are no safeguards (dry-run, whitelist, confirmation) and no implementation of the 'save valuable sessions' step; this is scope creep toward destructive cleanup without the promised data preservation.
Install Mechanism
No install spec is provided (instruction-only with an included script). That minimizes install-time risk since nothing is downloaded or extracted, but the presence of an executable cleanup.sh means the script will run on the host when invoked or scheduled.
Credentials
The skill declares no required environment variables or credentials, yet cleanup.sh uses a fixed /root/.openclaw path. This hard-coded root path implicitly assumes elevated privileges or a root user environment and is disproportionate to the stated task (which described operating on the user's ~/.openclaw). No justification is provided for operating as root or for deleting across multiple data directories.
Persistence & Privilege
always is false (good). skill.json includes a cron field (0 3 * * 0) and the SKILL.md advises adding a cron job; if installed as-is and scheduled with root privileges this script will run weekly and perform deletions automatically. The skill does not modify other skills' configs but its action is destructive and could run autonomously if scheduled.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install session-cleanup - 安装完成后,直接呼叫该 Skill 的名称或使用
/session-cleanup触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of session-cleanup skill.
- Periodically scans session directories, detects expired sessions, and evaluates their value.
- Saves valuable sessions based on keyword matching; automatically deletes sessions deemed irrelevant.
- Supports multiple session sources: cron runs, delivery queue, Telegram, and subagents, each with customized expiration rules.
- Generates a cleanup report after each run.
- Can be run manually or scheduled weekly with cron.
元数据
常见问题
Session Cleanup 是什么?
定期清理过期会话,评估并保存有价值信息,自动清理无价值会话。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 594 次。
如何安装 Session Cleanup?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install session-cleanup」即可一键安装,无需额外配置。
Session Cleanup 是免费的吗?
是的,Session Cleanup 完全免费(开源免费),可自由下载、安装和使用。
Session Cleanup 支持哪些平台?
Session Cleanup 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Session Cleanup?
由 xaiohuangningde(@xaiohuangningde)开发并维护,当前版本 v1.0.0。
推荐 Skills