AI Agent Hub
Back to skills
WorkBuddy Deleted Task Local Trace Cleanup icon

WorkBuddy Deleted Task Local Trace Cleanup

Development Updated 2026.08.29

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

Please follow https://skillhub.cn/install/skillhub.md and install @user_9e42ec7a/workbuddy-cleanup-traces.

About this skill

Problem

Soft-deleting a WorkBuddy task or conversation usually only sets sessions.deleted_at in workbuddy.db; the UI hides the entry, but local files can remain on disk. These leftovers include the workspace folder under ~/WorkBuddy/<session>/, conversation records under ~/.workbuddy/projects/<path>/, runtime files such as ~/.workbuddy/sessions/<id>.json, trace directories under ~/.workbuddy/traces/<id>/, and artifact indexes under ~/.workbuddy/artifact-index/<id>.json. Cleaning these manually can miss items or accidentally touch a workspace that is still referenced by a live session.

How It Works

The skill packages the cleanup workflow into a dry-run first Python script. It matches deleted sessions by session ID and lists each category of residue, including whether it is safe to clean. If a workspace folder is shared with an existing session, the script skips the folder and the matching projects/ record, while still allowing cleanup of session-scoped files. Only after user confirmation does it run with --apply, moving targets into a recoverable _cleanup_trash/ backup directory instead of deleting them outright.

Key constraints:
- It does not modify workbuddy.db and does not edit app/sessions.json
- Protected workspaces can be persisted in protected_workspaces.json
- The script uses only the Python standard library and is safe to rerun
- Targets already moved into the backup are skipped on subsequent runs

Scope And Caveats

This is useful for removing local file traces left behind after WorkBuddy soft-deletes a task or conversation. It is not a database-level deletion feature and cannot replace a native product switch if WorkBuddy lacks one. Users should preview first, confirm the plan, and then let the script move items to backup. It is especially important to be careful when the database is locked, files are in use, or Windows path translation behaves unexpectedly in shell environments.

Use Cases

  • After deleting WorkBuddy tasks, locate and move workspace, projects, sessions, traces, and artifact-index leftovers still taking disk space.
  • Before cleanup, preview which deleted-session traces can be moved and which shared workspaces are skipped because live sessions still use them.
  • When maintaining local files, move deleted WorkBuddy session residue into _cleanup_trash for recovery or later manual deletion.
  • While auditing residue, match session IDs across traces, artifact indexes, and session files to avoid touching same-named paths.

Best For

  • WorkBuddy conversation managers who delete tasks and want to reclaim local workspace residue without manual hunting.
  • Local environment maintainers who protect ~/.workbuddy directories and avoid deleting shared workspaces still in use.
  • Non-technical product users who need preview, confirmation, and recoverable cleanup after removing WorkBuddy sessions.
  • Script maintainers auditing traces, artifact-index, and session files by session ID to match residue precisely.