Skip to main content
Sweep removes selected worktrees belonging to one or more Tasks. Use it to reclaim disk space after work has landed or when you no longer need an isolated checkout. Opening Sweep lets you inspect the worktrees before removing anything. Sweep keeps the Task, its agent conversations, and its artifacts. It removes the selected checkout directories. Saved bindings can then point to missing worktrees, so agents need an available run location for future work. Removing a worktree doesn’t delete its local or remote branch, so committed work stays on the branch. The exception is a submodule checked out on its own branch for that worktree: that branch lives inside the worktree and is deleted with it, together with any commits that exist only there. A configured teardown script may also perform additional cleanup.
Removal has no undo in Traycer. Uncommitted files and work that exists only in a removed worktree may be permanently lost. Save anything you need elsewhere before removing it, including ignored files you want to keep.
Removing a worktree closes every terminal open inside it, including terminals that are still running a command, even when Sweep doesn’t list the worktree as In use. Automatic cleanup skips such worktrees instead.

Open Sweep

The paintbrush is faded when the Task has no worktrees on this host. For an inventory of all Traycer-managed worktrees on a host, use Settings › Worktrees.

Choose What To Remove

Sweep lists each worktree with its branch, repository, path, status, and available pull request information. Only Landed or At base commit worktrees that are idle and belong exclusively to the selected Tasks start checked. When several selected Tasks share a worktree, it appears once. It counts as shared outside the sweep only if a Task outside your selection also references it.
Select all includes selectable worktrees that did not start checked, including work needing review. Keep the default selection if you only want the worktrees Traycer has preselected as safe.
Press A to select or deselect all, and R to refresh the worktree details. The footer shows when the details were last checked (“Workspace snapshot ·” followed by the time).

Remove The Selected Worktrees

  1. Check the paths, branches, and selected count. Deselect anything you want to keep.
  2. Click Remove N worktrees. Traycer refreshes its checks before proceeding.
  3. If the selection is still safe, removal starts immediately. If it includes unproven work, active work, or worktrees shared with other Tasks, Review this sweep shows the consequences first.
  4. In that review, read the possible work loss, activity that will be stopped, affected Tasks, and worktree paths. Choose Back to change the selection, Cancel to leave, or Confirm and remove N worktrees to proceed.
For a selected worktree in use, confirmation authorizes stopping anything working there when deletion runs. If Traycer cannot identify everything using it, the review says so. If the activity changes during review, Traycer asks you to review the updated consequences. Cleanup runs in the background and can run the workspace’s configured teardown script. Closing the dialog does not cancel cleanup that has started; while a sweep runs, Cancel becomes Close. Reopen Sweep to see progress; the result notification reports removals, failures, or unconfirmed outcomes. If you close the dialog after clicking Remove N worktrees but before Traycer finishes rechecking, and the selection turns out to need review, a “Sweep needs your confirmation.” notification offers Review sweep. Nothing is removed until you confirm. When the list includes proven-safe worktrees and automatic cleanup is off for the host, the dialog offers Set up automatic cleanup.

Example: Clean Up After A Merged PR

Suppose a Task has two worktrees: fix-login, whose current work has landed, and try-new-layout, which still has uncommitted changes. Once checks finish, Sweep preselects the idle fix-login worktree if no other Task uses it. It leaves try-new-layout unchecked with a review explanation. Leave that selection as-is and choose Remove 1 worktree to remove the fix-login checkout while retaining the unfinished checkout. The Task and its conversation history remain available.

Sweep On Different Hosts

Worktrees live on the host where they were created. If you have multiple hosts, use the host selector in Sweep to choose whose worktrees to inspect and remove. A sweep acts on one host at a time; repeat it on another host if needed. An empty list means no worktrees were found for the selected Tasks on that host. An unreachable host cannot be inspected or cleaned up until it is reachable again. In the review step, use Back before changing hosts.

If Cleanup Does Not Finish

  • Couldn’t be removed: Inspect the reported reason, address it, then select the worktree again to retry.
  • Unconfirmed: Traycer could not confirm the outcome. Check the worktree and refresh its status before taking further action; Sweep does not automatically retry that deletion.
  • Couldn’t check these worktrees: Retry or inspect the host’s inventory in Settings › Worktrees.
Sweep is manual cleanup. Opening it does not enable automatic cleanup, a separate, opt-in setting that removes inactive, proven-safe worktrees on a schedule. See Settings › Worktrees for its eligibility rules, timing, and cleanup history.