Command Palette

Search for a command to run...

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

parallel-worktrees

БесплатноБез исполняемых скриптовНе проверен

Parallel development using git worktrees with Claude Code subagents. Use when spawning multiple async Claude agents across isolated worktrees, running…

SpillwaveSolutionsот SpillwaveSolutions★ 16 звёзд на GitHub

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

Parallel Worktrees with Claude Code Subagents

Run multiple Claude Code agents simultaneously across git worktrees to transform a single developer into a team of AI engineers. LLM non-determinism becomes an advantage: running N parallel agents produces multiple valid solutions to choose from.

Table of Contents

Core Workflow

  1. Create isolated worktrees for each task
  2. Spawn independent Claude sessions in each
  3. Cycle through to monitor progress and approve permissions
  4. Merge the best results

Git Worktrees Essentials

Worktrees create additional working directories sharing a single .git database. Unlike cloning, they save disk space and keep history unified.

Key Commands

# Create worktree with new branch from main
git worktree add ../project-feature-a -b feature-a main

# Create worktree for existing branch
git worktree add ../project-bugfix bugfix-123

# Organized subdirectory pattern (recommended)
mkdir -p .worktrees && echo ".worktrees/" >> .gitignore
git worktree add .worktrees/feature-auth -b feature/auth main

# List all worktrees
git worktree list

# Remove worktree (use --force if uncommitted changes)
git worktree remove ../project-feature-a

# Clean stale metadata
git worktree prune

Directory Patterns

Adjacent folders: my-project/, my-project-feature-a/, my-project-bugfix/

Subdirectory pattern (keeps things organized):

my-project/
├── .worktrees/
│   ├── feature-auth/
│   ├── feature-api/
│   └── bugfix-login/
└── (main working tree)

Claude Code Subagents

Subagents are specialized AI assistants with isolated context windows, custom prompts, and configurable tool access.

Built-in Subagents

Subagent Model Tools Purpose
General-Purpose Sonnet All (read/write) Complex multi-step operations
Plan Sonnet Read-only Gather info before planning
Explore Haiku Read-only Fast code analysis

Creating Custom Subagents

Interactive: /agents command opens management menu (recommended)

File-based: Place markdown with YAML frontmatter in:

  • .claude/agents/*.md (project-scoped)
  • ~/.claude/agents/*.md (user-scoped)
---
name: code-reviewer
description: Expert code review specialist. Use PROACTIVELY after changes.
tools: Read, Grep, Glob, Bash
model: inherit
---

Acts as a senior code reviewer. When invoked:
1. Run git diff to see changes
2. Focus on modified files
3. Prioritize: Critical → Warnings → Suggestions

Note: Including "PROACTIVELY" or "MUST BE USED" in descriptions increases automatic invocation.

Spawning Parallel Agents

True parallelism requires separate Claude processes in different worktrees. Within a single REPL, subagents execute sequentially.

# Terminal 1
cd ../project-feature-a && claude

# Terminal 2
cd ../project-feature-b && claude

# Terminal 3
cd ../project-refactor && claude

Quick Setup Script

#!/bin/bash
# spawn-parallel.sh FEATURE_NAME NUM_AGENTS
FEATURE=$1
NUM=${2:-3}

for i in $(seq 1 $NUM); do
  git worktree add ".worktrees/${FEATURE}-${i}" -b "${FEATURE}-${i}" main
  cp .env ".worktrees/${FEATURE}-${i}/" 2>/dev/null || true
done

echo "Worktrees created. Start Claude in each:"
for i in $(seq 1 $NUM); do
  echo "  cd .worktrees/${FEATURE}-${i} && claude"
done

Custom Slash Commands

Create .claude/commands/init-parallel.md:

Create $NUM git worktrees for parallel development of $FEATURE.
1. Create .worktrees/ directory if needed
2. For each tree (1 to $NUM):
   - Create worktree at `.worktrees/$FEATURE-{i}/`
   - Create branch `$FEATURE-{i}`
   - Copy environment files
3. Print commands to start Claude in each

Workflow Patterns

Pattern 1: Parallel Feature Implementation

Create 3-4 worktrees for the same feature, give each identical instructions, compare results, merge best implementation.

Pattern 2: Explore, Plan, Code, Commit

  1. Ask Claude to read relevant files (no writes)
  2. Use thinking keywords ("think hard", "ultrathink") for extended reasoning
  3. Have Claude create a plan document
  4. Implement and commit

Pattern 3: Test-Driven Parallel

  1. First Claude writes tests, confirms they fail, commits
  2. Second Claude (or /clear) implements to pass tests
  3. Third independent review catches overfitting

Pattern 4: Dual Claude Verification

  1. One Claude writes code
  2. Afte
Полный SKILL.md на GitHub

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

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

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

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

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

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

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

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

README.md

FAQ

Что делает скилл parallel-worktrees?

Parallel development using git worktrees with Claude Code subagents. Use when spawning multiple async Claude agents across isolated worktrees, running parallel implementations, coordinating multi-agent workflows, leveraging LLM non-determinism for multiple solutions, or running background agents that signal completion. Triggers on "parallel agents", "worktrees", "subagents", "async Claude", "spawn agents", "parallel development", "multi-agent workflow", "background agents", "agent coordination", "parallel tasks".

Как установить скилл parallel-worktrees?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл parallel-worktrees запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

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

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