Worktree

Projects and Git worktrees

Choose a project folder and the checkout where a session works.

A project is a folder on a server. Local Server is the backend running on your computer. A shared server represents projects another computer has shared with you.

Add and manage a project

Use Add project on Home or in Settings → Local Server → Projects. A project does not need to be a Git repository. Its name, icon, and other settings are available from its three-dot menu under Manage project.

The session's three-dot menu also provides Manage project. Settings for a shared project are limited to the operations your host grants you.

Pick an execution environment

For a Git project, a session can work in the local checkout or an available Git worktree. A Git worktree is another checkout of the repository with its own working files. It is different from the Worktree app's name.

The project selector groups projects by server. An unavailable host cannot be selected for a new session. Start in an available local project, or wait for the host to reconnect.

Startup scripts

A project's worktree startup script runs after creating a Git worktree. The OpenCode backend retains its compatibility variables:

  • OPENCODE_WORKTREE_BASE: the base worktree.
  • OPENCODE_WORKTREE_PATH: the newly created worktree.

These names are not renamed to match the Worktree brand. Startup scripts execute code on the machine that owns the checkout.

Shared folders

Project sharing gives collaborators access to the host's live directory; it does not create a copy on their computers. Edits from permitted collaborators affect the host's files. Keep ordinary Git review and backup practices, and read the permission and execution boundary before enabling writes.

On this page