-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Summary
Improve git worktree lifecycle management - from creation options to cleanup. Team feedback highlighted worktrees accumulating on disk and lack of flexibility in worktree creation.
Problems Identified
1. Worktrees Not Cleaned on Task Archive (High Priority)
Current: Archiving a task only changes status - worktree persists indefinitely.
Impact: Disk space accumulation, orphaned worktrees, manual cleanup required.
Evidence:
TaskAttempt.worktree_deletedfield exists but isn't usedArchiveTaskConfirmationDialogonly updates status
Solution:
- Archive dialog offers: "Remove worktree? (recommended)" checkbox
- Show worktree size before deletion
- Success/failure notification
- Option to keep worktree if user wants
2. Bulk Worktree Cleanup Tool
Current: No way to clean up multiple orphaned worktrees at once.
Solution:
- Settings or Tools page: "Manage Worktrees"
- List all worktrees with their task status (active/archived/orphaned)
- Select multiple for bulk deletion
- Show disk space that will be freed
- "Clean All Archived" quick action
3. Skip Worktree Option on Task Creation
Current: Every task creates a worktree, no option to skip.
Impact: Sometimes users want to work directly in main branch.
Solution:
- Checkbox in task creation: "Create isolated worktree" (default: checked)
- When unchecked, task runs in main project directory
- Clear warning about working in shared space
4. Worktree Status Visibility
Current: Hard to know worktree state for a task.
Solution:
- Show worktree path in task details
- Indicator if worktree exists vs deleted
- Quick action to open worktree in file explorer
Acceptance Criteria
- Archive dialog has worktree cleanup option
- Bulk cleanup tool accessible from settings
- Task creation has "skip worktree" option
- Worktree status visible in task details
Related Issues
- 🐛 Bug: Lightbulb chat icon doesn't create agent sessions outside git worktrees #236 (Lightbulb chat outside git worktrees)
Technical Notes
Affected Files:
ArchiveTaskConfirmationDialog.tsxTaskFormDialog.tsxforge-app/src/router.rs(worktree endpoints)
Database:
TaskAttempt.worktree_deletedalready exists
Team Feedback Sources
- Feedback 2: Worktree cleanup on archive
- Feedback 3: "Option to start task without worktree"
- Feedback 4: Git/worktree transparency
Priority
🔴 P0 - High (2/6 feedbacks, disk space impact)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request