首页龙虾技能列表 › Session Cleaner — 技能工具

Session Cleaner — 技能工具

v1.0.0

[自动翻译] Clean up stale OpenClaw session files. Keep the current main session and all group chat sessions; move everything else to a backup directory. Use when...

0· 316·4 当前·4 累计
by @guoqunabc (Madoka)·MIT-0
下载技能包
License
MIT-0
最后更新
2026/3/11
安全扫描
VirusTotal
无害
查看报告
OpenClaw
安全
high confidence
The skill is internally consistent: it only moves stale session files from the user's OpenClaw sessions directory into a local backup subdirectory and does not request credentials, network access, or unusual system privileges.
评估建议
This script appears to do exactly what it claims, but review and take these precautions before running: 1) Run with --dry-run first to see which files would be moved. 2) Inspect a few session .jsonl files to confirm the grep patterns ("sessionKey" and "to") match your expected session formats. 3) Ensure you run it as the intended user (don’t run as root if you only mean to clean your personal sessions) because $HOME determines the target directory. 4) Be aware the script relies on standard utili...
详细分析 ▾
用途与能力
Name/description match the behavior. The script operates only on ~/.openclaw/agents/main/sessions and implements the stated keep/move rules (keep current main and group sessions, move others to sessions/backup). No unexpected credentials, binaries, or unrelated resources are required.
指令范围
SKILL.md instructs the agent to run the included shell script (optionally with --dry-run). The script only reads session files in the specified sessions directory and inspects them for sessionKey/to fields to decide retention; it does not call external network endpoints, read unrelated system files, or reference environment variables beyond $HOME. Behavior is narrow and in-scope.
安装机制
No install spec — instruction-only with a bundled script. Nothing is downloaded or written to system locations outside the user's sessions directory. Low install risk.
凭证需求
No required environment variables, no credentials, and no config paths beyond the documented ~/.openclaw path. The script uses standard POSIX utilities (grep, stat, mv, mkdir, ls, numfmt) which are reasonable for the task.
持久化与权限
always:false and no mechanism to modify other skills or global agent settings. The script only modifies files under the user's sessions directory (moves to a local backup), so requested persistence/privileges are proportional to the described purpose.
安全有层次,运行前请审查代码。

License

MIT-0

可自由使用、修改和再分发,无需署名。

运行时依赖

无特殊依赖

版本

latestv1.0.02026/3/11

Initial release: clean up stale OpenClaw session files

● 无害

安装命令 点击复制

官方npx clawhub@latest install session-cleaner
镜像加速npx clawhub@latest install session-cleaner --registry https://cn.clawhub-mirror.com

技能文档

Clean stale session transcript files from ~/.openclaw/agents/main/sessions/.

Rules

  • Always keep: current main session (the one with agent:main:main key that is active)
  • Always keep: all group chat sessions (target address contains oc_)
  • Move to backup: everything else (old main sessions, completed sub-agents, API sessions, cron/heartbeat transcripts)
  • Never delete: all moved files go to sessions/backup/, recoverable

Usage

bash scripts/clean-sessions.sh [--dry-run]
  • Default: move stale files to backup
  • --dry-run: only report what would be moved, no changes
数据来源:ClawHub ↗ · 中文优化:龙虾技能库
OpenClaw 技能定制 / 插件定制 / 私有工作流定制

免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制

了解定制服务