Pimp My IDE / garage dispatchBack to the garage
October 7, 2026 / VS Code 1.141 / agent worktrees

Do not crush an unknown checkout.

VS Code 1.141 can find inactive agent worktrees and reclaim their disk space. That is useful maintenance. The safe unit of cleanup is a session with a known branch, preserved changes, and a tested return route.

Age is a filter. Repository state is the release gate.

The new broom has a dashboard.

VS Code 1.141, released today, adds a worktree cleanup editor for inactive agent sessions. It can show storage use, filter by inactivity, remove selected worktrees, and configure automatic cleanup for sessions whose pull requests were merged. Active, running, needs-input, and pinned sessions are protected from cleanup.[1]

The feature addresses a real cost of parallel agents. Every isolated session can leave another checkout, dependency tree, generated file set, and build cache behind. A storage warning is useful. It is not a verdict about whether the work is disposable.

A stale session and a disposable patch are different facts.

Read the repository before the calendar.

An inactivity threshold can narrow the list. It cannot tell you whether an untracked fixture matters, whether a branch tip exists elsewhere, or whether a closed pull request was superseded rather than merged. Before cleanup, record the exact worktree path, session state, branch or detached commit, dirty-file summary, and review destination.

VS Code's session guide says that marking a worktree session done preserves its conversation and branch. It also says the editor commits uncommitted changes before removing the worktree, and leaves the worktree in place if preservation or removal fails.[2] That is a product contract worth checking. Keep an independent handle such as the resulting commit, a patch, or another repository backup when the changes matter.

Git has several kinds of cleanup.

git worktree remove removes a linked working tree. Git normally refuses to remove one with modified or untracked files unless force is used. git worktree prune removes stale administrative records for working trees that no longer exist. Locked worktrees are protected from pruning. These commands solve different problems.[3]

Do not translate a storage alert into rm -rf. Let the session manager finish its preservation path. Then inspect Git's view with git worktree list --porcelain. Use force only after the preservation record and deletion target have been reviewed.

Make automatic cleanup earn the key.

Start with manual cleanup on a small set. Exercise one clean merged session, one dirty session, one detached worktree, and one session that must stay pinned. Restore the cleaned session and confirm the checkout returns at the expected revision. Only then consider automatic cleanup.

Keep the rule narrow. A merged pull request is stronger than age alone, but the merge state still needs a repository and branch match. Save the policy, excluded states, preservation method, restore result, reclaimed bytes, and failures. A cleanup job that cannot produce that receipt should remain manual.

Run this impound check.

WORKTREE IMPOUND CHECK
1. Freeze new writes to the selected session.
2. Record session, repository, path, branch, and commit.
3. Inspect modified and untracked files.
4. Preserve valuable changes under an independent handle.
5. Confirm the review or merge outcome against the same branch.
6. Clean through the owning session manager.
7. Restore one cleaned session and verify its revision.
8. Record reclaimed space and any cleanup failure.
Interactive makeover / worktree impound lot

Route the checkout.

Traditional purpose replaced: an age filter beside a delete button. Better version: choose the observed state, connect it to a physical hold or reclaim route, and build a review card without pretending that the page inspected your repository.

Select the observed state

The selected case is an example. This control does not read VS Code, Git, a pull request, or the filesystem.

Worktree state
Review card sections
Hold. The session may still write.

Keep active and needs-input sessions out of cleanup. Record repository state only after the session stops.

Sources read / October 7, 2026

Source log

Open the evidence boundary
  1. Visual Studio Code 1.141 release notes, released and read October 7, 2026. Microsoft documents the worktree cleanup editor, inactivity filtering, storage display, automatic cleanup setting, cleanup suggestions, protected session states, and restoration claim.
  2. Visual Studio Code documentation, "Manage agent sessions", read October 7, 2026. The guide defines sessions and worktrees, describes archive and done behavior, states how uncommitted changes and branches are preserved, and describes restoration.
  3. Git documentation, "git-worktree", read October 7, 2026. Git documents linked-worktree identity, list, lock, move, prune, remove, repair, force behavior, and the distinction between removing a working tree and pruning stale administrative records.

Evidence boundary: this page read the named release notes and documentation. It did not install VS Code 1.141, create or clean a VS Code agent worktree, or test Microsoft's restoration path. The impound lot creates a review-card structure. It does not inspect repository state, preserve changes, authorize deletion, or reclaim disk space.