flywheel-cleanup

Detects and removes orphaned git worktrees left by crashed or stopped sessions.

3|1|Updated Apr 15, 2026
One-click install
npx skills add https://github.com/burningportra/agent-flywheel-plugin --skill flywheel-cleanup-burningportra
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: flywheel-cleanup
Source: https://github.com/burningportra/agent-flywheel-plugin/tree/main/skills/flywheel-cleanup
Command: npx skills add https://github.com/burningportra/agent-flywheel-plugin --skill flywheel-cleanup-burningportra

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Crashed or interrupted coding sessions leave behind orphaned git worktrees that clutter the repository, consume disk space, and confuse future automation runs. This Skill reconciles on-disk worktrees against tracked session state and removes the leftovers safely. ## Core Features & Use Cases - Orphan Detection: Compares git worktree list --porcelain output against tracked worktrees in .pi-flywheel/checkpoint.json to find untracked leftovers. - Uncommitted Change Protection: Checks each orphan for dirty state and offers to auto-commit work-in-progress before removal, so no work is silently lost. - Confirmed Removal: Lists everything slated for deletion and asks for confirmation before running git worktree remove --force. - Use Case: After a multi-agent session crashes mid-implementation, run this Skill to find three abandoned worktrees, auto-commit one with unsaved changes, and clean up the rest. ## Quick Start Ask the assistant to clean up orphaned git worktrees from crashed sessions in this repository.

Frequently Asked Questions about flywheel-cleanup

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

FAQPage Schema
How do I remove orphaned git worktrees after a crashed session?

Run `git worktree list --porcelain` to enumerate worktrees, compare them against tracked entries in `.pi-flywheel/checkpoint.json`, and remove any that exist on disk but are no longer tracked. Confirm each removal before running `git worktree remove --force`.

How to clean up git worktrees without losing uncommitted changes?

Check each orphaned worktree with `git status --short` before removal. If it is dirty, auto-commit the changes with `git add -A` and a wip commit message, then remove the worktree so the work remains in git history.

What is an orphaned git worktree?

An orphaned worktree is a directory registered with git that no longer corresponds to any tracked session or checkpoint state, typically left behind when a process crashes. It still consumes disk space and appears in `git worktree list`.

Does git worktree remove delete uncommitted changes?

Yes, `git worktree remove --force` discards uncommitted changes in that worktree. This Skill guards against data loss by detecting dirty worktrees and offering to auto-commit their changes before removal.

When should I not force-remove a git worktree?

Avoid force removal when the worktree is still tracked in an active checkpoint or contains uncommitted work you have not reviewed. Verify tracking state and dirty status first, and only remove entries confirmed as orphans.