agentleFS
vltingvlting/claude-skills/skills/worktree-manager/SKILL.md

worktree-manager

Skill2 starsChanged 9 months agoMITView on GitHub

Git worktree management with safe defaults and flexible placement strategies. Use when users ask to: (1) create a new worktree or work on multiple branches in parallel, (2) list existing worktrees, (3) remove or clean up worktrees, (4) manage worktree placement (subfolder vs sibling directory), or any other git worktree operations.

6 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 5 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Always use --force when removing worktrees — repos with submodules will fail without it.

    line 11
  2. Distinctive:

    Always run git worktree prune after removing a worktree to clean up stale references.

    line 12
  3. Very specific:

    When creating subfolder worktrees, ensure .worktrees/ is in .gitignore before creating.

    line 13
  4. Distinctive:

    Never hardcode worktree paths in remove operations — always read from git worktree list.

    line 14
  5. Distinctive:

    Default to subfolder placement unless the user explicitly chooses parent folder.

    line 15
  6. Distinctive:

    Default the worktree folder name to the last segment of the branch name.

    line 16
  7. Very specific:

    If the user provided a sub-command (:create, :list, or :remove), use that action.

    line 20
  8. Distinctive:

    If no sub-command was provided, ask the user which action they want:

    line 21

“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Worktree Manager

Fast, interactive management of git worktrees with consistent conventions and automatic housekeeping.

Agent behavior contract

  1. Always use --force when removing worktrees — repos with submodules will fail without it.
  2. Always run git worktree prune after removing a worktree to clean up stale references.
  3. When creating subfolder worktrees, ensure .worktrees/ is in .gitignore before creating.
  4. Never hardcode worktree paths in remove operations — always read from git worktree list.
  5. Default to subfolder placement unless the user explicitly chooses parent folder.
  6. Default the worktree folder name to the last segment of the branch name.

Triage (detect action)

If the user provided a sub-command (:create, :list, or :remove), use that action. If no sub-command was provided, ask the user which action they want:

  • :create — Create a new worktree with a new branch (/worktree-manager create)
  • :list — List all current worktrees (/worktree-manager list)
  • :remove — Remove an existing worktree (/worktree-manager remove)

Then read the appropriate reference:

Routing map

  • Creating a worktree → references/creating.md
  • Listing worktrees → references/listing.md
  • Removing a worktree → references/removing.md
  • Placement strategies & conventions → references/placement.md
  • Common issues & troubleshooting → references/troubleshooting.md

Common errors → next best move

  • "working trees containing submodules cannot be moved or removed" → use --force flag (see references/removing.md)
  • Stale worktree references after manual deletion → run git worktree prune (see references/removing.md)
  • Branch already checked out in another worktree → list worktrees to find which one, remove or use a different branch
  • .worktrees/ showing up in git status → add to .gitignore (see references/placement.md)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.