git-worktrees
БесплатноЗапускает вложенные скриптыНе проверенManage Git worktrees for parallel Claude Code development. Use this skill when engineers ask to "create a worktree", "run parallel Claude sessions", "work on…
Об этом скилле
Git Worktrees for Claude Code
Overview
Run multiple Claude Code sessions in parallel on different branches using Git worktrees. This skill provides simple scripts and workflows to set up, manage, and clean up worktrees, enabling true parallel development without conflicts.
Why Worktrees?
- Parallel Development: Run multiple Claude Code instances simultaneously
- Zero Conflicts: Each worktree has independent file state
- Fast Context Switching: No need to stash/commit when switching tasks
- Isolated Experiments: Try different approaches without affecting main work
- Long-Running Tasks: Let Claude work in background while you continue in main
Quick Start
1. Create a New Worktree (Super Easy!)
Just run the interactive script:
scripts/create_worktree.sh
This will:
- ✅ Prompt for feature name
- ✅ Create a new branch
- ✅ Set up the worktree
- ✅ Open in VS Code / editor
- ✅ Give you the Claude Code setup command
That's it! The script handles all complexity.
2. View All Worktrees
scripts/list_worktrees.sh
Shows a clean, formatted list of all your worktrees with their branches and status.
3. Clean Up Old Worktrees
scripts/cleanup_worktrees.sh
Interactive removal of merged or abandoned worktrees.
Core Workflow
Pattern 1: Parallel Feature Development
Scenario: You want Claude to build feature A while you work on feature B.
Steps:
Create worktree for feature A:
scripts/create_worktree.sh # Enter: feature-a # Script creates: ../repo-feature-a/Open Claude Code in the new worktree:
- The script outputs the path
- Open Claude Code and navigate to that directory
- Run
/initto orient Claude
Give Claude the task:
"Build the user authentication feature with OAuth support"Continue your work in main:
- Your original directory is unchanged
- No conflicts, no waiting
- Claude works in parallel
When both are done, merge:
# Review Claude's work cd ../repo-feature-a git log # If good, merge back git checkout main git merge feature-a # Clean up scripts/cleanup_worktrees.sh
Pattern 2: Long-Running Refactor
Scenario: You want Claude to refactor a large module while you continue development.
Steps:
Create refactor worktree:
scripts/create_worktree.sh # Enter: refactor-auth-moduleStart Claude in refactor worktree:
"Refactor the authentication module to use dependency injection"Continue your daily work in main:
- No interruption
- No merge conflicts
- Check progress periodically
Review and integrate when ready:
cd ../repo-refactor-auth-module git log --oneline # Review changes # Merge when satisfied git checkout main git merge refactor-auth-module
Pattern 3: Multiple AI Agents (Advanced)
Scenario: You want 3 Claude instances working on different features simultaneously.
Steps:
Create 3 worktrees:
scripts/create_worktree.sh # feature-api-endpoints scripts/create_worktree.sh # feature-ui-dashboard scripts/create_worktree.sh # feature-email-notificationsOpen 3 Claude Code sessions:
- Session 1:
../repo-feature-api-endpoints/ - Session 2:
../repo-feature-ui-dashboard/ - Session 3:
../repo-feature-email-notifications/
- Session 1:
Assign tasks to each Claude:
- Claude 1: "Build REST API endpoints for user management"
- Claude 2: "Create admin dashboard UI"
- Claude 3: "Implement email notification system"
Monitor progress:
scripts/list_worktrees.shMerge features as they complete:
# Feature by feature git checkout main git merge feature-api-endpoints git merge feature-ui-dashboard git merge feature-email-notifications # Clean up scripts/cleanup_worktrees.sh
Pattern 4: Hotfix While Development Continues
Scenario: Production bug needs immediate fix while Claude is working on a feature.
Steps:
Claude is already working in a feature worktree
- Let it continue, don't interrupt
Create hotfix worktree from main:
scripts/create_worktree.sh # Enter: hotfix-login-bug # Choose base branch: mainFix the bug yourself or with another Claude session:
cd ../repo-hotfix-login-bug # Make fixes git add . git commit -m "Fix login redirect bug"Merge hotfix to main:
git checkout main git merge hotfix-login-bug git push origin mainSync feature worktree with latest main:
cd ../repo-feature-xyz scripts/sync_worktree.sh # Merges latest main into feature branch
Essential Scripts
scripts/create_worktree.
Установить git-worktrees в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл git-worktrees?
Manage Git worktrees for parallel Claude Code development. Use this skill when engineers ask to "create a worktree", "run parallel Claude sessions", "work on multiple features simultaneously", or need help with worktree management.
Как установить скилл git-worktrees?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл git-worktrees запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
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