Skip to content

Feature request: import a VS Code multi-root workspace (.code-workspace) into bb #2181

In progress

Description

@HatriGt

🧩 Summary

Add first-class support for importing a VS Code multi-root workspace (.code-workspace) into bb — mapping its folders entries onto bb projects/sources — so users who organize their work as a VS Code workspace can bring everything into bb in one step instead of hand-creating a project per folder.


📖 Background

Today bb's model is:

Project = one repository/directory

A VS Code .code-workspace is a JSON file that lists one or more root folders (frequently several independent repos) alongside editor settings:

{
  "folders": [
    { "path": "services/api" },
    { "path": "services/web" },
    { "path": "../shared-libs" }
  ],
  "settings": { /* ... */ }
}

There is currently no way to:

  • point bb at a .code-workspace file, or
  • represent a multi-root workspace as a group of related projects.

Note: I confirmed there is no existing issue or PR for this. Every "workspace" reference in the repo today concerns bb's own environment/checkout concept (the workspaces label), not VS Code workspaces.


🎯 Use case

I keep a multi-root .code-workspace containing several repos I work on together. To use them in bb today I have to manually run bb project create once per folder and keep them in sync by hand. I'd like bb to read the .code-workspace and set this up automatically.


💡 Proposed behavior

Given a path to a .code-workspace, bb parses each folders[].path (resolving relative paths against the workspace file's location) and applies one of two strategies:

Strategy Behavior
per-folder (recommended) Create one bb project per folder
single Create a single project rooted at the primary folder, with the rest added via bb project source add

Suggested CLI surface

bb project import --from-code-workspace /path/to/my.code-workspace \
  [--strategy per-folder|single] \
  [--machine <id-or-name>]

Suggested desktop surface

  • An "Import VS Code workspace…" action in the project-creation flow.

❓ Open questions

  • Default strategy: per-folder projects vs. single project + multiple sources — or leave it as the --strategy flag above?
  • Should bb map any .code-workspace settings (e.g. ignored paths) onto project config, or use folders only?
  • Naming: derive project name(s) from the workspace filename and/or the individual folder names?

🔀 Alternatives considered

Manually creating one project per folder — works, but it's tedious and drifts out of sync whenever the workspace's folder list changes.

Activity

  1. added
    workspaces
    cli
    on Aug 21, 2026
  2. timurkhakhalev commented on Oct 9, 2026

    @timurkhakhalev
    Contributor

    Proposal: one project with multiple folders, following Codex

    I would like to support working across related repositories in a single bb project and thread—for example, updating an API and its frontend together. Importing a .code-workspace file would then populate that project's folders.

    Reference behavior

    The Codex project documentation describes this model:

    • A project has one primary folder and additional attached folders. Folders do not have to be Git repositories.
    • New chats start in the primary folder. The agent can search, read, and edit files in all attached folders.
    • Automatic discovery of AGENTS.md, skills, and project configuration uses the primary folder; secondary folders do not automatically contribute those files.
    • The review pane can show changes across attached repositories.
    • PR and worktree actions target the primary repository. Additional folders remain attached when a chat starts in a worktree.

    The last point matters: a worktree isolates the primary repository only. Secondary repositories still use their attached checkouts, which may be shared by multiple threads. The UI should make that behavior clear.

    How this fits bb's current model

    Existing project sources represent machine-local checkouts. They are not currently a list of repositories available together: the database enforces one source per (projectId, hostId), and workspace routing resolves a single path.

    Public source references at ba5a4c546e7819aa0209371e8045a96f7782aa1a:

    Consequently, the issue's single strategy needs multi-folder execution support; repeatedly calling project source add on the same machine would not provide it today.

    Proposed model

    A small extension worth considering is to keep the existing primary source path and attach additional paths to that source. An illustrative shape, not a finalized API contract:

    type ProjectSourceFolders = {
      hostId: string;
      path: string;
      additionalPaths: string[];
    };

    Here, path is the primary folder on the source's machine. additionalPaths contains the other attached folders on that same machine. Existing sources would migrate with an empty list. This preserves machine-specific path ownership without introducing a separate repository-management model.

    Expected behavior:

    1. Project settings: add/remove folders and choose the primary folder. Removing a folder detaches it without deleting files. Paths are validated on the source's machine and duplicates are rejected.
    2. Execution: use the selected environment's primary path as cwd; provide the additional folders as explicit workspace roots and list them in the agent's context. In a primary worktree, retain the additional folders at their attached paths. Resolve required Git metadata write paths for attached worktrees as well.
    3. Session lifecycle: apply folder changes at a turn boundary, reconciling or recreating provider sessions as required. Removing a folder must remove its workspace grant from subsequent turns; full-access permission mode retains its existing semantics. Changing the primary folder affects new environments, without relocating existing threads. Keep the project's Git remote anchor consistent with the chosen primary repository.
    4. Files and changes: search and file mentions cover every attached folder. Group Git changes by repository, use each repository's own Git context, and disambiguate identical relative filenames. PR creation and managed worktree creation continue to target the primary repository.
    5. Provider support: reuse the existing additional-workspace-root plumbing where applicable, but verify actual read/write behavior for each supported provider. Do not silently launch with fewer folders when a path is unavailable or a provider cannot support the requested setup.
    6. Public surfaces: expose folder management through the UI, SDK, and CLI. Update server/daemon contracts and the protocol version where required.

    Suggested implementation sequence

    First PR: multi-folder projects. Deliver folder management, agent execution and resume, file discovery, and changes grouped by repository.

    Follow-up PR: .code-workspace import. Resolve folders[].path relative to the workspace file, preview the folder list and primary selection, then populate the same model. Import folder entries only initially; editor settings and ongoing synchronization with the file can remain separate work.

    Acceptance scenarios

    • One thread edits two independent repositories, and both diffs are visible.
    • Resume preserves access to all attached folders.
    • Starting in a primary worktree retains secondary folders without creating worktrees for them.
    • Removing a folder updates the next turn's workspace roots.
    • Missing folders and duplicate paths produce clear errors.
    • A project with one folder retains its existing behavior.

    This is a design proposal based on public documentation and source inspection; provider behavior has not yet been validated end to end.

    AGENT GENERATED

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

    cliworkspaces

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions