From worktree
Manage git worktrees using git gtr — create, copy files, list, remove, and navigate. Use when the user invokes /worktree.
How this skill is triggered — by the user, by Claude, or both
Slash command
/worktree:worktreeThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
The user has invoked `/worktree`. Help them manage git worktrees using the `git gtr` CLI (git worktree runner).
git gtrThe user has invoked /worktree. Help them manage git worktrees using the git gtr CLI (git worktree runner).
Before running any git gtr command, verify it is installed:
git gtr version
If the command fails, tell the user:
git gtris not installed. Install it from https://github.com/coderabbitai/git-worktree-runner
Do NOT proceed with any worktree operations until git gtr is available.
Interpret the user's free-form input after /worktree and map it to one of these intents:
| User says | Intent |
|---|---|
/worktree my-feature | create a worktree for branch my-feature |
/worktree new my-feature --from-current | create with options |
/worktree copy my-feature -- ".env*" | copy files to a worktree |
/worktree list or /worktree ls | list worktrees |
/worktree rm my-feature or /worktree remove my-feature | remove a worktree |
/worktree go my-feature or /worktree navigate my-feature | navigate guidance |
If the intent is ambiguous, ask the user to clarify.
Run git gtr new <branch> with any options the user specified.
Common options:
--from <ref> — create from a specific branch/tag/commit--from-current — create from the current branch (for parallel variants)--no-copy — skip copying configured files to the new worktree--no-fetch — skip git fetch before creation-e, --editor — open in editor after creation-a, --ai — start AI tool after creationExample:
git gtr new my-feature
git gtr new my-feature --from-current
git gtr new my-feature --from main --no-copy
After successful creation, tell the user how to access the worktree:
git gtr editor my-featuregit gtr ai my-featurecd "$(git gtr go my-feature)"Use git gtr copy <target> [-- <pattern>...] to copy files from the main repo to a worktree.
Always preview first with --dry-run before copying, unless the user explicitly asks to skip the preview:
git gtr copy my-feature --dry-run -- ".env*"
Then run without --dry-run to execute:
git gtr copy my-feature -- ".env*"
Useful variations:
git gtr copy my-featuregit gtr copy my-feature -- ".env*" "*.json"git gtr copy --all -- ".env*"git gtr copy my-feature --from other-branchgit gtr list
Show the output to the user.
Always ask the user for confirmation before removing a worktree.
Present the command you will run:
git gtr rm my-feature
Optional flags (only use if the user requests):
--delete-branch — also delete the git branch--force — force removal of a dirty worktreeDo NOT use --force unless the user explicitly asks for it.
The agent cannot cd into a worktree — it is anchored to the current project directory. Instead, tell the user how to navigate:
cd "$(git gtr go my-feature)"git gtr editor my-featuregit gtr ai my-featuregit gtr run my-feature <command>If the user wants to run a one-off command in the worktree, use git gtr run:
git gtr run my-feature git status
git gtr run my-feature npm test
git gtr is installed before running commands--dry-run to preview copy operations before executinggit gtr rm--force on rm unless the user explicitly requests it--yes to skip confirmations — let the user reviewnpx claudepluginhub clemux/claude-code-plugins --plugin worktreeAutomates Git worktree creation for isolated feature branches, listing, removal, and status checks. Copies env files like .env/.nvmrc and runs npm/yarn/pnpm/bun install.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.