DEPRECATED - Bobo Session Cleanup

v0.2.1

清理 OpenClaw 会话目录中的孤儿 .jsonl 文件和过期会话。适用于会话列表杂乱、历史会话堆积、需要释放 sessions 存储空间。默认保护 72 小时内会话,删除前必须用户确认。

0· 307·1 current·1 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for irideas/bobo-session-cleanup.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "DEPRECATED - Bobo Session Cleanup" (irideas/bobo-session-cleanup) from ClawHub.
Skill page: https://clawhub.ai/irideas/bobo-session-cleanup
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Canonical install target

openclaw skills install irideas/bobo-session-cleanup

ClawHub CLI

Package manager switcher

npx clawhub@latest install bobo-session-cleanup
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
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.
Assessment
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.

Like a lobster shell, security has layers — review code before you run it.

latestvk975s284pyb84e6yvg99kr8tcs82c551
307downloads
0stars
3versions
Updated 1mo ago
v0.2.1
MIT-0

Session Cleanup

清理 OpenClaw 会话目录中的孤儿文件与过期会话,优先安全、可审计。

使用方式

先扫描,再确认,再执行:

  1. 扫描(只读)
  2. 生成清理计划
  3. 用户确认
  4. 执行清理并回报结果

关键文件

  • 扫描脚本:scripts/scan_sessions.sh
  • 清理策略:references/policy.md

扫描命令(必做)

./skills/session-cleanup/scripts/scan_sessions.sh scan

返回 JSON 包含:

  • orphanFiles:磁盘存在但 sessions.json 未登记的 .jsonl
  • staleSessions:超过 72 小时且非受保护会话
  • protectedSessions:当前会话 + 72 小时保护窗口内会话

执行规则

  • 必须先扫描并展示摘要
  • 必须询问用户确认后才清理
  • 默认不删除受保护会话
  • 永不删除 agent:main:main

清理建议

A. 先处理孤儿文件(优先)

在用户确认后删除孤儿文件:

rm ~/.openclaw/agents/main/sessions/<orphan>.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')"

Comments

Loading comments...