You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: worktree-based workspace switching with stash-based warp #36048
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Add workspace-level worktree support to the core workspace system: CLI commands (opencode worktree create|list|remove|reset) and TUI dialog integration that lets users switch between working copies via git worktree without leaving their current session.
why it matters
working on multiple branches simultaneously is a common workflow. Previously, users had to either:
Manually manage separate clones
Use git worktree externally and relaunch opencode
Stash/discard uncommitted work manually
None of these preserve session continuity when switching context.
Please review these issues and comment on how your request differs if it does.
#35525 is the same high-level need (workspace on different branch). #36048 adds the specific implementation design (worktree CLI subcommands + stash-based warp). My PR #36052 implements it. #35471 (CLI flag) and #33332 (configurability) are complementary, different approaches or extensions Not a duplicate.
The current behavior is worth calling out explicitly because it's not just "no worktree support" — it's actively misleading. The sidebar git label is resolved once at launch against the workspace root (the launch directory), via git symbolic-ref --short HEAD. That command is itself worktree-aware, but it's only ever run in the launch dir. So when I start opencode in the main repo and then create/enter a worktree to do branch work, the sidebar stays pinned at projectname:main for the entire session even though git symbolic-ref in the worktree correctly returns feature/foo.
The workflow we want this for: create the worktree from inside opencode, and have the sidebar reflect the tree the session is actually operating in. Today we launch opencode from the main repo and choose the launch directory up front, committing to it for the whole session. If opencode worktree create + the warp dialog move us between trees mid-session, the sidebar needs to follow, otherwise the label and the working tree disagree and the agent's mental model of "what branch am I on" comes from grepping git branch in bash output rather than the UI.
+1 to the scope as proposed — the stash-on-warp semantics are the right call for preserving uncommitted state. The one piece I'd add to the acceptance criteria: the sidebar label (and any status-bar branch indicator) must re-resolve from the active worktree, not the launch dir, after every warp.
Activity
github-actions commentedon Jul 9, 2026
This issue might be a duplicate of existing issues. Please check:
Please review these issues and comment on how your request differs if it does.
haxllo commentedon Jul 15, 2026
#35525 is the same high-level need (workspace on different branch). #36048 adds the specific implementation design (worktree CLI subcommands + stash-based warp). My PR #36052 implements it. #35471 (CLI flag) and #33332 (configurability) are complementary, different approaches or extensions Not a duplicate.
@jlongster
prestonbrown commentedon Aug 10, 2026
The current behavior is worth calling out explicitly because it's not just "no worktree support" — it's actively misleading. The sidebar git label is resolved once at launch against the workspace root (the launch directory), via
git symbolic-ref --short HEAD. That command is itself worktree-aware, but it's only ever run in the launch dir. So when I start opencode in the main repo and then create/enter a worktree to do branch work, the sidebar stays pinned atprojectname:mainfor the entire session even thoughgit symbolic-refin the worktree correctly returnsfeature/foo.The workflow we want this for: create the worktree from inside opencode, and have the sidebar reflect the tree the session is actually operating in. Today we launch opencode from the main repo and choose the launch directory up front, committing to it for the whole session. If
opencode worktree create+ the warp dialog move us between trees mid-session, the sidebar needs to follow, otherwise the label and the working tree disagree and the agent's mental model of "what branch am I on" comes from greppinggit branchin bash output rather than the UI.+1 to the scope as proposed — the stash-on-warp semantics are the right call for preserving uncommitted state. The one piece I'd add to the acceptance criteria: the sidebar label (and any status-bar branch indicator) must re-resolve from the active worktree, not the launch dir, after every warp.
github-actions commentedon Oct 11, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.