Skip to content

[FEATURE]: worktree-based workspace switching with stash-based warp #36048

Description

@haxllo

Feature hasn't been suggested before.

  • 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.

what i did

  • CLI: opencode worktree create|list|remove|reset commands
  • TUI: Warp dialog to switch between worktrees via stash-based git worktree
  • Core: Optional directory field on workspace, VCS stash/stashPop endpoints
  • UX: Status indicator, sidebar/footer worktree labels, auto-stash on leave + pop on return

Benefits

  • Switch branches without leaving your opencode session
  • No manual stash management auto stash on leave, auto-pop on return
  • No separate clones needed leverages git worktree
  • Workspace continuity: same project context, just different working tree

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions