/worktrees:peer <feature> [--id <identifier>]from worktrees
Use for independent development with PR-based integration. Multiple Claude instances work autonomously, each creating PRs to main. Invoke with "/worktrees:peer <feature>" or when user mentions "peer workflow", "independent worktree", "autonomous development", "PR-based workflow", or "multi-instance development".
Ships in worktrees. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Independent development with PR-based integration. Each instance works autonomously, creating PRs to main.
Instance A (worktree-a) Instance B (worktree-b)
├── Creates own worktree ├── Creates own worktree
├── Develops feature X ├── Develops feature Y
├── Creates PR to main ├── Creates PR to main
├── Gets PR merged ├── Gets PR merged
└── Cleans up worktree └── Cleans up worktree
↓ ↓
└──────── main ────────┘
(integration point)
For safe, methodical development in your worktree:
Understand the codebase before making changes:
# Understand project structure
ls -la src/
git log --oneline -10
# Find related code
grep -r "related-pattern" src/
Use Plan Mode for complex changes:
Implement with focused, atomic changes:
Push regularly to maintain progress:
git add <specific-files>
git commit -m "feat(<scope>): <description>"
git push -u origin <branch>
# Ensure .worktrees is gitignored (first time only)
grep -q "^\.worktrees" .gitignore 2>/dev/null || echo ".worktrees/" >> .gitignore
git add .gitignore && git commit -m "chore: add .worktrees to gitignore"
# Create uniquely named worktree
# Pattern: {instance-id}-{feature} or just {feature}
git worktree add -b feature/<id>-<feature> .worktrees/<id> main
cd .worktrees/<id>
Naming options for <id>:
inst-alpha, inst-42, agent-a$(date +%Y%m%d-%H%M)$(uuidgen | cut -c1-6)Work following the Explore-Plan-Code-Commit cycle:
# Make changes, commit atomically
git add src/feature/
git commit -m "feat(<scope>): add main functionality"
git add tests/feature/
git commit -m "test(<scope>): add unit tests"
# Push regularly
git push -u origin feature/<id>-<feature>
# Ensure up to date with main
git fetch origin main
git rebase origin/main
git push --force-with-lease
# Create PR
gh pr create \
--base main \
--title "feat(<scope>): <description>" \
--body "## Summary
<What this accomplishes>
## Changes
- <Change 1>
- <Change 2>
## Affected Areas
- \`src/<area>/\` - <description>
## Does NOT Modify
- <Other areas untouched>
## Testing
\`\`\`bash
npm test src/<area>/
\`\`\`
## Instance Context
- Instance: <id>
- Worktree: .worktrees/<id>
- Independent feature, no coordination needed"
# Monitor status
gh pr status
gh pr checks
# Respond to feedback
gh pr view --comments
# After approval
gh pr merge --squash --delete-branch
# Return to main project directory
cd ../.. # Exit .worktrees/<id> to project root
# Pull merged changes
git checkout main
git pull origin main
# Remove worktree
git worktree remove .worktrees/<id>
# Clean up
git branch -d feature/<id>-<feature> 2>/dev/null
git worktree prune
For complex changes or when touching shared areas:
When to use Plan Mode:
Use PR descriptions to communicate scope:
## Affected Areas
- `src/payments/**` - New payment module
- `src/config/payments.ts` - Payment configuration
## Does NOT Modify
- User authentication
- API routing (new routes only)
- Existing database tables
Informally claim areas during active development:
| Area | Active Instance |
|---|---|
| src/payments/ | Instance Alpha |
| src/dashboard/ | Instance Beta |
git fetch origin main
git rebase origin/main
# If conflicts, resolve:
# Edit conflicting files
git add <resolved-files>
git rebase --continue
git push --force-with-lease
If another PR merged first:
git fetch origin main
git rebase origin/main
# Resolve conflicts
git add .
git rebase --continue
git push --force-with-lease
git worktree list # Find orphaned worktree
git worktree remove .worktrees/<orphaned> --force
git worktree prune
git branch -D feature/<orphaned-branch>
git push origin --delete feature/<orphaned-branch>
gh pr close <number> --comment "Cleaning up abandoned PR"
git push origin --delete feature/<abandoned-branch>
git worktree remove .worktrees/<abandoned> --force
.worktrees/ is in .gitignore# Setup
git worktree add -b feature/inst-alpha-payments .worktrees/inst-alpha main
cd .worktrees/inst-alpha
# Development
mkdir -p src/payments tests/payments
# ... implement ...
git add src/payments/
git commit -m "feat(payments): add Stripe integration"
git push -u origin feature/inst-alpha-payments
# PR
gh pr create --base main --title "feat(payments): Add Stripe integration"
# After merge
cd ../..
git checkout main && git pull
git worktree remove .worktrees/inst-alpha
git worktree prune
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub aaronbassett/agent-foundry --plugin worktrees6 skills in this plugin
/conceptsworktrees:conceptsComprehensive reference for git worktrees. Covers concepts, commands, conflict resolution, and best practices. Invoke with "/worktrees:concepts" or when user mentions "worktree reference", "explain worktrees", "worktree documentation", "worktree commands", "worktree concepts", or "learn about worktrees"./finishworktrees:finishUse when completing work in a worktree. Handles PR creation or direct merge, worktree removal, and branch cleanup. Invoke with "/worktrees:finish" or when user mentions "finish worktree", "clean up worktree", "merge worktree", "done with worktree", or "complete worktree work"./newworktrees:newUse when creating a new git worktree. Handles gitignore setup, worktree creation, and provides guidance. Invoke with "/worktrees:new <name>" or when user mentions "create worktree", "new worktree", "start feature in worktree", or "isolated workspace"./orchestratorworktrees:orchestratorUse for multi-subagent parallel development. A main Claude instance manages multiple concurrent subagents, each working in isolated worktrees. Invoke with "/worktrees:orchestrator <feature>" or when user mentions "orchestrate agents", "parallel subagents", "coordinate development", "multi-agent workflow", "spawn subagents", or "divide feature into tasks"./statusworktrees:statusDisplay comprehensive worktree status including active worktrees, stale references, and uncommitted changes. Invoke with "/worktrees:status" or when user mentions "worktree status", "list worktrees", "check worktrees", "worktree health", or "audit worktrees".Other plugins' skills for the same job