Commands
Full CLI reference — top-level and per-project commands.
Top-level
Run bn doctor first on a fresh machine — it prints exactly what's
missing and the command to fix each thing.
Per-project workflow
The six commands you'll use every day. All accept a [feature] arg
that's optional from inside a worktree (banyan infers from cwd).
Agent modes:
live— conversational, no ceremony. Banyan-aware claude, you drive. Default when no prompt.delegated— pipeline-gated: Setup → Plan → human review → Execute → Report → Done. Loops via Stop hook. Default when-pis given.
Other commands exist for the long tail (rebase, status, resume, restart-orchestrator, ports, close, …). Run bn <project> --help for the full list with flags.
Working on an existing branch
By default bn wt <name> creates feature/<name> — convenient when
you're starting fresh, less so when the branch already exists under a
different naming convention. Two knobs cover the common cases.
--prefix to match your team's convention
The prefix replaces the default feature segment:
| Your existing branch | What to run |
|---|---|
feature/login | bn wt login |
fix/crash-on-startup | bn wt crash-on-startup --prefix fix |
android/refactor/ui-setup | bn wt ui-setup --prefix android/refactor |
hotfix-truc (no prefix) | bn wt hotfix-truc --prefix "" |
Multi-segment prefixes (android/refactor) are supported.
Existing-branch fallback
When the computed branch name (<prefix>/<feature>) already exists
in the repo, banyan checks it out as-is rather than failing. So
spawning a worktree on a branch you already pushed earlier just works:
The agent then sees the existing branch's contents and the worktree runs in parallel to any other features.
Pitfalls
- "branch is already checked out elsewhere" — git refuses to put
the same branch in two worktrees at once. If the branch is currently
checked out in your main repo or in another worktree, switch the
other one off it first (
git switch main) and retry. The reverse also applies: don'tgit switchto a feature's branch in the main checkout while a banyan worktree is using it. - Stale worktrees from pre-v1 layouts — banyan used to put
worktrees in
<repo>-<feature>/sibling folders. v1 usesworktree-<repo>/<feature>/under the repo's parent. If you still have a sibling-style worktree on the same branch, banyan can't reuse it (the name doesn't match the convention). Either move it withgit worktree move <old> <new>or remove it (git worktree remove --force <old>) before re-spawning. - Cleanup is destructive —
bn cleanup <feature>removes the worktree AND deletes the branch. Usebn wt-rm <feature>if you only want to drop the worktree but keep the branch local + remote.
Compose stacks
CWD inference
Inside a configured repo (or worktree, or parent), drop the project name — banyan infers from cwd:
Or symlink to skip the project arg entirely: