/sidequest:tidyfrom sidequest
Cleans up Git worktrees by identifying safe ones (no uncommitted work, no unpushed commits, no active operations) and removing them. Useful when worktrees accumulate from agent sessions or manual work.
Ships in sidequest. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Say which worktrees are finished and remove those, wherever they live and whoever made them. A worktree marked keep is never touched.
Most agent worktrees go without this skill. Once per session, at its start, the board runs the same script with --remove-safe --unasked --only=<path> on the agent worktrees no one may be using (not locked, no agent or git write in the last ten minutes, no ticket on it that is not done or dropped) and that changed since they were last kept, toasts how many went and names each kept one once with its reason. A landing's move to done removes what it landed the same way. Unasked, a commit counts as held only by another local branch, and only a worktree-agent-* branch is deleted. This skill is for the rest, and for a kept one the person wants looked at now: worktrees a person made, branches and folders an older version left.
Look. From the main checkout run:
node "${CLAUDE_PLUGIN_ROOT}/scripts/worktrees.mjs"
It prints one row per linked worktree: path, branch, uncommitted or untracked files, commits on no remote and not merged into the main checkout's branch, locked, last commit date, and the verdict. safe means nothing is uncommitted, nothing is only there, no rebase, merge or bisect is in progress, and it is not locked. Only there includes ignored files: one the main checkout lacks or holds with other content (a .env, a local database), or an ignored folder the main checkout does not have. Installed or built folders the main checkout has too still read safe. A worktree that holds a submodule is always keep, because git does not remove one. Anything else is keep with the reason.
Show it. Paste the table, then one line: how many can go, how many stay and why, in plain words (12 can go. 5 stay: 3 have uncommitted files, 2 hold a commit that is on no remote.). When the script prints a line starting Safe, and named by a person, show that line as it is before anything is removed: those folders or branches carry a name someone chose, not an agent's. Agent-named safe ones stay a count.
Remove. When the person asked for the cleanup, go on at once. Otherwise ask once whether to remove the safe ones and wait for the yes. Then run:
node "${CLAUDE_PLUGIN_ROOT}/scripts/worktrees.mjs" --remove-safe --named
--named takes the person-named ones you showed in step 2 too; without it they stay. It re-reads every worktree, judges each safe one again right before it touches it and keeps it with the reason when it changed, removes it with a plain git worktree remove (never forced), and deletes a branch only when another branch or a remote holds its commits and git branch -d accepts it. Before a folder goes, every junction or symbolic link inside it, at any depth, that leads out of it is taken away as a link, so the removal cannot delete files through it. A worktree kept by its verdict or by that second look keeps its links.
The same run also lists local worktree-agent-* branches that have no worktree, safe when merged or empty and keep with the commit count otherwise. Hundreds of safe ones print as one count line with the keeps named, so show that line as it is and never list them one by one.
To find worktree folders an older version left under the home directory that git no longer knows, pass the folder to look under (the older version's worktree folder, one folder per project inside it) as an argument to both commands. A folder is safe only when every file in it matches something the repository already holds; --remove-safe removes just those.
Report what it removed, which branches it kept and why, and what stays.
git branch -d refuses. Its reason goes in the report; what to do with it is the person's call.--json prints the same report as JSON.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub eigenwise/eigenwise-toolshed --plugin sidequest6 skills in this plugin
/landUse when reviewed run branches are ready to come home. Merges them into one integration branch (one ticket lands on its own), verifies the composed tree once, records the result and opens the PR./planUse for a feature, a reported problem or a new project that needs the human's decisions, or when they ask for a step of their own before anything is built (a written plan, a design note). Reads the whole request and the code, shows what it found with the options, grills, then files tickets./runUse to execute the board's frontier. Starts each ready ticket on its routed agent in parallel, records each result when the agent returns, and reviews finished work.Other plugins' skills for the same job