Skip to content

Support discovered worktrees and continuing existing branches #1624

Closed

Description

@ryanbbrown

Problem

Thread creation only lists worktrees that belong to active bb environments.
It does not discover persistent Git worktrees that users manage themselves.

New managed worktrees also always create a generated bb branch. Selecting an
existing remote branch uses it as a base instead of checking it out directly.
This makes reopening an existing pull request awkward.

Requested behavior

  • List every Git worktree for the selected project and machine.
  • Show its branch, path, and machine.
  • Treat discovered user worktrees as unmanaged workspaces.
  • Keep user worktrees after their threads are archived.
  • Add New branch and Continue branch modes inside the existing branch picker.
  • Continue a local or remote branch directly in a temporary managed worktree.
  • Configure remote tracking so a normal push updates the existing branch.
  • Remove the temporary worktree after its threads are archived.
  • Preserve the continued branch during cleanup.
  • Reject branches that another worktree already checks out.

This should not change the default managed-worktree cleanup policy.

Reference implementation

A complete implementation is available here:

ryanbbrown@499533b

It includes the app, server, daemon, SDK, CLI, plugin, guide, and test surfaces.

AGENT GENERATED: by GPT-5.6

Activity

  1. added
    workspaces
    on Aug 18, 2026
  2. ryanbbrown commented on Aug 25, 2026

    @ryanbbrown
    ContributorAuthor

    Closing because the remaining external-worktree discovery and branch-continuation gaps are real, but they are no longer important to my BB-managed workflow. I am withdrawing this request.

  3. banjerluke commented on Aug 26, 2026

    @banjerluke

    Well, they're important to my workflow. 😏

    Did my best to get a robust implementation ready for merging in my PR. It's specifically focused on showing existing worktrees in the picker along with bb-managed worktrees, allowing you to continue work in them.

  4. ymichael commented on Sep 19, 2026

    @ymichael
    Collaborator

    Added support for this in #3932

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    workspaces

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions