Bug: git worktree fails with 'branch already used' when parallel agents attempt same branch
Resolved 💬 2 comments Opened Feb 2, 2026 by minislively Closed Mar 2, 2026
Bug Description
When oh-my-claudecode orchestrates parallel tool calls (e.g., ultrawork mode), multiple agents may attempt to create git worktrees with the same branch name simultaneously, causing exit code 128 errors.
Error Output
Error: Sibling tool call errored
Error: Exit code 128
새로 만든 'bugfix/workflow-start-node-position' 브랜치로 전환합니다
작업 트리 준비 중 ('bugfix/workflow-start-node-position' 가져오중)
fatal: 'bugfix/workflow-start-node-position' is already used by worktree at '/Users/veluga/Documents/misc/veluga-frontend'
M src/components/features/Pages/Workflow/components/builder/WorkflowBuilderInner.tsx
M src/components/features/Pages/Workflow/components/panels/HttpRestNodeForm/index.tsx
M src/components/features/Pages/Workflow/components/panels/PropertyPanel/NodePropertyForm.tsx
Expected Behavior
- Parallel agents should not collide on branch names when creating worktrees
- Each agent should use a unique branch name (e.g., append a suffix or agent ID)
- Or: agents should check if a worktree with that branch already exists before attempting to create one
Reproduction Steps
- Activate ultrawork or parallel execution mode
- Have multiple agents attempt to create worktrees for related bugfixes
- If two agents pick the same branch name, one will fail with exit code 128
Environment
- oh-my-claudecode (latest)
- macOS
- Git worktree-based parallel execution
Suggested Fix
- Before
git worktree add, checkgit worktree listfor existing worktrees using the target branch - If branch already in use, either reuse the existing worktree or append a unique suffix (e.g.,
-2,-agent-id) - Handle the error gracefully instead of failing the entire sibling tool call
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗