Updated 5 hours ago
VS Code 1.141 adds agent-session grids and guarded worktree cleanup

Developer Tools

VS Code 1.141 adds agent-session grids and guarded worktree cleanup

VS Code 1.141 can display agent sessions side by side and reclaim inactive worktree storage. Cleanup protects active or unpreserved work and keeps session history, so teams should distinguish session state from disk deletion.

The Agents window now supports a two‑dimensional session grid

Microsoft's [VS Code 1.141 release](https://code.visualstudio.com/updates/v1_141) lets developers place agent sessions in horizontal or vertical splits inside the Agents window. Panes can be resized, and one session can be maximized before returning to the grid. The release also adds filters for environment, harness and originating application. The grid is useful when tasks have independent outputs that need comparison or monitoring. It is not a merge or review system: each session keeps its own context, files, unread state and last‑modified time. Opening one nested conversation marks only that conversation as read. A practical workflow assigns one measurable job to each pane, labels the expected artifact, and limits the number of live sessions to what a reviewer can inspect. Side‑by‑side visibility reduces switching, but a crowded grid can still hide duplicated work or incompatible edits.

Worktree cleanup is a reviewed lifecycle, not an unconditional delete

The new Chat: Open Worktree Cleanup command shows inactive session worktrees and their estimated storage. The current session‑management documentation says eligible worktrees can be filtered by 7, 15, 30, 60 or 90 days of inactivity. Selected sessions are marked done and scheduled for worktree removal.

VS Code excludes sessions that are active, running, waiting for input, pinned, already done, archived, untitled, in an error state, too recent or missing a usable size estimate. Before removing a worktree, it attempts to commit uncommitted changes to the session branch. If changes cannot be preserved or the worktree cannot be removed, the worktree remains.

The session and branch history are retained, so restoring the session can recreate the worktree. This means the cleanup operation has two related outcomes: conversation lifecycle state and local disk reclamation. Verify both rather than treating “marked done” as proof that bytes were removed.

Git state is the last guard before physical removal

The documentation says a worktree is removed only when its branch tracks an upstream and has no outgoing commits or uncommitted changes. Cleanup never force‑removes a worktree. That rule protects local work, but it also explains why a cleanup run can leave storage behind. Before confirming a large batch, inspect any session with unpushed commits, an unknown upstream or an unexpected size. Preserve intended work through the normal branch and review path. A failed cleanup should be classified by its Git state instead of retried with a destructive command. For auditability, record the selected inactivity threshold, candidate count, excluded important sessions, and storage before and after. Do not use the feature as a substitute for reviewing abandoned branches.

Suggestions and automatic cleanup have separate thresholds and states

VS Code can suggest cleanup when inactive worktrees reach at least 5 GiB or when 20 worktrees are eligible, if `chat.agentSessions.sessionStorageCleanupSuggestion.enabled` is on. The suggestion opens the review interface; it does not delete work by itself. Automatic cleanup is a preview feature with two disabled‑by‑default settings: one controls how many inactive days pass before a merged session is marked done, and another controls the grace period before permanent deletion. Microsoft recommends 15 days for each when the feature is enabled. Only sessions automatically marked done by this lifecycle are eligible for its permanent‑deletion step; manually completed sessions are excluded. Teams should start with suggestions, inspect two or three cleanup cycles, and enable automation only after upstream tracking and preservation behavior match their Git workflow. Keep longer grace periods for repositories with delayed release or compliance reviews.

Grid visibility works best with explicit completion and storage rules

The [Agents window guide](https://code.visualstudio.com/docs/agents/run/agents‑window) shows files, changes and session metadata for the active conversation. Use those views before marking a session done, and pin work that must survive an inactivity filter. Background‑shell indicators in 1.141 also make it easier to see when a command is still running before cleanup or reassignment. A simple operating rule is: arrange active sessions by outcome, review each branch, merge or preserve it, mark the session done, then reclaim storage. That order prevents the visual convenience of a grid from becoming a reason to start more work than the review queue can absorb. The same VS Code release includes sandboxing and external‑session continuation, but those features have separate security and identity checks. Session layout does not widen tool permissions, and cleanup does not validate the code. Follow [GitHub's OpenTools organization page](https://opentools.ai/organizations/github) for related agent‑tool releases. *Figure: A review‑first loop for arranging and cleaning up VS Code agent sessions. Sources: [VS Code 1.141 release notes](https://code.visualstudio.com/updates/v1_141), [session‑management documentation](https://code.visualstudio.com/docs/agents/run/sessions/manage‑sessions) and the [Agents window guide](https://code.visualstudio.com/docs/agents/run/agents‑window). Figure by OpenTools Team; no third‑party expressive material used.*

Share this article

PostShare

Related News