Agents & Orchestration Advanced
Multi-Agent with Worktrees
Run parallel Claude sessions in isolated git worktrees to avoid file conflicts
Command
"color:#9CA3AF;font-style:italic"># Create worktree and run Claude in tmux $ "color:#7C5CFC">claude "color:#d97757">--worktree feature-auth "color:#d97757">--tmux "color:#9CA3AF;font-style:italic"># In another terminal: $ "color:#7C5CFC">claude "color:#d97757">--worktree feature-api "color:#d97757">--tmux
Response
{
"result": "Created src/api/health.ts with GET /health endpoint...",
"total_cost_usd": 0.089,
"session_id": "a4e71c3f-..."
} Parsing Code
059669">">// Each worktree is a separate checkout 059669">">// Sessions 059669">">in different worktrees can't conflict on file writes // Share the same .git directory (git ops can still conflict)
Gotchas
! Each worktree is a separate checkout — no file conflicts between sessions
! Cannot nest Claude sessions — the CLAUDECODE env var prevents launching Claude inside Claude