Let Claude Code manage the worktree for you

ai agents & parallel sessions

// what it does

Claude Code can create and reuse worktrees itself: claude --worktree <name> starts the session inside a managed worktree branched from your current commit, so parallel sessions never collide. Run the same command with different names in separate terminals for instant parallel agents; Claude Code subagents can also run in ephemeral worktrees that are cleaned up automatically when left unchanged.

// shell

$ claude --worktree feature-auth

// gotcha

The repository needs at least one commit — in a brand-new repo the command fails while resolving the base branch. Other harnesses (Codex CLI, Cursor background agents, orchestrators like Orca) have their own equivalents or simply expect to be launched from a worktree you created manually.

// resources