You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature Request: Automatic deletion of project when underlying folder is deleted #286
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.
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!
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.
Activity
DeusData commentedon Jun 18, 2026
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!
pcristin commentedon Jun 24, 2026
Suggested behavior:
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.
feat(watcher): prune projects whose root stays missing (ENOENT-only, …