From tac
Sets up Git worktrees for parallel agent execution with isolated directories, port allocation, environment config, and dependency installs.
npx claudepluginhub melodic-software/claude-code-plugins --plugin tacThis skill is limited to using the following tools:
Guide creation of isolated Git worktree environments for parallel agent execution.
Creates and manages isolated Git worktrees for parallel development tasks, triggered by 'create worktree', worktree setup, or /delegate dispatch for multi-agent workflows.
Creates isolated Git worktrees for parallel development, risky refactoring, or multi-feature work without branch switching or conflicts.
Manages Git worktree lifecycle: creates isolated .claude/worktrees/ for parallel development or experiments, lists rune/* branches, cleans up stale or merged ones. Enforces max 3 active.
Share bugs, ideas, or general feedback.
Guide creation of isolated Git worktree environments for parallel agent execution.
Git worktrees provide:
repository_root/
├── trees/
│ ├── {adw_id}/ # Isolated worktree
│ │ ├── src/
│ │ ├── .ports.env
│ │ └── ...
│ └── ... # Up to 15 concurrent
├── agents/
│ └── {adw_id}/
│ └── adw_state.json
└── main codebase/
Deterministic formula:
slot = hash(adw_id) % 15
backend_port = 9100 + slot
frontend_port = 9200 + slot
Identify where worktrees should live:
Default: trees/{adw_id}/
Alternative: .worktrees/{adw_id}/
Commands to execute:
# Fetch latest
git fetch origin
# Create worktree with new branch
git worktree add trees/{adw_id} -b {branch_name} origin/main
Create .ports.env:
BACKEND_PORT={backend_port}
FRONTEND_PORT={frontend_port}
VITE_BACKEND_URL=http://localhost:{backend_port}
cp .env trees/{adw_id}/.env
cat trees/{adw_id}/.ports.env >> trees/{adw_id}/.env
For any absolute path configurations (MCP, etc.):
cd trees/{adw_id}
# Backend dependencies
cd app/server && uv sync --all-extras
# Frontend dependencies
cd app/client && bun install
After setup, validate:
git worktree list)git worktree remove trees/{adw_id}
# Or force if uncommitted changes
git worktree remove trees/{adw_id} --force
git worktree prune
git worktree list
Provide setup plan:
## Worktree Setup Plan
**ADW ID:** {adw_id}
**Branch Name:** {branch_name}
**Worktree Path:** trees/{adw_id}
### Port Allocation
- Backend: {backend_port}
- Frontend: {frontend_port}
### Commands to Execute
1. `git fetch origin`
2. `git worktree add trees/{adw_id} -b {branch_name} origin/main`
3. Create `.ports.env`
4. Copy and configure environment
5. Install dependencies
### Validation Steps
- [ ] Verify worktree created
- [ ] Test port availability
- [ ] Confirm dependencies installed
| Issue | Solution |
|---|---|
| Worktree already exists | Remove first or use different ID |
| Port in use | Check what's using it, kill or use different |
| Branch exists | Use existing branch or delete first |
| Permission denied | Check directory permissions |
Date: 2025-12-26 Model: claude-opus-4-5-20251101