/storage-retention
Inspect machine storage, clean up files, and configure automatic thread archive or deletion.
Claude Code
$ npx -y skills add get-bb/bb --skill storage-retention --agent claude-code
Codex
$ npx skills add get-bb/bb --skill storage-retention -a codex -y
Cursor
$ npx skills add get-bb/bb --skill storage-retention -a cursor -y
Gemini CLI
$ npx skills add get-bb/bb --skill storage-retention -a gemini-cli -y
GitHub Copilot
$ npx skills add get-bb/bb --skill storage-retention -a github-copilot -y
OpenCode
$ npx skills add get-bb/bb --skill storage-retention -a opencode -y
Windsurf
$ npx skills add get-bb/bb --skill storage-retention -a windsurf -y
SKILL.md
storage-retention.SKILL.mdname: storage-retention
description: Inspect machine storage, clean up files, and configure automatic thread archive or deletion.
Storage & retention
Enable `bb plugin enable bb--storage-retention`. Both policies default to Never. Open the plugin's sidebar panel for machine reports and retention settings. All settings in the panel save immediately when changed. All commands return JSON. Use the owning server's normal SDK/plugin RPC transport.
bb storage retention
bb storage retention --archive-after 30 --delete-after 90
bb storage retention --archive-after 30 --delete-after 90 --save --yes
bb storage retention --archive-after never --delete-after never --save --yes
bb storage retention --delete-storage-on-archive true --save --yes
bb storage retention --delete-storage-on-archive false --save --yes
bb storage retention --delete-dev-data-on-checkout-removal true --save --yes
bb storage usage
bb storage usage --rescan
bb storage usage --machine HOST_ID --rescan
bb storage usage --machine HOST_ID
bb storage remove-orphans --machine HOST_ID --yes
bb storage clear-large-files --yes
bb storage clear-large-files --machine HOST_ID --yes
bb storage retry-worktree-cleanup --machine HOST_ID
bb storage clear-thread --thread THREAD_ID --yes
bb storage clear-archived-files --machine HOST_ID --yes
bb storage remove-dev-instances --machine HOST_ID --yes
bb storage remove-dev-instances --machine HOST_ID --instance NAME --yes
bb storage remove-external-worktrees --machine HOST_ID --yes
bb storage remove-external-worktrees --machine HOST_ID --path WORKTREE_PATH --yes
bb storage remove-external-worktrees --machine HOST_ID --path WORKTREE_PATH --force --yes
Without `--save`, retention thresholds only preview affected thread counts. Days must be whole numbers from 1 to 3650, or `never`. Unspecified settings preserve their saved values. Saved policies apply across all projects. The hourly run processes up to 50 trees per action and skips groups with pinned members. Archiving can remove worktrees including uncommitted changes. Deleting removes history and thread storage. Preview first and save only when authorized.
Delete thread storage on archive defaults to off. Set `--delete-storage-on-archive` to `true` or `false`, or use the switch in the retention panel, which saves immediately. It applies to future manual and automatic archives, including each cascaded child, while the plugin is enabled; it does not clear previously archived threads. Conversations and uploaded attachments are kept. Pinned threads are skipped. Cleanup waits for stopped threads and online persistent machines. Pending cleanup survives reloads and retries every minute; unarchiving or deleting cancels it, and turning the setting off discards pending work on the next cleanup pass. Failures are logged and retried. Threads without an environment need a completed scan to identify their storage machine, just like clear-thread. Each clear logs the thread ID, its archive time and the bytes removed, so a cleared archive can be told apart from a live thread that lost its storage.
Delete development data when its checkout is removed defaults to off and is independent of archive cleanup. Set `--delete-dev-data-on-checkout-removal` to `true` or `false`, or use its switch in the retention panel, which saves immediately. When enabled, the plugin scans online persistent machines hourly and removes missing-checkout `~/.bb-dev` entries after successful scans, including manual scans. Existing missing-checkout data is eligible too; retention previews count threads, not these folders. The host rechecks checkout absence before removal, stops servers working inside missing checkouts, and preserves entries whose source exists or cannot be identified. An environment-removal event re-measures only that machine's `~/.bb-dev`, after any running cleanup there finishes. Startup, machine reconnect, and hourly scans recover missed events from filesystem state. Offline/busy machines and failed cleanup retry on later hourly scans. Disabling the setting prevents cleanup after subsequent scans.
Scans run in the background; rerun usage to read completion, progress, or failure. `--rescan` without `--machine` scans every online machine that is not already scanning. A completed report includes `disk` (total and free bytes of the volume holding thread storage). Reports include `projectWorktrees`: counts of distinct managed worktree paths per project on the selected machine, including zero-count projects with a local source there; destroyed and removed environments are excluded, and `cleanupPendingCount` is a subset of the worktree count. Counts reflect current environment records, not filesystem measurements. Each project row also has `externalCount` and `externalBytes` for worktrees created outside BB. Scans run `git worktree list` in every project source on the machine and report `externalWorktrees`: linked worktrees of those repositories that are not a project source or the path of a live BB environment, such as ones agents or other tools added with `git worktree add`. Each entry has `projectId`, `repositoryPath`, `path`, `branch` (null when detached), `locked`, `changedFileCount` (uncommitted and untracked files) and `unsavedCommitCount` (commits on no branch or tag when detached), both null when git could not inspect the worktree, `lastActivityAt` (latest change to the worktree's HEAD, index or HEAD reflog), measured `sizeBytes`, and `threads` linked through the path's encoded thread ID. Worktrees whose directory is missing, and bare entries, are left out. Worktrees inside thread storage are also counted in that thread's storage. Remove-external-worktrees (page: Remove worktrees in the Clean up section, or a row's trash button) removes worktrees from the last scan with `git worktree remove`, which deletes the checkout, including ignored files such as dependencies, build output and local env files, and keeps its branch. Each worktree is rechecked on th
Read more
name: storage-retention description: Inspect machine storage, clean up files, and configure automatic thread archive or deletion.
Storage & retention
Enable `bb plugin enable bb--storage-retention`. Both policies default to Never. Open the plugin's sidebar panel for machine reports and retention settings. All settings in the panel save immediately when changed. All commands return JSON. Use the owning server's normal SDK/plugin RPC transport.
bb storage retention bb storage retention --archive-after 30 --delete-after 90 bb storage retention --archive-after 30 --delete-after 90 --save --yes bb storage retention --archive-after never --delete-after never --save --yes bb storage retention --delete-storage-on-archive true --save --yes bb storage retention --delete-storage-on-archive false --save --yes bb storage retention --delete-dev-data-on-checkout-removal true --save --yes bb storage usage bb storage usage --rescan bb storage usage --machine HOST_ID --rescan bb storage usage --machine HOST_ID bb storage remove-orphans --machine HOST_ID --yes bb storage clear-large-files --yes bb storage clear-large-files --machine HOST_ID --yes bb storage retry-worktree-cleanup --machine HOST_ID bb storage clear-thread --thread THREAD_ID --yes bb storage clear-archived-files --machine HOST_ID --yes bb storage remove-dev-instances --machine HOST_ID --yes bb storage remove-dev-instances --machine HOST_ID --instance NAME --yes bb storage remove-external-worktrees --machine HOST_ID --yes bb storage remove-external-worktrees --machine HOST_ID --path WORKTREE_PATH --yes bb storage remove-external-worktrees --machine HOST_ID --path WORKTREE_PATH --force --yes
Without `--save`, retention thresholds only preview affected thread counts. Days must be whole numbers from 1 to 3650, or `never`. Unspecified settings preserve their saved values. Saved policies apply across all projects. The hourly run processes up to 50 trees per action and skips groups with pinned members. Archiving can remove worktrees including uncommitted changes. Deleting removes history and thread storage. Preview first and save only when authorized.
Delete thread storage on archive defaults to off. Set `--delete-storage-on-archive` to `true` or `false`, or use the switch in the retention panel, which saves immediately. It applies to future manual and automatic archives, including each cascaded child, while the plugin is enabled; it does not clear previously archived threads. Conversations and uploaded attachments are kept. Pinned threads are skipped. Cleanup waits for stopped threads and online persistent machines. Pending cleanup survives reloads and retries every minute; unarchiving or deleting cancels it, and turning the setting off discards pending work on the next cleanup pass. Failures are logged and retried. Threads without an environment need a completed scan to identify their storage machine, just like clear-thread. Each clear logs the thread ID, its archive time and the bytes removed, so a cleared archive can be told apart from a live thread that lost its storage.
Delete development data when its checkout is removed defaults to off and is independent of archive cleanup. Set `--delete-dev-data-on-checkout-removal` to `true` or `false`, or use its switch in the retention panel, which saves immediately. When enabled, the plugin scans online persistent machines hourly and removes missing-checkout `~/.bb-dev` entries after successful scans, including manual scans. Existing missing-checkout data is eligible too; retention previews count threads, not these folders. The host rechecks checkout absence before removal, stops servers working inside missing checkouts, and preserves entries whose source exists or cannot be identified. An environment-removal event re-measures only that machine's `~/.bb-dev`, after any running cleanup there finishes. Startup, machine reconnect, and hourly scans recover missed events from filesystem state. Offline/busy machines and failed cleanup retry on later hourly scans. Disabling the setting prevents cleanup after subsequent scans.
Scans run in the background; rerun usage to read completion, progress, or failure. `--rescan` without `--machine` scans every online machine that is not already scanning. A completed report includes `disk` (total and free bytes of the volume holding thread storage). Reports include `projectWorktrees`: counts of distinct managed worktree paths per project on the selected machine, including zero-count projects with a local source there; destroyed and removed environments are excluded, and `cleanupPendingCount` is a subset of the worktree count. Counts reflect current environment records, not filesystem measurements. Each project row also has `externalCount` and `externalBytes` for worktrees created outside BB. Scans run `git worktree list` in every project source on the machine and report `externalWorktrees`: linked worktrees of those repositories that are not a project source or the path of a live BB environment, such as ones agents or other tools added with `git worktree add`. Each entry has `projectId`, `repositoryPath`, `path`, `branch` (null when detached), `locked`, `changedFileCount` (uncommitted and untracked files) and `unsavedCommitCount` (commits on no branch or tag when detached), both null when git could not inspect the worktree, `lastActivityAt` (latest change to the worktree's HEAD, index or HEAD reflog), measured `sizeBytes`, and `threads` linked through the path's encoded thread ID. Worktrees whose directory is missing, and bare entries, are left out. Worktrees inside thread storage are also counted in that thread's storage. Remove-external-worktrees (page: Remove worktrees in the Clean up section, or a row's trash button) removes worktrees from the last scan with `git worktree remove`, which deletes the checkout, including ignored files such as dependencies, build output and local env files, and keeps its branch. Each worktree is rechecked on th
bb is an agentic IDE that builds itself. It can control, customize, and automate itself, laying the groundwork for your own software factory. Every surface — the desktop app, web app, CLI, and HTTP API — is a first-class way to drive bb.
Other skills on bb.
More skills from other plugins.
agentmail
Use your assigned AgentMail inbox to read email tasks, explicitly send or reply, and check delivery. Provided automatically by…
adr-create
Create a new Architecture Decision Record with sequential numbering and AgentDB registration
Questions about storage-retention.
- Which coding agents can use storage-retention?
- storage-retention installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.

