Multi-agent repo coordination - clone repos and create isolated worktrees for parallel Claude sessions
Manages isolated Git worktrees for parallel development across multiple Claude sessions.
/plugin marketplace add getnexar/clue/plugin install getnexar-clue@getnexar/clue<action> [args]commands/Smart multi-agent repository coordination. Ensures each Claude session works in an isolated worktree to prevent conflicts.
When multiple Claude sessions work in the same workspace, follow these rules:
repos/ directory - All cloned repos live in repos/<repo-name>/repos/<repo-name>-<branch>/workspace/
├── repos/
│ ├── <repo-name>/ # Main clone (shared, don't modify)
│ ├── <repo-name>-<branch>/ # Worktree for session A
│ └── <repo-name>-<branch2>/ # Worktree for session B
Branch names are normalized for filesystem: feature/auth becomes feature-auth
Parse $ARGUMENTS to determine which action to run:
/clue-repo work <url-or-name> <branch>Setup an isolated worktree for this session. Smart behavior:
https://github.com/org/myapp.git → myapp)repos/<repo-name>/
git -C repos/<repo-name> fetch --all)/ with -repos/<repo-name>-<branch>/
cd repos/<repo-name>
git worktree add -B <branch> ../<repo-name>-<normalized-branch>
Examples:
/clue-repo work https://github.com/org/api.git feature/auth
# Creates: repos/api/ (clone) + repos/api-feature-auth/ (worktree)
/clue-repo work api fix/bug-123
# Uses existing repos/api/, creates repos/api-fix-bug-123/
/clue-repo cleanup <repo-name> [branch]Remove a worktree or the entire repo.
With branch specified:
repos/<repo-name>-<branch>/
cd repos/<repo-name>
git worktree remove ../<repo-name>-<normalized-branch>
Without branch (cleanup entire repo):
rm -rf repos/<repo-name>Examples:
/clue-repo cleanup api feature-auth
# Removes repos/api-feature-auth/ worktree
/clue-repo cleanup api
# Removes all api worktrees + repos/api/
/clue-repo status [repo-name]Show repository and worktree status.
With repo name:
cd repos/<repo-name>
echo "=== Main clone ==="
git -C repos/<repo-name> branch -vv
echo ""
echo "=== Worktrees ==="
git -C repos/<repo-name> worktree list
echo ""
echo "=== Worktree Status ==="
# For each worktree, show: path, branch, uncommitted changes (yes/no)
Without repo name: Show status for all repos in repos/
/clue-repo listList all repos and their worktrees in tree format:
echo "repos/"
for repo in repos/*/; do
if [ -d "$repo/.git" ] || [ -f "$repo/.git" ]; then
name=$(basename "$repo")
echo "├── $name/"
git -C "$repo" worktree list --porcelain | grep "^worktree" | while read -r line; do
wt_path="${line#worktree }"
wt_name=$(basename "$wt_path")
if [ "$wt_name" != "$name" ]; then
echo "│ └── $wt_name (worktree)"
fi
done
fi
done
-B flaggit worktree prune before operations-2) or different nameProvide clear, actionable error messages:
repos/ directory should be created at workspace root if it doesn't existgit worktree add -B to create-or-reset the branch (handles existing local branches)