clean-up-shop

Clean up worktrees, stale branches, and orphaned directories after work sessions.

1|Updated Feb 25, 2026
One-click install
npx skills add https://github.com/danalexilewis/taskgraph --skill clean-up-shop
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-up-shop
Source: https://github.com/danalexilewis/taskgraph/tree/main/.cursor/skills/clean-up-shop
Command: npx skills add https://github.com/danalexilewis/taskgraph --skill clean-up-shop

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Clean up worktrees, stale branches, and orphaned directories after a work session to restore a clean development environment when no jobs are in flight.

Core Features & Use Cases

  • Automatically detect and prune unused worktrees and branches created during sessions.
  • Safely merge completed work into main or remove branches as appropriate, preserving history.
  • Remove leftover, empty directories to reclaim disk space and reduce clutter.

Quick Start

Run the cleanup skill after finishing a Cursor-like session to tidy up the repository and return the main checkout to a clean state.

Frequently Asked Questions about clean-up-shop

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I clean up git worktrees and stale branches after a work session?

To clean up git worktrees and stale branches after a work session, you can automate the detection and pruning of unused directories. This process safely merges completed work into the main branch or removes orphaned branches to restore a clean repository state.

What is the best way to automate repo maintenance for multi-agent workflows?

Automating repo maintenance for multi-agent workflows involves using scripts that detect inactive tasks and safely remove leftover worktrees. This ensures the environment remains tidy and prevents disk clutter from accumulated orphaned directories.

Does automated branch cleanup require a specific git main branch alignment?

Automated branch cleanup requires proper main branch alignment to prevent data loss. The process relies on safe merge and removal rules to ensure completed work is preserved correctly before any stale branches are deleted.

Can I safely remove orphaned directories and worktrees without losing uncommitted changes?

Safely removing orphaned directories and worktrees requires applying safe merge rules before deletion. This ensures any completed work is properly merged into the main branch, preventing the loss of active or uncommitted session changes.

When should I avoid running automated worktree cleanup in my repository?

You should avoid running automated worktree cleanup when tasks are still active or jobs are in flight. Running the process during active sessions risks deleting worktrees and branches that are still needed for ongoing development.