Skip to content

Feature Request: Automatic deletion of project when underlying folder is deleted #286

Closed

Description

@ehendrix23

Using work-trees with this tool has been fabulous because the AI can easily just add the worktree as a project and start using it, including any changes then that it makes.
But, as one uses work-trees and changes and then removes them those projects stay requiring manual deletion.

My feature request is to also allow automatic deletion when the watcher determines that the root folder for a project is gone so that when work trees are cleaned up, the projects are also automatically cleaned up.

Thx.

Activity

  1. DeusData commented on Jun 18, 2026

    @DeusData
    Owner

    Thanks for the request, @ehendrix23 🙏 This is the natural cleanup counterpart to the worktree workflows in #351: if the watcher already knows a project root, it can detect when that root disappears and reclaim the project. The care here is avoiding accidental deletion on a transient unmount or network filesystem blip, so we'd want a grace mechanism (mark stale after N missed checks, delete only after a sustained absence) rather than deleting on the first missing root event. Tracking it. Thanks!

  2. pcristin commented on Jun 24, 2026

    @pcristin
    Contributor

    Suggested behavior:

    • Keep the indexed project as-is when its root is missing for the first time.
    • Mark it internally as stale after the watcher observes the missing root.
    • Only auto-delete after a grace period or several consecutive missed checks.
    • Reset the stale state if the root path reappears before the threshold.
    • When the absence is confirmed, remove the project from the watch set and delete the cached project database.

    That gives the worktree cleanup UX requested here without risking data loss from transient unmounts, network filesystem hiccups, or short-lived path visibility issues.

    I would keep this scoped separately from #573. Overlay indexing can later define branch/context garbage collection, but this issue can solve the simpler project-list cleanup problem for deleted roots.

  3. added
    priority/normalStandard review queue; useful PR with ordinary maintainer urgency.
    on Jul 1, 2026
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

    enhancementNew feature or requestpriority/normalStandard review queue; useful PR with ordinary maintainer urgency.ux/behaviorDisplay bugs, docs, adoption UX

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions