What problem does it solve?
After a task is completed and merged, leftover task branches and Git worktrees clutter the repository and consume disk space. Manually cleaning these up is tedious and often forgotten. This Skill automates the safe removal of these artifacts, keeping your repository tidy and efficient.
Core Features & Use Cases
- Worktree Removal: Safely removes all task-related Git worktrees, including agent-specific ones.
- Branch Deletion: Deletes all task-related Git branches, preventing branch accumulation.
- Audit Trail Preservation: Crucially, preserves the task directory containing
task.json, task.md, and approval flags for future auditing.
- State Transition: Updates the task's state to
CLEANUP in task.json for accurate tracking.
- Use Case: Once a task is fully complete and merged to
main, invoke this Skill to automatically remove all associated branches and worktrees. This keeps your repository tidy, reclaims disk space, and ensures a clean development environment without manual effort.
Quick Start
After your task is in the 'COMPLETE' state, clean it up:
cd /workspace/main
/workspace/main/.claude/scripts/task-cleanup.sh "implement-formatter-api"