AI Agent Hub
Back to skills
WorkBuddy Deleted Session Cleanup icon

WorkBuddy Deleted Session Cleanup

IT Ops & Security Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Follow https://skillhub.cn/install/skillhub.md to install @user_3f399cbf/cleanup-stale-workspaces.

About this skill

Problem

After a WorkBuddy session is deleted, local leftovers can still include chat records, tool results, artifact indexes, file history, task data, and expired auto-workspace folders. Bulk deletion may damage active sessions, manual folders, or shared caches, while ignoring them lets local disk usage grow.

How It Works

The skill runs scripts/detect.py for a read-only scan first, reporting items to remove, protected paths, orphan records, and cache status. Key rules:
- Scan scope: it only targets disks containing automatic sessions and filters by YYYY-MM-DD-HH-MM-SS timestamp folders, avoiding cross-disk surprises.
- Session leftovers: it matches session UUIDs whose deleted_at is non-null and cleans UUID-named data under projects/, artifact-index/, file-history/, and tasks/.
- Safety boundaries: active sessions, purely manual workspaces, and shared stores are protected; multi-session data such as blobs/ is not reclaimed per session.
- Reversible flow: execution starts with a dry-run; removals are moved to cleanup-trash before --empty-trash --yes is used to empty the trash.

It suits local WorkBuddy residue, stale workspaces, clipboard image caches, and log or trace caches. It is not a cross-device backup tool and does not replace formal data archival.

Use Cases

  • After deleting many WorkBuddy sessions, identify and recover session-UUID artifacts such as chats, indexes, and tasks.
  • Clean timestamped auto-workspace folders on one disk while preserving manual folders and active sessions.
  • Reclaim clipboard screenshot, log, and trace caches into a recoverable trash directory before final deletion.
  • Avoid deleting active workspaces by checking deleted_at, timestamp rules, and workspace whitelists.

Best For

  • WorkBuddy local users who need to remove stale session artifacts without touching manual folders.
  • AI-assisted engineers with many tool outputs and file-history items that need UUID-based reclamation.
  • IT operators managing local disk space who want dry-run confirmation and recoverable cleanup.
  • Skill maintainers who want to update detection rules against the spec and validate with tests.