← 返回 Skills 市场
316
总下载
0
收藏
1
当前安装
3
版本数
在 OpenClaw 中安装
/install bobo-session-cleanup
功能描述
清理 OpenClaw 会话目录中的孤儿 .jsonl 文件和过期会话。适用于会话列表杂乱、历史会话堆积、需要释放 sessions 存储空间。默认保护 72 小时内会话,删除前必须用户确认。
使用说明 (SKILL.md)
Session Cleanup
清理 OpenClaw 会话目录中的孤儿文件与过期会话,优先安全、可审计。
使用方式
先扫描,再确认,再执行:
- 扫描(只读)
- 生成清理计划
- 用户确认
- 执行清理并回报结果
关键文件
- 扫描脚本:
scripts/scan_sessions.sh - 清理策略:
references/policy.md
扫描命令(必做)
./skills/session-cleanup/scripts/scan_sessions.sh scan
返回 JSON 包含:
orphanFiles:磁盘存在但sessions.json未登记的.jsonlstaleSessions:超过 72 小时且非受保护会话protectedSessions:当前会话 + 72 小时保护窗口内会话
执行规则
- 必须先扫描并展示摘要
- 必须询问用户确认后才清理
- 默认不删除受保护会话
- 永不删除
agent:main:main
清理建议
A. 先处理孤儿文件(优先)
在用户确认后删除孤儿文件:
rm ~/.openclaw/agents/main/sessions/\x3Corphan>.jsonl
B. 再处理过期会话(谨慎)
仅在用户明确确认后执行,删除对应 .jsonl,并更新 sessions.json 去除条目。
输出模板
🧹 会话清理扫描完成
- 注册会话:X
- 磁盘 jsonl:Y
- 孤儿文件:A
- 过期会话:B
- 受保护会话:C
预计可释放:N MB
是否按上述计划执行清理?
发布前自检
# 1) 脚本可执行
./skills/session-cleanup/scripts/scan_sessions.sh scan >/tmp/session-cleanup-report.json
# 2) 输出为有效 JSON
node -e "JSON.parse(require('fs').readFileSync('/tmp/session-cleanup-report.json','utf8')); console.log('OK')"
安全使用建议
This skill appears to do what it claims: scan OpenClaw session directories and help you delete orphan or stale .jsonl files. Before running any destructive steps: 1) Run the scan as instructed and inspect the JSON report; 2) Back up the sessions directory (or move files instead of rm) in case of mistakes; 3) Note that the script uses node and bash — install them if missing; 4) The SKILL.md shows rm commands that will delete files under ~/.openclaw by default — prefer moving/archiving and double-check paths or set OPENCLAW_STATE_DIR / OPENCLAW_AGENT_ID if your state is elsewhere; 5) This skill is deprecated — consider migrating to session-cleanup-pro per the README.
功能分析
Type: OpenClaw Skill
Name: bobo-session-cleanup
Version: 0.2.1
The skill is a legitimate utility designed to manage and clean up OpenClaw session files by identifying orphaned '.jsonl' files and stale sessions older than 72 hours. The core logic in 'scripts/scan_sessions.sh' is transparent, using Node.js to safely parse local session metadata without any network activity or data exfiltration. The 'SKILL.md' and 'references/policy.md' files establish a safe operational workflow that mandates a read-only scan and explicit user confirmation before any file deletion occurs.
能力评估
Purpose & Capability
Name/description match the provided files: a scanner script and policy for cleaning session .jsonl files under the OpenClaw state directory. No unrelated credentials, network hosts, or extra binaries are required by the code.
Instruction Scope
SKILL.md prescribes a safe workflow (scan → show report → ask user → apply). It includes example rm commands for deleting orphan .jsonl files — expected for a cleanup tool but inherently destructive. The script itself (scan mode) is read-only and only prints a JSON report; deletions are manual per the instructions. Ensure user confirmation and backups before applying deletions.
Install Mechanism
No install spec (instruction-only plus a script). No downloads or archive extraction; the only runtime requirement is that node and bash are available for the included script to run.
Credentials
The script optionally reads OPENCLAW_STATE_DIR and OPENCLAW_AGENT_ID (defaults to $HOME/.openclaw and 'main') — appropriate for locating local session files. No secrets or external credentials are requested. Minor inconsistency: SKILL.md metadata lists required bins (bash, node) but the registry metadata shows no required binaries.
Persistence & Privilege
always is false and the skill does not request persistent/privileged system presence. It does not modify other skills or system-wide settings.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install bobo-session-cleanup - 安装完成后,直接呼叫该 Skill 的名称或使用
/bobo-session-cleanup触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.2.1
Deprecated: please migrate to session-cleanup-pro. This slug is kept for backward compatibility only.
v0.2.0
升级为 0.2:新增确定性扫描脚本、策略文档,强化 72 小时保护与确认流程,增加 metadata.version/updatedAt。
v0.1.0
Initial release: deterministic session scan, 72h protection, explicit confirm-before-delete, and policy reference.
元数据
常见问题
DEPRECATED - Bobo Session Cleanup 是什么?
清理 OpenClaw 会话目录中的孤儿 .jsonl 文件和过期会话。适用于会话列表杂乱、历史会话堆积、需要释放 sessions 存储空间。默认保护 72 小时内会话,删除前必须用户确认。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 316 次。
如何安装 DEPRECATED - Bobo Session Cleanup?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install bobo-session-cleanup」即可一键安装,无需额外配置。
DEPRECATED - Bobo Session Cleanup 是免费的吗?
是的,DEPRECATED - Bobo Session Cleanup 完全免费(开源免费),可自由下载、安装和使用。
DEPRECATED - Bobo Session Cleanup 支持哪些平台?
DEPRECATED - Bobo Session Cleanup 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 DEPRECATED - Bobo Session Cleanup?
由 irideas(@irideas)开发并维护,当前版本 v0.2.1。
推荐 Skills