← Back to Skills Marketplace
316
Downloads
0
Stars
1
Active Installs
3
Versions
Install in OpenClaw
/install bobo-session-cleanup
Description
清理 OpenClaw 会话目录中的孤儿 .jsonl 文件和过期会话。适用于会话列表杂乱、历史会话堆积、需要释放 sessions 存储空间。默认保护 72 小时内会话,删除前必须用户确认。
README (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')"
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install bobo-session-cleanup - After installation, invoke the skill by name or use
/bobo-session-cleanup - Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Frequently Asked Questions
What is DEPRECATED - Bobo Session Cleanup?
清理 OpenClaw 会话目录中的孤儿 .jsonl 文件和过期会话。适用于会话列表杂乱、历史会话堆积、需要释放 sessions 存储空间。默认保护 72 小时内会话,删除前必须用户确认。 It is an AI Agent Skill for Claude Code / OpenClaw, with 316 downloads so far.
How do I install DEPRECATED - Bobo Session Cleanup?
Run "/install bobo-session-cleanup" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is DEPRECATED - Bobo Session Cleanup free?
Yes, DEPRECATED - Bobo Session Cleanup is completely free (open-source). You can download, install and use it at no cost.
Which platforms does DEPRECATED - Bobo Session Cleanup support?
DEPRECATED - Bobo Session Cleanup is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created DEPRECATED - Bobo Session Cleanup?
It is built and maintained by irideas (@irideas); the current version is v0.2.1.
More Skills