Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

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…

jamesrochabrunот jamesrochabrun★ 236 звёзд на GitHub29 установок в других каталогах

Об этом скилле

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:

  1. Create worktree for feature A:

    scripts/create_worktree.sh
    # Enter: feature-a
    # Script creates: ../repo-feature-a/
    
  2. Open Claude Code in the new worktree:

    • The script outputs the path
    • Open Claude Code and navigate to that directory
    • Run /init to orient Claude
  3. Give Claude the task:

    "Build the user authentication feature with OAuth support"
    
  4. Continue your work in main:

    • Your original directory is unchanged
    • No conflicts, no waiting
    • Claude works in parallel
  5. 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:

  1. Create refactor worktree:

    scripts/create_worktree.sh
    # Enter: refactor-auth-module
    
  2. Start Claude in refactor worktree:

    "Refactor the authentication module to use dependency injection"
    
  3. Continue your daily work in main:

    • No interruption
    • No merge conflicts
    • Check progress periodically
  4. 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:

  1. Create 3 worktrees:

    scripts/create_worktree.sh  # feature-api-endpoints
    scripts/create_worktree.sh  # feature-ui-dashboard
    scripts/create_worktree.sh  # feature-email-notifications
    
  2. Open 3 Claude Code sessions:

    • Session 1: ../repo-feature-api-endpoints/
    • Session 2: ../repo-feature-ui-dashboard/
    • Session 3: ../repo-feature-email-notifications/
  3. 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"
  4. Monitor progress:

    scripts/list_worktrees.sh
    
  5. Merge 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:

  1. Claude is already working in a feature worktree

    • Let it continue, don't interrupt
  2. Create hotfix worktree from main:

    scripts/create_worktree.sh
    # Enter: hotfix-login-bug
    # Choose base branch: main
    
  3. Fix the bug yourself or with another Claude session:

    cd ../repo-hotfix-login-bug
    # Make fixes
    git add .
    git commit -m "Fix login redirect bug"
    
  4. Merge hotfix to main:

    git checkout main
    git merge hotfix-login-bug
    git push origin main
    
  5. Sync feature worktree with latest main:

    cd ../repo-feature-xyz
    scripts/sync_worktree.sh
    # Merges latest main into feature branch
    

Essential Scripts

scripts/create_worktree.

Полный SKILL.md на GitHub

Установить git-worktrees в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/best_practices.mdreferences/slash_command_template.mdreferences/worktree_commands.mdscripts/cleanup_worktrees.shscripts/create_worktree.shscripts/list_worktrees.shscripts/sync_worktree.sh

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 запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить git-worktrees с