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_deleted field exists but isn't used
ArchiveTaskConfirmationDialog only 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
Related Issues
Technical Notes
Affected Files:
ArchiveTaskConfirmationDialog.tsx
TaskFormDialog.tsx
forge-app/src/router.rs (worktree endpoints)
Database:
TaskAttempt.worktree_deleted already 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)
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 statusSolution:
2. Bulk Worktree Cleanup Tool
Current: No way to clean up multiple orphaned worktrees at once.
Solution:
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:
4. Worktree Status Visibility
Current: Hard to know worktree state for a task.
Solution:
Acceptance Criteria
Related Issues
Technical Notes
Affected Files:
ArchiveTaskConfirmationDialog.tsxTaskFormDialog.tsxforge-app/src/router.rs(worktree endpoints)Database:
TaskAttempt.worktree_deletedalready existsTeam Feedback Sources
Priority
๐ด P0 - High (2/6 feedbacks, disk space impact)