[Feature]: Clean up worktrees for settled threads without deleting history #6856
Replies: 3 comments
|
I am also encountering this issue, it makes it inconvenient to use sidebar v2 without manually doing the second step of archiving as well |
|
I agree that the |
|
I’d love to see this also expose a lifecycle hook before removing the worktree, similar to For example, a In my case, for an iOS project, each worktree can have its own iOS Simulator and potentially its own DerivedData, so I’d like to automatically remove those when the associated worktree is deleted. This could probably stay very generic and just run a configured script with the worktree path/environment available. |
Uh oh!
There was an error while loading. Please reload this page.
Before submitting
Area
apps/web, apps/server
Problem or use case
Sidebar V2 can classify threads as settled manually, after a PR is merged or closed, or after inactivity. Settling only changes the thread lifecycle and UI state. The linked worktree stays on disk.
With a worktree-first workflow, finished threads can leave behind many checkouts containing
node_modules, build outputs, and other generated files. Deleting the thread can remove an orphaned worktree, but it also deletes the conversation history. I want to keep the settled thread while releasing its worktree.Proposed solution
Add a safe Remove worktree action for settled threads.
Normal removal should only be allowed when the worktree:
The thread, branch, and conversation history should remain. If the thread is used again, T3 Code could recreate the worktree or offer to do so.
A later extension could auto-prune safe worktrees after a configurable number of days settled. Automatic cleanup should never force-delete dirty or unpushed work.
Smallest useful scope
A manual action in the settled thread context menu, with a confirmation and a clear reason when removal is blocked.
Alternatives considered
Examples or references
Contribution
All reactions