[Go to site: main page, start]

Share feedback
Answers are generated based on the documentation.
{ const container = $el; // The div with overflow const item = document.getElementById('sidebar-current-page') if (item) { const containerTop = container.scrollTop; const containerBottom = containerTop + container.clientHeight; const itemTop = item.offsetTop - container.offsetTop; const itemBottom = itemTop + item.offsetHeight; // Scroll only if the item is out of view if (itemBottom > containerBottom - 200) { container.scrollTop = itemTop - (container.clientHeight / 2 - item.offsetHeight / 2); } } })" class="bg-background-toc dark:bg-background-toc fixed top-0 z-40 hidden h-screen w-full flex-none overflow-x-hidden overflow-y-auto md:sticky md:top-16 md:z-auto md:block md:h-[calc(100vh-64px)] md:w-[320px]" :class="{ 'hidden': ! $store.showSidebar }">

sbx prune

DescriptionRemove all stopped sandboxes
Usagesbx prune [flags]

Description

Remove all stopped sandboxes and their associated resources.

Only stopped sandboxes are candidates — a running sandbox is never removed, which makes this safe to run habitually. Stop a sandbox first with "sbx stop" if you want it pruned. To remove a specific sandbox regardless of state, use "sbx rm SANDBOX".

Use --filter until=TIMESTAMP to narrow the set to sandboxes that stopped before TIMESTAMP. The value can be an RFC 3339 timestamp, Unix timestamp, or Go duration relative to now (e.g. until=168h keeps anything stopped within the last week). A sandbox whose stop time the daemon cannot report is left alone, since how long it has been stopped cannot be established.

Use --dry-run to list what would be removed without removing anything, and --format json or --format yaml with it for machine-readable output.

Pruning requires confirmation; use --force to skip the confirmation prompt (for non-interactive scripts) and to remove a sandbox that is in use (e.g. an open SSH connection). This action cannot be undone.

Secrets scoped to each successfully pruned sandbox are also deleted.

Local-only: cloud sandboxes expire via their TTL.

Options

OptionDefaultDescription
--dry-runList the sandboxes that would be removed without removing them
--filterFilter candidates (supported: until=TIMESTAMP — stopped before TIMESTAMP)
-f, --forceSkip confirmation prompts and remove even if in use (e.g. an open SSH connection)
--formatOutput format: table, json or yaml
--jsonOutput in JSON format

Global options

OptionDefaultDescription
--cloudDispatch to Docker Cloud Sandboxes API instead of local sandboxd (supported by a growing set of verbs — run 'sbx --cloud --help' for the current list)
-D, --debugEnable debug logging

Examples

# Show what would be removed
sbx prune --dry-run

# Remove without asking
sbx prune --force

# Only sandboxes stopped before a point in time
sbx prune --filter until=2026-01-01T00:00:00Z