worktree
БесплатноБез исполняемых скриптовНе проверенManage git worktrees for parallel Claude Code sessions. Use when user says "worktree", "create worktree", "parallel session", "new tree", or wants to work on…
Об этом скилле
Git Worktree Manager
Manage git worktrees for running parallel Claude Code sessions.
Commands
/worktree create <branch-name> [from <base-branch>]
Creates a new git worktree for parallel development.
Examples:
/worktree create fix-bug- Creates worktree from origin/main/worktree create fix-bug from main- Creates worktree from main branch/worktree create feature-x from develop- Creates from develop
/worktree list
Lists all active worktrees.
/worktree remove [<worktree-name>]
Removes a worktree and its local branch.
Instructions
For create command:
Parse arguments:
<branch-name>: Required, the new branch name<base-branch>: Optional, defaults toorigin/main
Determine paths:
REPO_BASENAME=$(basename "$PWD") WORKTREE_PATH="../${REPO_BASENAME}--${BRANCH_NAME}" ABSOLUTE_PATH=$(cd .. && pwd)/${REPO_BASENAME}--${BRANCH_NAME}Fetch latest:
git fetch originCreate worktree:
git worktree add -b <branch-name> <worktree-path> <base-branch>Install dependencies:
cd <worktree-path> && npm installReturn to original directory
CRITICAL - Output this format at the end:
Worktree created successfully! Branch: <branch-name> Base: <base-branch> Path: <absolute-path> To start a parallel Claude Code session, copy and run: ┌────────────────────────────────────────────────────────────┐ │ cd <absolute-path> && claude │ └────────────────────────────────────────────────────────────┘
For list command:
Run and display output:
git worktree list
For remove command:
If no worktree name provided, show
git worktree listand ask user to specifyParse worktree name to extract branch:
- Worktree format:
<repo>--<branch> - Extract branch: everything after
--
- Worktree format:
Ask for confirmation before proceeding
Remove worktree:
git worktree remove <worktree-path> --forceDelete local branch:
git branch -D <branch-name>Confirm: "Removed worktree and local branch. Remote branch preserved for PR."
Safety Rules
- Always
git fetchbefore creating to have latest refs - Never remove worktrees with uncommitted changes without explicit confirmation
- Never remove the main worktree (one without
--in directory name) - Preserve remote branches when removing (only delete local branch)
- If branch already exists, ask user if they want to use existing or create new name
Troubleshooting
Error: "fatal: '' is already checked out at ''"
Cause: The branch is already in use by another worktree
Solution: Use git worktree list to find the existing worktree, then either remove it or choose a different branch name.
Error: "fatal: a branch named '' already exists"
Cause: Local branch with that name already exists Solution: Ask user if they want to reuse the existing branch or pick a new name.
Worktree remove fails with "contains modified or untracked files"
Cause: There are uncommitted changes in the worktree
Solution: Ask user for explicit confirmation before using --force. Warn about potential data loss.
Установить worktree в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
BashGlobAskUserQuestionFAQ
Что делает скилл worktree?
Manage git worktrees for parallel Claude Code sessions. Use when user says "worktree", "create worktree", "parallel session", "new tree", or wants to work on multiple branches simultaneously.
Как установить скилл worktree?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл worktree запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic