Skip to content

Worktrees Sync

Worktrees keep each agent session isolated so your main local repo stays clean and easy to review.

  1. Start an agent via b2v <agent>.
  2. Let back2vibing create and track the session worktree.
  3. Finish your edits in that isolated workspace.
  4. Open the app’s Sessions tab and click Sync to Local Repo.
  5. Review changes locally and commit.

The Session Dock has two launch actions that are easy to confuse:

  • New worktree session creates a fresh isolated worktree from a home repository, then opens your default agent there.
  • + Agent appears inside an existing worktree group and opens another agent session in that same worktree.

Both dock-launched flows require workmux because Back2Vibing asks workmux to create or open the tmux workspace. If workmux is missing, existing sessions can still be focused from the dock, but new worktree launches will show install guidance.

Use the global New worktree session button when you want a separate coding lane. Use + Agent when you want another agent working inside the already-created worktree.

  • Apply (recommended): safest day-to-day mode.
  • Overwrite: use only when you intentionally want force alignment.
  • Worktree -> Home Repo: use when agent work is done and ready to review or test locally.
  • Home Repo -> Worktree: use when you need baseline local changes inside the session workspace.

The worktree group header can show Sync & Test. This temporarily mirrors one worktree into the Home Repo so you can run your normal local tests and tools. Back2Vibing saves a baseline first, blocks risky states like merge/rebase or unsupported untracked paths, and restores the Home Repo when you stop Sync & Test.

If another worktree is already syncing, the button changes to Switch Sync & Test. Switching means Back2Vibing restores the current Home Repo baseline, then mirrors the selected worktree instead.

You can sync from either the app’s Sessions tab or from terminal:

Terminal window
b2v sync --mode apply

After syncing, continue in Sessions or commit from your local repo.