| name | arb |
|---|---|
| description | Manages Arborist (arb) multi-repo workspaces built on Git worktrees. Use when user wants to start a new feature across repos, check workspace status, sync branches, push or pull changes, rebase or merge, create or remove workspaces, or work with multiple repositories as a coordinated unit. Activates when user mentions "arb", "worktree", "workspace" in a multi-repo context, or when the current directory contains .arb/ or .arbws/ markers. |
| allowed-tools | Bash |
Arborist manages parallel multi-repo development using Git worktrees. The key concepts:
- Arb root — A directory containing
.arb/withrepos/inside it. This is where canonical repo clones live and workspaces are created. - Canonical repos (
.arb/repos/<name>) — Bare-ish clones in detached HEAD. Never work in these directly. - Workspace — A directory at the arb root level containing
.arbws/marker. Each workspace holds worktrees for one or more repos, all on the same feature branch. - Worktree — A Git worktree inside a workspace, linked back to the canonical repo. This is where actual development happens.
Directory layout:
my-project/ # arb root (.arb/ here)
├── .arb/repos/ # canonical clones
│ ├── frontend/
│ └── backend/
├── feature-login/ # workspace (.arbws/ here)
│ ├── frontend/ # worktree on branch feature-login
│ └── backend/ # worktree on branch feature-login
└── fix-auth/ # another workspace
└── frontend/
All worktrees in a workspace share the same branch name. Workspaces are isolated — changes in one never affect another.
Before acting on any arb-related request, determine where you are:
- Inside a workspace —
.arbws/exists in the current directory or a parent. Runarb status --jsonfor structured per-repo state. - At arb root —
.arb/exists but no.arbws/. Runarb listto show all workspaces. - Outside arb — Neither marker found. Inform the user they're not in an arb project. Offer
arb initif they want to set one up.
To detect context programmatically, check for .arb/ or .arbws/ in the current directory and parents. When inside a workspace, arb status --json is the primary interface for understanding workspace state.
- Run
arb list -qto see existing workspaces (quick mode, skips status) - Derive a kebab-case workspace name from the feature description
- Create:
arb create <name> -a -y-aincludes all repos (omit to select specific repos)-yskips confirmation (required — Claude has no TTY)-b <branch>for a custom branch name (defaults to workspace name)--base <branch>to branch from something other than the default branch
- Navigate into the created workspace to begin work
arb status— Human-readable overview of all repos in the workspacearb status --json— Machine-readable output for parsingarb status --fetch— Fetch remotes first for up-to-date infoarb status -d— Only show repos with uncommitted changesarb status -r— Only show repos that need attention (unpushed, drifted, dirty)
Key signals in status output:
- dirty — Staged, modified, or untracked files exist
- unpushed — Local commits not yet on the remote
- behind base — Base branch (e.g., main) has moved ahead; consider rebasing
- behind remote — Remote feature branch has commits you don't have; consider pulling
- drifted — Worktree is on the wrong branch (rare, usually manual intervention)
- Prefer
arb rebase -y(cleaner history) unless user explicitly requests merge arb merge -yfor merge-based workflows- Both commands fetch first, then show a plan before proceeding
- On conflict, arb reports which repos have conflicts and continues with the rest
- To resolve conflicts in a specific repo:
cdinto that repo's worktree directory- Fix the conflicting files
git add .git rebase --continue(orgit merge --continue)- Return to workspace root
- After resolving all conflicts,
arb push -f -yto force-push the rebased branches
- Run
arb statusfirst to understand what will be pushed arb push -y— Push all repos with unpushed commitsarb push -f -y— Force push with lease (required after rebase)arb push repo1 repo2 -y— Push only specific repos
arb pull -y— Pull the feature branch from the remote for all reposarb pull --rebase -y— Pull with rebase instead of merge
- Always confirm with the user before removing a workspace — this is destructive
arb remove <workspace>— Remove workspace and its worktrees-dflag also deletes remote branches-fflag skips safety checks (uncommitted changes, unpushed commits)--all-okremoves all workspaces that have clean status
- Work from the workspace root for full visibility across all repos
- Navigate into individual worktrees to edit files, then return to workspace root
arb exec <command>runs a command in each worktree sequentially (e.g.,arb exec npm install)arb exec --dirty git diffruns only in repos with local changesarb open codeopens all worktrees in VS Code- After making changes across repos,
arb push -ypublishes everything at once - Use
arb add <repo>to add more repos to an existing workspace - Use
arb drop <repo>to remove repos you no longer need in the workspace
CRITICAL: Claude runs without a TTY. Always follow these rules:
- Always pass
-y/--yestocreate,remove,pull,push,rebase, andmergeto skip confirmation prompts. Without-y, these commands will hang waiting for input. - Use
--jsononarb statusorarb listwhen you need to parse the output programmatically. arb list -qfor fast workspace listing without status computation.- Exit codes: 0 = success, 1 = expected failure (conflicts, nothing to do), 2 = unexpected error.
Commands that do NOT need -y: init, clone, repos, list, path, cd, add, drop, status, fetch, exec, open.
- Always use
arbcommands instead of rawgitwhen inside a workspace — Usearb pushinstead ofgit push,arb pullinstead ofgit pull,arb rebaseinstead ofgit rebase, etc. Arb commands handle worktree-specific concerns (tracking, remote resolution, multi-repo coordination) that raw git does not. Only fall back to raw git for operations arb doesn't cover (e.g.,git add,git commit,git diff). - Never
arb removewithout user confirmation — This deletes worktrees and cannot be undone. Always ask first. - Never use
--forceon remove without user consent — Bypasses dirty/unpushed safety checks. - Prefer rebase over merge unless the user explicitly asks for merge.
- Run
arb statusbefore sync operations to understand current state before rebasing, merging, pushing, or pulling. - Guide through conflicts — When conflicts occur, walk the user through resolution repo by repo. Do NOT force-skip or abort without asking.
- Force push only after rebase —
arb push -f -yuses--force-with-leaseinternally, but only use it when branches have been rebased.
| Command | Description |
|---|---|
arb init [path] |
Initialize a new arb root |
arb clone <url> [name] |
Clone a repo into .arb/repos/ |
arb repos |
List all cloned repos |
arb create [name] [repos...] |
Create a new workspace |
arb remove [names...] |
Remove workspaces |
arb list |
List all workspaces |
arb path [name] |
Print path to arb root, workspace, or worktree |
arb cd [name] |
Navigate to a workspace |
arb add [repos...] |
Add worktrees to current workspace |
arb drop [repos...] |
Remove worktrees from current workspace |
arb status |
Show workspace status |
arb fetch |
Fetch all repos from remotes |
arb pull [repos...] |
Pull feature branch from remote |
arb push [repos...] |
Push feature branch to remote |
arb rebase [repos...] |
Rebase onto base branch |
arb merge [repos...] |
Merge base branch into feature |
arb exec <cmd> |
Run command in each worktree |
arb open <cmd> |
Open worktrees in an application |
For complete flag details, see references/commands.md.