Introduction

When using agents like OpenClaw, WorkBuddy, and QClaw to run tasks, a single conversation often leaves quite a few “tails” behind: demo scripts, test outputs, files in temporary directories, packages installed via pip install / npm install to validate ideas, and even skills temporarily placed into the skills directory. After the conversation ends, these resources often remain on disk—taking up space and easily mixing with the project’s official code.

Manually digging through chat history to delete files and uninstall dependencies one by one is costly and easy to miss items. The Session Cleanup (SkillHub coordinates @user_573a6bcd/super-session-cleanup, current version 1.4.0) introduced below is an Agent skill based on a generic SKILL.md: during a session it records items that can be cleaned up, and when you say “clean up”, it displays a checklist by rules, processes items by category, and performs deletions or uninstalls. SkillHub categorizes it as ai-agent; it comes from the community (publisher user_573a6bcd), with requires_api_key=false; the page statistics show a rating of 100000, 820 downloads, and 8 installs (subject to what SkillHub displays).

What This Is

Session Cleanup targets lobster-family Agents (OpenClaw, WorkBuddy, QClaw, etc.). The skill author metadata is Chaobs; maintenance and distribution go through the SkillHub community skill @user_573a6bcd/super-session-cleanup.

The core problem it solves is: registering temporary files, installed packages and Skills, and other temporary resources produced during a single session, and safely cleaning them up when needed, instead of relying on manual recall or searching the entire disk afterwards.

Core Features

The skill description divides the workflow into two phases. The following capabilities all come from the official SKILL.md (v1.4.0).

Phase 1: Tracking

After you enable tracking in natural language, the Agent creates a persistent manifest at <workspace>/.workbuddy/session-track.json in the workspace. Its structure includes temp_files, pip_packages, npm_packages, system_software, skills, other, and skip_list. If records left by a previous interrupted run exist, it restores them and continues appending.

Tracking rules cover, for example:

Category Typical detection signals
Temporary files Writes to paths such as %TEMP%, /tmp, session scratch areas, generated-images/, or descriptions containing keywords like temporary/demo/临时/测试
Python packages pip install, pip3 install, uv pip install
npm packages npm install, npx ... --save
System software Installation commands such as winget, choco, apt, brew, scoop, etc.
Skills init_skill.py, use_skill, or writing a new SKILL.md into a skills directory

Once tracking is enabled, the skill requires the Agent to perform a silent verification after each relevant tool call, writing new artifacts into session-track.json, so that token overflow or session resets do not cause the manifest to be lost.

Example trigger phrases for enabling tracking: 开启清理追踪, 启动会话清理, session cleanup start, track session files, 开始记录临时文件, enable cleanup tracking.

Phase 2: Cleanup

When cleanup is triggered, the Agent first reads session-track.json, outputs a Markdown checklist by category (items in skip_list are marked as kept), and then classifies entries into:

  • Class A: temporary files, demo scripts, test outputs, etc., that can be deleted automatically;
  • Class B: pip/npm packages, Skill directories, system-level installations, etc., that require confirmation.

Class A items are deleted one by one when their number is small; when there are many items or the user requests a one-click cleanup, the skill’s own scripts/cleanup.py can be invoked (first with --dry-run, then for the actual run). Paths outside the workspace should preferably go to the recycle bin/trash (with corresponding commands for Windows, macOS, and Linux); temporary directories allow hard deletion. Class B requires the user to choose “delete all / keep all / confirm one by one” before uninstalling.

Example trigger phrases for running cleanup: 清理垃圾文件, 结束清理, 清理对话文件, cleanup now, clean session, 清理临时文件, 会话清理, 帮我清理, 删除临时文件, clean up.

Additional Commands

What the user says Behavior
列出临时文件 / show session log Only display the checklist; do not delete anything
清除记录 / clear log Delete session-track.json; do not delete actual files
手动添加 <path> / add to cleanup <path> Manually add an entry to the tracking list
跳过 <path_or_name> / skip <path_or_name> Write to skip_list; skipped during subsequent cleanup

The skill also ships with scripts/cleanup.py and references/cleanup-guide.md (reference uninstall commands for various package managers and systems). The safety rules emphasize: do not automatically delete workspace source code or configuration, do not delete the .workbuddy/ directory itself (except session-track.json), always warn before deleting a Skill, and do not retry with expanded paths if a deletion fails.

Installation and Enabling

Before installing, confirm that SkillHub CLI is already available on your machine (see the SkillHub installation instructions):

command -v skillhub && skillhub --version

If it is not installed, you can run the officially recommended one-click installation (the full version includes default Skills):

curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash

Install the skill into the skills directory that your Agent actually reads (you must use --dir; otherwise the default ./skills/ may not be recognized). The installation hint on the SkillHub page is: install @user_573a6bcd/super-session-cleanup following skillhub.md. The equivalent command from the CLI search results is:

skillhub install super-session-cleanup --namespace user_573a6bcd --dir <your Agent's skills directory>

Common client skills paths (from the SkillHub installation documentation; choose one according to your environment):

  • Cursor: ~/.cursor/skills/
  • Claude Code: ~/.claude/skills/
  • Codex: ~/.codex/skills/ or .agents/skills/ under the project
  • WorkBuddy: ~/.workbuddy/skills/

After installation, have the Agent reload the skills (the method differs per client; refer to the documentation of the product you are using). This skill does not require an API key.

Typical Usage

Below is a reproducible session-level workflow corresponding to the skill’s lifecycle design.

  1. Enable tracking before starting a long task
    Tell the Agent: 开启清理追踪. The Agent should confirm that tracking is enabled and create or restore .workbuddy/session-track.json in the workspace.

  2. Complete tasks during normal conversation
    The Agent updates the manifest in the background according to the skill rules, e.g., writing demo scripts under /tmp, running pip install requests, or installing a Skill for testing. You can also use 手动添加 /path/to/file to add entries manually.

  3. Check midway
    Say: 列出临时文件 to review what will be cleaned up; for items you want to keep, say: 跳过 demo_script.py.

  4. Clean up at the end or during finalization
    Say: 帮我清理 or cleanup now. The Agent displays a categorized checklist, automatically handles Class A, and after obtaining confirmation for Class B, runs pip uninstall, deletes Skill directories, etc., and finally summarizes and deletes session-track.json.

If there are many temporary files, the Agent may invoke (where <skill_dir> in the paths is the installed skill directory, and <workspace> is the current workspace):

python "<skill_dir>/scripts/cleanup.py" --track-file "<workspace>/.workbuddy/session-track.json" --dry-run
python "<skill_dir>/scripts/cleanup.py" --track-file "<workspace>/.workbuddy/session-track.json"

Suitable Scenarios and Notes

For whom: users who frequently use lobster-family Agents for exploratory development, run one-off scripts, install packages temporarily, or try out Skills, and want to systematically reclaim disk usage after sessions end.

Usage notes:

  • The manifest file by default resides at <workspace>/.workbuddy/session-track.json; when multiple workspaces coexist, pay attention to whether the workspace is consistent.
  • Part of the detection rules in the skill metadata is expressed with WorkBuddy tool names (e.g., write_to_file, execute_command); whether automatic tracking works equally well on other Agents depends on whether the Agent implements the same post-check logic according to SKILL.md.
  • Deleting or uninstalling Class B resources (packages, Skills, system software) is destructive; always read the commands shown by the Agent carefully before confirming.
  • Community skills are maintained by their publishers; before installing, you can check the version and description on SkillHub; the currently verified version is 1.4.0.

Conclusion

Session Cleanup turns “what was produced during the session” and “how to clean up at the end” into a repeatable workflow: first track, then list, then clean up by category, accompanied by cleanup.py and an uninstall reference document. If you run long-term experimental tasks on lobster-family Agents, it is worth installing it into your skills directory and habitually saying “enable cleanup tracking” before starting a task.

  • SkillHub page: https://www.skillhub.cn/skills/user_573a6bcd/super-session-cleanup
  • Official API entry: https://api.skillhub.cn/user_573a6bcd/super-session-cleanup