Worktree Sessions
Worktree sessions let you run multiple parallel OpenCode sessions in isolated git worktrees, each with its own branch and working directory.
What Are Worktrees?
A worktree is a separate working directory linked to the same git repository. Each worktree can be on a different branch, letting the agent work on multiple features simultaneously.
Creating a Worktree
From the project panel, click New Worktree. Name it, select a branch (or create one), and the IDE checks out a new worktree and opens it in a new session.
Switching Between Worktrees
Switch between worktrees from the sidebar. Each worktree maintains its own session history, file tree, and terminal state.