Skip to content

Show worktree storage by cleanup category and explain what is retained #14761

Description

@tris203

Problem

Settings → Storage lets me configure automatic cleanup, but it does not show how the worktree storage on the selected machine or project is distributed across cleanup categories. I cannot readily tell how much is eligible under my rules, how much is retained, or why apparently completed worktrees are still taking up space.

While working with the category visualization in #12604, I found it useful for spotting mismatches between what I expected a rule to clean up and what was actually retained. That led to investigating the limitations now tracked in #13836 (ignored files from worktree setup), #14742 (squash merges), and #14758 (PRs merged into release branches or stack parents). Those reports have their own evidence and policy questions; the visualization helped identify where to investigate. The screenshots below do not independently prove those defects.

This is an enhancement and direction request for maintainer triage, not a claim that the earlier implementation was approved.

What I want to understand

For a selected project or environment, I want a category view that answers:

  • How much disk space do my worktrees occupy, and how much is currently eligible for cleanup?
  • How is that space divided among the cleanup categories, such as inactive threads, merged work, unchanged work, and worktrees left by deleted threads?
  • How much is being retained, and for what reasons—for example activity, local changes, protected ignored files, or a merge that does not meet the rule's evidence requirements?
  • How would changing a rule or inactivity threshold change the potentially reclaimable amount, without applying that change just to discover its effect?

The distinction between matching a category and actually being eligible matters. A merged PR can still have a protected checkout. A useful view should make that understandable, avoid double-counting overlapping categories, and identify unavailable or incomplete measurements rather than presenting them as zero.

Last-run cleanup logs could help diagnose an individual sweep, but they would not answer these questions about the current storage distribution and the effect of different rules.

Illustrative earlier UI

These screenshots come from the closed, unmerged #12604 prototype. They illustrate why the category visualization was useful; they are not shipped UI, an approved design, or evidence of the exact rule semantics currently supported. The original PR combined presentation with cleanup-policy changes, so its labels and totals should not be taken as a specification for current eligibility.

For example, the earlier all-project view showed 90.3 GB in total and 63.7 GB in “Other.” Seeing that large retained remainder made it clear where I needed to investigate; explaining the remainder is part of the value, not just displaying a total. These are historical prototype values.

Across projects:

Earlier prototype: worktree storage categories across projects

One project:

Earlier prototype: worktree storage categories for one project

Requested scope and decision

Please triage whether this visibility into worktree storage and cleanup categories is a direction maintainers want, and what the smallest useful version should explain. The intended starting surface is the existing web/desktop Storage settings, following the selected project and environment; remote storage belongs to its owning environment.

This request does not require adopting the earlier scanner, the whole staged Save/Discard workflow, or weakening any cleanup protections. Those implementation and interaction choices can be agreed separately. Understanding the effect of a proposed rule change should itself be read-only. The existing saved policies may continue to run normally.

Related work

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementRequested improvement or new capability.via-triageFiled through npx t3 triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions