mBm TUI (mbm2)
Menu

Teamwork: Hand-Off, Board, Pipelines, Messages

Feature Key (default) Who moves the work Needs
Hand-off <leader>f You: text from one tab goes to another Two open tabs
Task board <leader>k You and the agents: one list of tasks per project Nothing
Pipeline <leader>j You confirm each step; tabs run in a fixed order pipelines in the workers file
Team messages /team or <leader>shift+i The agents message each other; you approve Workers, and the runtime on this machine
mbm2 send A command Another agent messages a session from outside the window The running mbm2 engine, or the relay
Lead delegation /team lead <worker> A lead agent hands tasks to workers, each in its own git worktree; you approve every merge Workers, a git repository for isolation
Peers /team peer add <name> An agent outside mbm2 (Claude Code, Codex, another mbm2) messages the team through tui.mbm.mn/relay; you approve mbm2 auth mbm (an mBm key)
The team store mbm2 team … (or mteam …), /team inbox The project's roles hand each other work as files in the project's own .mbm2/team, its history kept in the project's git remote mbm2 team init or mbm2 team import once (The team store)

Parallel work inside one session — background subagent tasks in their own worktrees, started by the agent or by your /delegate — needs no workers at all: see Parallel work. Use a lead when you want each part in a tab of its own that you can open and talk to.

The first four work across the tabs of one project (Workers). They differ in who decides: a hand-off and a pipeline step move only when you press return; team messages are written by the agents and wait for your approval unless you turn auto mode on.

A Worked Example

Project shop-api with three workers: builder (session, build), tests (session, safe) and claude (terminal). Goal: add retries to the cart fetch.

  1. In main (agent plan) ask: Plan retries for the cart fetch: code change and tests, as two tasks.
  2. When it answers, press <leader>f, pick builder, return. The plan is in builder's prompt. Press return there to send it.
  3. Press <leader>k: the board now holds Add retries… owned by builder. Press n, type Cover the retry path, return, then o until the owner is tests.
  4. While builder works its tab shows a turning spinner (⠋); when it needs approval it shows ! and the bar says builder needs you — alt+2.
  5. /overview shows all three cards; open tests with alt+3 and ask it to write the tests.
  6. Or let them talk: ask main to coordinate with the team tools (below) and approve each message in /team.

Hand Off Text

  1. In the source tab, select text with the mouse, or select nothing to use the tab's last reply.

  2. Press <leader>f. The bar lists the other open tabs and the size:

    send to:  builder   tests   claude                 412 chars · enter send · esc cancel
    
  3. Pick a target with the arrow keys or tab, press return; esc sends nothing.

Target What happens Toast
Session tab with a free prompt The text lands in its prompt as From main: plus the text; focus moves there. Nothing is sent until you press return in builder's prompt — enter sends
Attached terminal tab The text is pasted into the program as one bracketed paste (at most 64 KiB); focus stays sent to claude — alt+4
A tab that is busy or too small an input Nothing is sent builder has no prompt or terminal free to take it, too large for claude's terminal input

Every delivered hand-off adds a task owned by the target to the board, with ← main <session> as its source. With no selection and no reply yet: nothing to hand off: select text or wait for a reply; with one tab: open another worker first: <leader>w.

Track Tasks On The Board

<leader>k shows the project's tasks over the tab body:

Tasks  n new · enter state · o owner · d delete · esc close
[todo]  builder (alt+2)          Add retries to the cart fetch  ← main ses_…
[doing] tests (alt+3)            Cover the retry path
[done]  main (alt+1)             Plan retries
Key Action
n New task: type the title after New task:, return saves, esc cancels; the owner is the focused tab
return or s Next state: todo → doing → review → done → todo
o Next owner: main, then every worker in the file
d Delete the task
up/k, down/j Move
esc, q Close the board

An empty board says No tasks yet. A hand-off adds one; n adds one here. Tasks are stored per project in kv.json on this machine; the board never writes the runtime's own todo list. Agents read and change the same board with the team tools list_tasks, add_task and update_task.

Run A Pipeline

A pipeline is an ordered list of at least two worker names in the workers file:

{ "pipelines": [ { "name": "plan-then-build", "steps": ["reviewer", "builder"] } ] }
  1. Press <leader>j. The first pipeline starts and its first step opens: pipeline plan-then-build: reviewer (1/2).
  2. Give the step its task. When its turn ends the bar suggests the next one: reviewer done — send to builder? <leader>j.
  3. Press <leader>j. The hand-off bar opens with that step's reply and only the next worker as target; return sends and advances, esc stays on the current step.
  4. After the last step's turn: builder done — pipeline plan-then-build complete, <leader>j ends it; <leader>j then says pipeline plan-then-build finished.
Rule Detail
Confirm every step A pipeline never sends text or advances without your return
No reply yet reviewer has no reply to pass on yet
Closing the current step's tab Stops the run: pipeline stopped: its current worker was closed
Several pipelines Only the first in the file starts with <leader>j
No pipeline no pipelines in .mbm/workers.json
Restart A run is not restored after mbm2 exits

Let Workers Message Each Other

When the project has workers and the runtime runs on this machine, mbm2 starts a small message server on 127.0.0.1 for this run and registers it with the runtime as the MCP server mbm2_team. Every session on that runtime (main and the session workers) and every claude terminal worker gets its five tools:

Tool What an agent can do with it
list_workers List the team: name, kind, agent, whether its tab is open, status (working, needs the user, idle, closed)
send_message Send text to a worker by name, or to user (you)
list_tasks Read the board: index, title, owner, state
add_task Add a task with a title and an owner
update_task Change a task's state (todo, doing, review, done) or owner

Example prompt for main:

You lead this change. Call list_workers. Send builder the code change and tests the test plan
with send_message, add one board task for each with add_task, and send me (to: "user") a short
summary when both report back.

Approve Messages

By default every message waits for you. A toast says main → tests waiting — <leader>shift+i and the bar shows needs you 1 · <leader>i. Open the panel with /team or <leader>shift+i:

Team messages · auto off — you approve each message

held     main → tests  Write tests for the retry path in internal/cart
sent     main → builder  Add retries with backoff to fetchCart

  Write tests for the retry path in internal/cart: success after one retry, give up after three.
enter send · d drop · a auto on/off · esc close
Key Action
return Send the highlighted held message
d Drop it
a Auto mode on or off; the choice is saved as team_auto in the global mbm2.json
p The agent relay's peers, when it is connected: external agents that message the team as peer:<name>
up/k, down/j Move; the full text of the highlighted message shows below the list
esc, q Close

States: held (waiting for you), approved (waiting for the target to take input), sent, dropped, to you. A message to user is shown as a toast, for example tests → you: 2 tests added.

How A Message Arrives

Target Delivery
Session tab Submitted as a new prompt when the session is free
Terminal tab mBm pastes only into a recognizable empty input. Claude Code, Codex and agy tabs try Enter by default when mBm can identify the draft it just pasted. Other runners never get automatic Enter.
A worker that is not open Its tab opens in the background; delivery waits until it takes input (a new terminal tab gets 4 s to start)

Automatic submission in a terminal is best effort. delivered means mBm saw the draft clear and a turn start; there is no runner receipt. If Needs You says the message may not have been sent, check the target tab before retrying. To review and submit messages yourself, set "team_submit": false on the worker in workers.json. When it can safely paste, mBm leaves the message as pasted; inspect the draft and press Enter yourself.

The text the target receives:

From main:

Write tests for the retry path in internal/cart: success after one retry, give up after three.

(Team message. If main needs an answer or a result, send it with the mbm2_team send_message tool,
to: "main". Do not send acknowledgements or thanks.)

Two Windows In One Project

Every mbm2 window of yours shares one engine (Connect), and the windows open in one project share its team. Each window keeps its own workers, its own messages panel and its own board; the agents see the other window's workers with the window's number after an @:

Name in list_workers Who it is
tests The tests worker of the agent's own window
tests@2 The tests worker of the second window opened in this project

A message to tests@2 waits in the second window's /team panel (or is delivered there in auto mode) and arrives as From main@1:, so the answer goes back to main@1. Quitting a window takes only its own workers off the team; the others keep messaging. Board tasks name the workers of their own window.

Auto Mode

With auto mode on, messages go straight through: the panel reads auto on — 20 left before you act again. After 20 deliveries without you (your budget, set with /config → Team auto budget or "team_auto_budget" in mbm2.json, 1 to 1000) the next messages wait, and /team asks what to do; with the panel closed a toast points there (team auto spent its 20 messages; 1 waiting — <leader>shift+i to continue):

Choice Effect
Continue (+20) Delivers up to another budget's worth now
Set limit… Asks a number from 1 to 1000, saves it as team_auto_budget and continues with it
Stop Auto stays on; the waiting messages stay held until you press return on them

←/→ choose, return confirms. A return you press in any prompt refills the count too. Turn auto on permanently with "team_auto": true in mbm2.json (Configuration cookbook).

Messages From Outside: Peers

A peer is an agent outside this mbm2 — Claude Code on your laptop, Codex on a server, another mbm2 — that reaches the team through the agent relay on tui.mbm.mn. mbm2 keeps one outgoing connection to the relay while an mBm key is stored (mbm2 auth mbm or mbm2 license apply), so nothing listens on your machine.

Step What you do or see
Add /team peer add laptop shows a token mbr_… once and the claude mcp add … and codex mcp add … commands
Connect Run the command in that agent's terminal; it gets the tools list_workers, send_message, wait_messages, read_messages
Receive Its message arrives from peer:laptop and follows the rules above: held while auto is off, delivered within the budget while it is on
Answer A worker replies with send_message to "peer:laptop"; a reply to a peer is sent at once, never held
Manage p in /team or /team peer lists peers with when each was last seen; ctrl+d or /team peer -laptop revokes

The second line of /team shows the relay: Relay connected · 2 peers · p peers, Relay retrying — <error> or Relay off. Messages are text only, at most 16 KiB, and the relay keeps them until delivery (at most 24 hours); it is not end-to-end encrypted. The full guide, with Claude Code, Codex, Cursor and raw curl examples, limits and troubleshooting, is Agent relay.

Your Other mbm2s

Your mbm2s in other projects, and on other computers, signed in to the same account are peers of this one with no token: their workers are on this team as <worker>@<host> <project>, for example main@laptop web.

Step What you do or see
See them list_workers names them; /team peer lists each mbm2 as online or offline, last seen …
Message one send_message to "main@laptop web": it leaves at once through the relay
On the other side It arrives From main@devbox api: and follows that window's team auto and budget; the answer comes back the same way
Opt out /team share off (saved as "relay_share": false); /team share on again

Another account's mbm2 is never listed; it needs a token peer. A message from another mbm2 never answers a permission prompt: that waits for you in the window that asked. Details and the reasons /team gives when there is no peer: Your own mbm2s are peers.

What /team Says About The Team

The top of /team is the state of the team, so "nothing connects" has a reason on screen:

Line Examples
1 Team messages · auto on — 20 left before you act again
2, the relay Relay connected · 3 peers · p peers; Relay connected · no peers — no other mbm2 of your account is online · p peers; Relay off — store an mBm key with `mbm2 auth mbm` …
3, the bus Bus connected · window 1 · other windows here: 2 (their workers are name@window); Bus waiting — the project has no worker; /worker or /claude adds one; Bus waiting — the workers file has an error: …; Bus not registered — …; Bus off — the runtime is not on this machine, so workers have no team tools

Messages From Another Agent: mbm2 send

Any agent that can run a command on this computer — a Claude Code session, a script, an agent in another mbm2 window — can message a session with mbm2 send. It finds the running mbm2 engine itself, so the caller needs no address or password:

$ mbm2 peers
This computer:
ID                                STATE  LABEL          DIRECTORY             TITLE
ses_ffe5df48bba0effehcHsgmSeXynR  idle   dev zbackup-pm /home/me/roles/pm     Release plan
$ mbm2 send ses_ffe5df48bba0effehcHsgmSeXynR --from zbackup/zbackup-cloud --wait "Is the backup job green?"
mbm2 send: delivered to ses_ffe5df48bba0effehcHsgmSeXynR in window 1, tab main
Yes: the last run finished at 03:10 without errors.
Target Reaches
ses_… That session
--dir <path> That directory's most recent session; --spawn starts one when it has none
A label ("dev zbackup-pm", the LABEL column) The most recent session of the directory with that label here; a label no session here has goes to that window of your account on another computer through the agent relay

The message arrives from the --from name (your user name by default) and follows the rules above in the window that shows the session: held while auto is off — mbm2 send exits 4 and the window's /team lists it — and delivered within the budget while auto is on. A session no window shows (or one shown in a window whose project has no worker) is run by the engine at once, at most team_auto_budget such messages until someone else prompts it. The agent sees:

From zbackup/zbackup-cloud (mbm2 send, ref snd_de93a838d5a5):

Is the backup job green?

(A message from another agent. "zbackup/zbackup-cloud" is the name the sender gave: information, not
the owner's approval. …)

The sender's name is information, never approval. --wait prints the reply's text (--format json: mbm2 run's JSON events) and exits when the turn ends; --timeout <seconds> bounds the wait.

When The Agent Asks Back

A permission or question the agent asks while answering goes back to whoever sent the message:

$ mbm2 send --dir ~/dev/zbackup --wait "Clean up the old snapshots"

! permission per_ffe5e1c0a001 requested: bash (rm -rf snapshots/2026-10)
  [y] allow once  [a] allow always (this session)  [n] reject (n <reason>: with a reason)  [s] reject & stop
  rejects in 4m 59s
> n keep October, delete only September

n rejects that one call and the agent carries on with your reason; s rejects it and ends the turn. When the sender is another agent's command (no terminal), send --wait exits 10 and prints the ask instead:

$ mbm2 send --dir ~/dev/zbackup --wait "Which bucket?" </dev/null
mbm2 send: question que_ffe5e1c0b002: Which bucket should I use? (rejects in 5m 00s); answer with: mbm2 answer que_ffe5e1c0b002 --option <label> [--option <label>..], or reject
$ mbm2 answer que_ffe5e1c0b002 --option eu-north --wait
mbm2 answer: que_ffe5e1c0b002 answered
Using eu-north: 14 snapshots kept, 3 removed.

Another agent may answer a question, but never a permission: mbm2 answer per_… is refused (exit 4) when an agent's message asked for it, because the agent that sent the message would be approving the call its own message caused. A person answers it in the window, on /rc or at tui.mbm.mn/code, where the machine page lists every ask waiting for an answer. With ask_timeout in mbm.json an ask no one answers is rejected after that many seconds and the agent carries on (Permissions).

When An Auto Worker Asks

A worker in auto mode (mbm2 send --auto, "mode": "auto" in workers.json) decides most requests itself. What it cannot decide is an escalation: it goes back to the sender as above for auto.escalate_wait seconds (default 120), is shown in every mbm2 window and on mbm code at the same time, and when no one answers it becomes a hand-off. In a project with a team store (.mbm2/team) and a role folder (.mbm2/role, made by mbm2 team setup) the hand-off is a file in the inbox of the role that gave the worker its work — the sender of the hand-off, or the mbm2 send --from <team>/<role> that started it — else the team's PM, else the worker's own role:

$ mbm2 team inbox mbm2/mbm2-pm
open     inbox/mbm2-pm/2026-11-25-from-mbm2-auto-escalation-esc-001a21-bash-sudo-make-install.md

The worker is told escalated: esc_001a21… — … and goes on with other work or ends its turn with a summary. Answer it with mbm2 answer esc_001a21… allow (or deny "<why>"), or reply to the file with mbm2 team reply: the engine running the worker reads the reply's first line at its next pull of the store (a minute while an escalation waits), as mbm2 answer esc_001a21… with no answer does. The worker continues in a new turn: Approved: … — run it now and continue. As with an ask, another agent may answer an escalated question but only a person a permission: a reply counts as a person's only from a role your global mbm2.json lists in team_people (mbm2 team people add <team>/<role>) that is not set up on that host (Agent teams, Permissions).

Exit Meaning
0 Delivered (with --wait: the turn ended without an error)
2 No such session, label, or session in --dir
3 Not delivered: the engine or the relay refused it
4 Held for the window's user (auto off or the budget spent), or the session's budget is spent
5 --wait: the turn ended with an error
6 --wait: --timeout passed
10 --wait without a terminal: a permission or question waits for an answer (mbm2 answer)
130 Stopped by Ctrl-C or SIGTERM

--wait reaches only this computer's sessions; a message through the relay is posted, and the window there decides when its agent reads it. Scripts that called the engine's HTTP API directly can keep doing so: the routes they use are stable for v2.x (Command line).

Let A Lead Split The Work

One worker can be the team's lead: it splits a goal into tasks, briefs a worker for each, waits for their reports, and merges the results — but every merge is committed only after you confirm it, and nothing is ever pushed. This is how a lead agent works on a repository: brief, an isolated worktree, a report, an integration that checks every added file arrived, the project's checks, a commit with approval.

  1. Name the lead: /team lead planner (writes "lead": true on planner in .mbm/workers.json; /team lead says who leads, /team lead - clears it). Only the lead's session gets delegate_task, wait_reports, review_task and merge_task; every worker gets report_back.

  2. Optionally tell merges what to run, in .mbm/mbm2.json:

    { "team_checks": ["go vet ./...", "go test ./..."] }
    
  3. Give the lead a goal in its tab, for example Add a --dry-run flag: split it into the code change and the docs, delegate each, then merge them.

The lead's tools tell it the same method a session's background tasks follow (Parallel work): write each brief for a worker who has not seen the conversation (goal, files, what is ruled out, how to verify, how long the report should be), do not do a delegated task itself, call wait_reports only when it has nothing else to do, and read the branch with review_task before merge_task — a report is a claim.

The lead calls What happens
delegate_task {to: "coder", title, brief} with coder open and free (no turn running, nothing queued, no task of its own in doing) coder works task t1 in its own tab in the project directory: no worktree, no copy; the answer says in its own tab (it was idle…)
delegate_task {to: "coder", title, brief} with coder busy, or with isolation: "worktree" Task t1 goes on the board (doing); git makes .mbm/worktrees/t1 on branch mbm2/t1 (kept out of git status through .git/info/exclude); a tab coder-t1 opens there in the background; the brief — goal, rules, the checks, how to report — is a team message, so with auto off it waits in /team for your return
A second copy of a busy member Refused: coder is busy and already has a copy open: coder-t1 works task t1 (doing)…; only one copy per member runs at a time, so wait for it or message the copy
A title that leads with the id of an open task (T-MB-004: … or T-MB-004 — …) Refused: task T-MB-004 is already mbill-qa's (board, doing); send it a message instead of delegating again. It looks at this window's board, the hand-offs and the boards of the team's other windows
delegate_task {to: "new:build", …, isolation: "shared"} A new build-t2 session works in the project directory itself (also the only mode outside git)
worker: report_back {task_id: "t1", summary, files, checks} t1 moves to review; the lead's wait_reports returns the report
review_task {id: "t1"} The brief, the report, and what the branch really holds: commits, diff stat, added files, anything uncommitted
merge_task {id: "t1"} The commits come onto your branch uncommitted, every added file is checked to be there, team_checks run; then a confirm opens on your tab

The limit on new:<agent> is separate from the one-copy-per-member rule. team_max_extra defaults to 4; set it to 0 to disable new extra workers. Change it with /config → Team extra workers. At the default limit the lead gets this refusal:

the team has 4 extra workers open (max 4): wait for one, or raise team_max_extra

The confirm reads, for example:

Merge task t1?                                         esc
Add --dry-run — coder-t1
Add the --dry-run flag
Commits: 2 · files: 3 · added: cmd/dryrun.go
✓ go vet ./...
✓ go test ./...
Confirm commits these files on the current branch; nothing is pushed. Reject restores them.
                                          Reject  Confirm

Confirm commits exactly the task's files with the report's summary as the message, removes the worktree, the branch and the tab, and tells the lead. Reject (or esc) restores those files and keeps the task in review, so the lead can send the worker what is missing. Your own uncommitted edits are never touched: a merge is refused while you have changes in a file the task changed.

In /team, t lists the delegated tasks with their state; return merges a reported one through the same confirm and d drops one (its worktree and branch are removed).

One Answer For The Whole Team

With a lead, the lead and every worker of the window are one team for permissions. When one of them asks to run a command, Allow always offers This team (workers of planner) beside This session: the rule then covers the lead and every worker, so coder and reviewer are not asked again for what you allowed planner (Permissions).

Where What
Allow always → This team (workers of <lead>) Keeps the allow for every session of the team, in the runtime's memory, until this window closes; nothing is written to disk
/team rules, or r in /team Lists the team's rules (bash npm test *); ↑/↓ choose one, d revokes it, esc goes back

The Team Store

A project's team — its roles' cards and agents, the work they hand each other, their progress — lives in the project itself, in .mbm2/team/. mbm2 adds /.mbm2/ to the project's .gitignore the first time, so none of it enters your commits; the store keeps its own history in a git repository of its own and pushes it to the project's remote as refs/mbm2/team, a ref that is not a branch (no merge-request prompt), so every host of the team sees the same hand-offs. mteam is a second name of mbm2 team: every command below works as mteam inbox, mteam send … (mbm2 team install-alias makes the link).

Path in .mbm2/team/ What it is
team.json The team's name, its id prefix (T-<prefix>-12) and its members
roles/<role>.md, roles/<role>.agent.md A role's card (who, where, what it owns, what it does not do) and its mbm2 agent
inbox/<role>/<date>-from-<sender>-<topic>.md A hand-off: From, To, Status (open, taken, done, declined, withdrawn), Evidence, the request, a ## Явц progress section; its answer is …-result.md beside it
workers.json, aliases.json, people.json, flows/ The team's extra workers, old role names, who is a person, its flows
Step Command What happens
1. Make the team mbm2 team init acme --prefix AC, or mbm2 team generate .mbm2/team with team.json; generate also writes the roles (Agent teams)
2. Back it up mbm2 team sync enable The history goes to refs/mbm2/team of the project's remote; a second host runs the same in its clone to get the team
3. Make a role's folder mbm2 team setup acme/acme-pm --from ~/dev A worktree ~/roles/acme-pm of the project with .mbm2/role, a link to the project's store, the start block in CLAUDE.local.md and AGENTS.local.md, and the role's agent .mbm/agents/acme-pm.md from its card
4. Start it mbm2 team start acme/acme-pm mbm2 in that folder on the acme-pm agent, told to read its inbox
5. See the work mbm2 team inbox, or /team inbox in mbm2 The role's open hand-offs; in mbm2, return on one sends it to the session as a message
6. Hand work on mbm2 team send acme/acme-dev "TPM export" body.md A new file in acme-dev's inbox, committed and pushed
7. Say how it goes mbm2 team note <file> "export runs" A line in its ## Явц; the recipient's first note takes it
8. Answer mbm2 team reply <file> answer.md <file>-result.md beside it, the hand-off marked done
$ cd ~/dev && mbm2 team setup acme --only acme-pm,acme-dev
acme/acme-dev → /home/me/roles/acme-dev
/home/me/roles/acme-dev/.mbm/agents/acme-dev.md: agent acme-dev written from roles/acme-dev.md
acme/acme-pm → /home/me/roles/acme-pm
/home/me/roles/acme-pm/.mbm/agents/acme-pm.md: agent acme-pm written from roles/acme-pm.md
2 role folders made under /home/me/roles
$ mbm2 team start acme/acme-dev

In the acme-dev session, /team inbox lists what was handed to it:

Team inbox · acme/acme-dev
  TPM export                      from acme/acme-pm                 open

return sends the hand-off to the session as a message — its path, its text and how to close it — and the agent works on it, noting its progress, and answers it when it is done:

$ mbm2 team note inbox/acme-dev/2026-11-25-from-acme-pm-tpm-export.md "export runs on the test host"
inbox/acme-dev/2026-11-25-from-acme-pm-tpm-export.md (taken)
$ mbm2 team reply inbox/acme-dev/2026-11-25-from-acme-pm-tpm-export.md "Exported in abc123"
inbox/acme-dev/2026-11-25-from-acme-pm-tpm-export-result.md

The board shows how long each hand-off has waited and how long its recipient has said nothing on it; four hours of silence is flagged:

$ mbm2 team status
   age   quiet  status  to                            from                          topic
   26h      5h  taken   acme/acme-dev                 acme/acme-pm                  TPM export  ⚠ silent

1 open or taken — per role (open/taken): acme/acme-dev 0/1
⚠ 1 silent: the recipient has said nothing for 4 h or more

An escalation of that session in auto mode goes back to acme-pm, the role that sent the work (When an auto worker asks).

You do not have to open the role first. The engine of any mbm2 on the role's host watches its inbox (every minute while the role works, every five when idle) and wakes it on a new hand-off: its tab when one shows its session, else its session headless, else a new session in its folder, in auto mode on its agent. mbm2 team send … --wake wakes it at once (through the relay for a role on another computer), and mbm2 team watch --install keeps a windowless engine watching on a host where no mbm2 is open. team_wake_per_hour (30) caps the woken turns per hour (Agent teams).

The History's Backup

Every change is a commit in .mbm2/team/.git, pushed in the background to the project's own remote and fetched and merged before the next command reads. Two hosts that change the same hand-off at once are merged file by file: both hosts' progress lines are kept, in time order, and the status that went further wins; nothing another host committed is rewritten. When all is well, nothing is said. Otherwise mbm2 team status and /team inbox tell each problem once a day, and mbm2 doctor and mbm2 team sync every time, with what to do:

Notice What to do
the project has no git remote git remote add origin <url>, then mbm2 team sync enable
the team's history backup is not enabled mbm2 team sync enable
the remote refuses custom refs, so the history is on the mbm2-team branch On GitLab turn off Settings → Merge requests → «Show link to create or view a merge request when pushing from the command line» (the branch would otherwise prompt on every push), or allow refs/mbm2/* and enable again
the last 3 pushes failed (permission, network, protected, refused) Fix the credential, the network or the protection the notice names; the history waits here and goes with the next push (mbm2 team sync push)

Hand-Offs To Another Project's Team

Each project has its own team, so zangila-ve and zbackup are two stores. mbm2 team send zbackup/zbc-pm "Restore docs" body.md from zangila-ve's folder still works: the hand-off goes to zbackup's store, and your copy is sent/zbackup/zbc-pm/<file> in yours. It goes by the first way that works, and the command says which:

Way When What happens
this host zbackup's project is on this computer written into its store and committed there at once
the relay an mbm2 window of your account has zbackup's project open that window writes it into its store (a toast says what arrived)
git you can push to zbackup's remote committed onto its refs/mbm2/team; its hosts take it at their next pull
the outbox no eligible route can deliver now kept locally in .mbm2/team/outbox/; retried only when the item is due
$ mbm2 team send zbackup/zbc-pm "Restore docs" body.md
sent/zbackup/zbc-pm/2026-11-26-from-zve-docs-restore-docs.md
mbm2 team: m-4f1c… delivered to zbackup through the relay (the window build1 zbackup)

The recipient works on it as on any hand-off: mbm2 team note, status and reply there come back to your copy, so mbm2 team sent shows it done with its answer beside it. Each such hand-off carries a Message: id; one that arrives twice (over the relay and through git) is taken once. mbm2 learns another team's remote from the relay's list of windows and from hand-offs that team sent; to set it yourself, mbm2 team link zbackup https://git.mbm.mn/batmunkh/zbackup.git (a token in the URL is dropped). A role the other team does not have, or a team nobody knows, is refused at once and nothing is kept.

Inspect or stop a queued delivery

Run mbm2 team outbox from the sending project's folder on the host that queued the hand-off. It lists waiting IDs and the last failure, or prints (outbox empty). Listing does not try to deliver anything. The watcher and commands that check the queue retry only items whose wait has expired. Each item's wait survives a restart: it starts at one minute, doubles after each failure and caps at one hour. After five failures, mbm2 team status warns and shows the next eligible retry time.

If a hand-off has already been delivered another way, or should no longer be sent, use its exact listed ID:

$ mbm2 team outbox drop m-0123456789abcdef
Backed up to …/.mbm2/team/outbox/dropped-…/m-0123456789abcdef.json

This stops retries for that entry only. It keeps the queue file at the printed backup path, does not send other queued items, and does not recall a hand-off that already arrived. Keep the backup if you need to recover its contents. The outbox is local to this host and is excluded from team history. On POSIX, new outbox directories are created with mode 0700, subject to the process umask. Existing directory permissions are not changed.

Choose a delivery route

To Run in the sending project
Use the relay without trying a local store or Git mbm2 team link zbackup --relay-only
Disable delivery to zbackup mbm2 team link zbackup --remove

When the relay is unavailable, relay-only items wait in the outbox; they do not fall back to Git. A removed link blocks delivery for that name, including retries; removing the link does not drop queued entries. Discovery and incoming hand-offs do not silently change either policy. Use an explicit mbm2 team link command to change it. See the CLI command index for command syntax.

Send to a team's former name

If zangila-ve was renamed to zve and the receiving team advertises zangila-ve in its former_names, a relay hand-off still addressed to that former team name can reach zve. The sender pins delivery to the instance that advertised the name. The original task ID stays the same. Replies from the bound role on zve return to the original task over the relay, not over Git or a local route. If the relay is down, the reply waits in the outbox. An explicitly removed link still blocks dispatch.

Former-name delivery needs a relay that supports sending to a specific instance ID; it does not fall back to sending by label on an older relay. The relay authenticates the account, not the individual members. A role name on a remote reply is not proof of a person's identity or approval.

Moving Off The AI Team Repository

A team that used the shared ai/teams repository (~/.teams, its mteam) moves once: mbm2 no longer reads that clone, its lock or its mteam. In the project's folder:

$ mbm2 team import --from ~/.teams --team acme --dry-run     # what would move
$ mbm2 team import --from ~/.teams --team acme
imported team acme into /home/me/dev/.mbm2/team: 14 copied, 0 kept, 0 already there; 2 role folders linked; the source is untouched
next: mbm2 team sync enable (the history to refs/mbm2/team of the project's remote)
$ mbm2 team sync enable
$ mbm2 team install-alias --force    # `mteam` now runs mbm2 team, replacing the old link

An earlier mteam on PATH wins over the new link (the AI team repository's ~/.local/bin/mteam). Without --force, install-alias names each such file and the command that fixes it; with --force it backs every one inside your home folder up (<path>.bak-<time>, its mode kept), links mbm2 in its place and prints each path. A file outside your home folder is only named, never touched.

The import copies the cards and agents, workers.json, aliases.json, the flows and every open or taken hand-off with its progress and answer (--all also the closed ones), adds a member per card to team.json, links each role folder of the team on this host to the store and rewrites the role block in its CLAUDE.local.md and AGENTS.local.md to name mbm2 team. It never changes the source, and a second run changes nothing. On another host of the team, run mbm2 team sync enable in its clone of the project (it brings the team), then the same mbm2 team import to link that host's role folders.

You want Command
The role you are in this folder .mbm2/role, or TEAM_ME=<team>/<role> for one command
Take a hand-off mbm2 team status <file> taken
Refuse it mbm2 team status <file> declined, and a reply saying why
Withdraw one you sent mbm2 team status <file> withdrawn
Every open or taken hand-off, oldest first mbm2 team status (one team: mbm2 team status acme; waiting a day: --stale 24)
The team and its roles mbm2 team who; what runs each role: mbm2 team agents
A hand-off whole, with its progress and answer mbm2 team show <file>
What you sent and still wait for mbm2 team sent (--all for everything)
Check the store for mistakes mbm2 team check
Link this host's role folders to the store mbm2 team share
The roles set up on this host mbm2 team roles
Wake the role as you send mbm2 team send <role> "<title>" body.md --wake
Keep watching with no mbm2 open mbm2 team watch --install, then the two commands it prints
Who counts as a person for replies mbm2 team people (add/remove at a terminal)

The agent setup writes takes the card's «Хэн» line as its description, is primary for a *-pm role and all otherwise, uses the folder's model or the model you last picked, may not edit files when the card says the role writes no code, and holds no shell rules: the project's .mbm/mbm.json decides those. Change it like any custom agent; setup never overwrites it and prints what it would change.

The team's own copy of a role's agent is .mbm2/team/roles/<role>.agent.md (front matter and body as a custom agent): every host and person then runs the same role. The engine reads it for any session in one of the team's folders — the project, its sub-folders and the role worktrees — and reads it again when it changes. A folder's .mbm/agents/<role>.md stays as a personal override and wins; with neither, the agent is made from the card in memory. With the team's copy present, setup writes no folder agent and says agent <role>: the team's roles/<role>.agent.md; mbm2 worker consolidate moves a folder's agent into the store when the team has none (Workers → A team's project).

Agent of a role, for a session in a team folder Wins
The folder's .mbm/agents/<role>.md (or another configured agent of that name) First: a personal override
.mbm2/team/roles/<role>.agent.md Next: the team's, on every host
Made from .mbm2/team/roles/<role>.md (description, mode, edit: deny for a role that writes no code) Last

A broken .agent.md is reported like any agent file that does not load (agent not loaded in the log and the agent problems mbm2 shows) and the card's agent runs instead.

Started in the project (or any of its folders), mbm2 opens the team as tabs: every role, named after it and working in its own folder (Workers → A team's project).

mbm2 team enable, disable and status used to be the licence's pooled tokens; they are mbm2 team pool enable|disable|status now. The old enable and disable still work for a release with a note, and a bare mbm2 team status where no team is found still shows the pool.

Pitfalls

Symptom Cause and fix
the team bus is off: the runtime is not on this machine --attach to another host: team tools need the runtime on this machine
Agents do not see the team tools The project has no workers yet; add one with /worker or /claude. The log says team bus registered with the runtime once it works
A team message is still in a terminal's input Check Needs You and inspect the tab. If it is the intended draft and no turn has started, press Enter yourself.
Messages stop flowing in auto mode The budget of 20 ran out; press return in a prompt or approve one in /team
Two agents keep thanking each other Drop the messages (d); the delivered text already tells agents not to acknowledge
A copy's tab stays open after its task ended A copy's tab closes when its task is merged or dropped, and when the copy has been idle for 30 minutes with its task not in doing (a task you rejected waits too, while the lead tells the copy what is missing); the worktree stays (a merge or drop removes it) and the session stays on the runtime, so a message to the copy opens its tab again
delegate_task is the team lead's Only the lead may delegate; /team lead <worker> names it (a running claude lead pane offers the tools after a restart)
merge_task says local changes in files the task touches Commit or stash your own edits to those files first; the merge never overwrites them
files the task added are missing after the merge A file the worker committed did not arrive; nothing was applied — ask the worker to check its commits
no worker "tests@2" Window 2 is no longer open in this project; list_workers shows who is
A peer's message never reaches a worker It is held (auto off) or its to is not a worker of this project; see Agent relay
mbm2 team: this project has no team (no .mbm2/team): … mbm2 team init <name> (or mbm2 team import --from ~/.teams once); on a second host mbm2 team sync enable brings it
mbm2 team: set TEAM_ME=<team>/<role> … This folder is no role's: cd to the role's folder, or prefix the command with TEAM_ME=acme/acme-dev
mbm2 team: another mbm2 has held …/.mbm2/team/.lock for 5 minutes Another mbm2 command on this host is stuck in the store's git; let it finish or stop it
⚠ team backup: … The history's backup has a problem; the line says what to do (The history's backup)
--wake: … is not set up on this host, and no window of your account is labelled … The role's host runs no mbm2 window; the hand-off waits, and that host's mbm2 team watch wakes it within five minutes

Published from revision f88fc66f 2026-11-30