mBm TUI (mbm2)
Menu

Agent Teams: Roles, Setup, Running And Managing Them

This page puts the pieces together in the order you use them. Each step links the page that covers it in full: Custom agents, Permissions, Workers, Teamwork and Parallel work.

Word What it is Where it lives
Agent (a role) How one assistant works: its instructions, model and limits .mbm/agents/<name>.md
Worker Where it works: a tab with its own session that runs one agent .mbm/workers.json
Lead The worker that splits a goal, delegates the parts and merges the results "lead": true on one worker
Team messages Agents writing to each other and to you through /team The window's team bus
Team auto Team messages delivered without your return, up to a budget /team, "team_auto" in mbm2.json
Auto mode Permission prompts decided by your rules, guardrails and a judge instead of you /mode auto, "mode": "auto" on a worker

Team auto and auto mode are different switches: the first is about messages, the second about permissions. An unattended team usually wants both.

1. Write The Roles

One file per role in .mbm/agents/. The file name is the agent's name; the front matter holds its settings, and everything under it is the agent's instructions (its system prompt).

---
description: Project manager — splits goals into tasks, delegates, checks results
mode: primary
model: deepseek/deepseek-flash
permission:
  edit: deny
---
You are the project manager of this repository.

## Your job
- Read AGENTS.md and the task board before you plan.
- Split each goal into tasks one person can finish; give coding to coder and reviews to reviewer.
- Merge only what reviewer passed; never edit files yourself.

## Report
End with: what was done, by whom, test results, what still waits on the user.
---
description: Senior engineer — implements assigned tasks with tests
mode: all
model: deepseek/deepseek-flash
---
You are a senior software engineer. Implement only the task the project manager gave you; ask before
widening it. Add or update tests for every change and run the project's checks. End with the files
you changed, the check results and open risks.
---
description: Reviewer — reads the change, runs the checks, reports findings; never edits
mode: all
model: deepseek/deepseek-flash
permission:
  edit: deny
---
You review changes. Read the diff and the task's acceptance criteria, run the checks, and list each
finding with its file and line and why it matters. Do not fix anything yourself.
Setting Use
mode primary: you talk to it in a tab. subagent: only another agent calls it. all: both — use it for roles a lead delegates to
model Always set it (provider/model). Without it a new session starts on your latest pick, else the provider's default
permission Only the role's limits (edit: deny for a reviewer). Keep the shell policy in the project's mbm.json (step 2): an agent's own rules come last and outrank the project's, so an agent bash: ask makes every «This project» allow useless
The body Duties, what it must never do, and the shape of its report. A persona line («20 years of experience») helps a little; clear duties and limits help much more

Write a rule the model must never break in both places: in the body (a request) and in permission (enforced). Put the project's shared rules in AGENTS.md, not in every role.

You can ask an agent to write these files for you, for example: Create .mbm/agents/pm.md, coder.md and reviewer.md as described in tui.mbm.mn/docs/guides/agent-teams: pm primary with edit denied, coder and reviewer mode all, reviewer with edit denied, model deepseek/deepseek-flash, English instructions with duties, limits and a report format. Check the result with mbm2 agent list. Or make each role in the interface: /worker → Add a role… asks a name and one line of duty, writes the file (mode all, your latest model, Duties / Never / Report to fill in) and opens the role's tab (Workers).

2. Set The Project's Permission Policy

The shell policy belongs in .mbm/mbm.json of the project, where «Allow always → This project» writes too. Rules are read top to bottom and the last matching rule wins, so put the asks for dangerous commands at the end:

{
  "permission": {
    "bash": {
      "*": "ask",
      "ls*": "allow", "cat *": "allow", "head *": "allow", "tail *": "allow", "wc *": "allow",
      "grep *": "allow", "rg *": "allow", "find *": "allow",
      "git status*": "allow", "git diff*": "allow", "git log*": "allow", "git show*": "allow",
      "npm test*": "allow", "npm run lint*": "allow",
      "git push*": "ask", "git -c * push*": "ask", "rm -rf*": "ask"
    }
  }
}

Read-only commands — ls, cat, head, wc, grep, rg, find without -exec, git status|diff|log|show — run without a prompt even under "*": ask, as long as nothing writes a file (>, tee) or runs a substitution; a rule that names the command still asks or denies, and paths outside the project still ask ("read_only_commands": false under permission turns this off). A command that starts with variable assignments is kept with them (TEAM_ME=a/b mbm2 team *).

When a prompt does come, Allow always offers where to keep the answer:

Choice Kept for
This session This tab's session, until it ends
This team (workers of <lead>) The lead and every worker it started, until the window closes
This project (permanent) Every session in the project: written to .mbm/mbm.json
This agent (permanent) Offered when an agent file's own rule is what asks: written into that agent's file

A refusal names the rule that still decides and the file it comes from, so you know what to change (Permissions).

3. Declare The Workers And The Lead

// .mbm/workers.json
{
  "workers": [
    { "name": "pm",       "kind": "session", "agent": "pm",       "lead": true, "open_on_start": true },
    { "name": "coder",    "kind": "session", "agent": "coder",    "mode": "auto" },
    { "name": "reviewer", "kind": "session", "agent": "reviewer", "mode": "auto" }
  ],
  "pipelines": [
    { "name": "code-then-review", "steps": ["coder", "reviewer"] }
  ]
}
Field Effect
agent The role the tab runs: one of your agent files, or build, plan, safe
lead This worker may delegate tasks to the others (/team lead pm writes it)
mode "auto" lets the worker run without stopping at every prompt (step 6)
open_on_start Its tab opens when mbm2 starts

/worker adds workers from a menu without editing the file (Workers).

4. Start And Give The Goal

  1. Run mbm2 in the project. Tab 1 is main; pm opens beside it.
  2. Switch tabs with shift+tab, alt+n or a click; <leader>w opens a closed worker. With many tabs the bar shortens the labels to numbers but keeps the name of the tab you are on (○ 1 ○ 2 ● 3 zve-docs ○ 4); put the pointer over any tab and its full name and state show at the bar's right (3 zve-docs · working, 2 zve-api · Claude tab · idle). A member's tab writes to that member, and main never runs a member's agent: opening a session whose last message named zve-pm leaves main on its own agent instead of switching it to the member's.
  3. In the pm tab, give the goal: Add CSV export to the reports page: split it, delegate coding and review, merge when the review passes.
  4. The lead calls delegate_task: a free worker takes the task in its own tab; a busy one gets a copy in its own git worktree and a background tab (coder-t1), one copy at a time, and a task the team already holds is refused. Every task has a board entry. Workers answer with report_back; the lead reads the branch with review_task and calls merge_task.
  5. A merge always stops at a confirm on your tab showing the commits, the files and the checks. Nothing is pushed. See Teamwork → Let a lead split the work.

A role a worker runs belongs to that worker's tab. In any other tab the tab mode cycle passes over pm, coder and reviewer and keeps build, plan, safe and the agents no worker runs; its toast says where the roles are: plan mode · coder, pm, reviewer → their tabs (ctrl+x a). The agent list (<leader>a) shows them as pm → tab (runs in the pm tab): choosing one goes to the pm tab, opening it if it is closed, and leaves this session's agent as it was. In the pm tab itself pm is an ordinary agent. To jump to a tab, type /tab 3 or /tab pm (Workers).

When the cycle's toast ends in this session is in /home — the agents of /home/shop are not here, the session you are in was started in another folder than the project's: its engine never read the project's .mbm/agents. Start mbm2 in the project folder, or open a session there.

5. Let Them Talk

Agents write to each other with send_message and keep a shared board (list_tasks, add_task, update_task). With team auto on (the default since 2026-11-27) messages go through until the budget (500 by default) is spent; /team (<leader>shift+i) then asks to continue. With it off, each message waits in /team for your return.

A message in the window with send_message (to: "<member>") opens the member's tab at once. A wake from the inbox watcher or mbm2 team send --wake does the same through the window when team_auto_open is on (§8).

From outside the window:

Command Use
mbm2 send pm "the API changed: update the plan" Message a session by label or id, from a shell, a script or another agent
mbm2 peers List who can be reached: this machine's sessions and windows, and your account's other mbm2s through the relay
mbm2 answer <id> once|always|reject|"text" Answer a question handed back to you; a permission only a person answers

Addresses, names and groups

A message can name the agent instead of a session, so it still arrives after a restart, a new session or a move to another host. The engine of the role's host keeps it first and gives it to the role's session as it is then — its window's tab, else the session itself, else a new one in its folder, in auto mode:

You write Reaches
mbm2 send zbackup/zbc-docs "is the restore guide done?" the role, on this host or through the relay on the host that has it
mbm2 send zbackup/zbc-docs@build1 "…" the role on that host, when it runs on several
mbm2 send Ц.Ганаа "…" the member of this folder's team with that name; a part of a name two members share (Ганаа) lists both and sends nothing
mbm2 send @all "…", @pm, @lead, @developers, @backend every member, the PM, the leads, a named group, every member of that role type — one line each

Names may hold Cyrillic, dots and spaces and are unique in the team; the role id always tells two members apart. mbm2 team rename backend Bold gives backend the name «Bold» (shown as Bold (backend)), and the old name keeps working. mbm2 team group add developers frontend backend worker makes a group, mbm2 team group list lists them and mbm2 team group remove developers drops it. The message reaches the agent as a message from your address: information, never an approval of a permission and never a change to its rules, whatever it says. The agent answers your address with mbm2 send <your address> …. mbm2 peers shows which window holds which address.

Claude Code, Codex or a person join through the relay as peers, or through the project's team store with mbm2 team (or its other name mteam) (Agent relay, Teamwork). A Claude Code, agy or Codex tab in this window joins the bus directly (Claude, agy, codex); a role whose card says - **Agent:** claude [model], agy or codex runs as such a tab and mbm2 team start opens it.

6. Run Unattended

Turn auto mode on for the workers ("mode": "auto" in step 3, or /mode auto in a tab; /mode ask turns it off). In auto mode:

  1. Your rules decide first (step 2).
  2. Hard guardrails always go to a person: pushes, deploys, credential files, sudo, deleting outside the project, sending data to unknown hosts, changing permission settings.
  3. What is left goes to a small-model judge with the task and the action; any doubt goes to a person.
  4. A question with a recommended option takes it.

When a person is needed, the request goes to whoever sent the work, then to a window showing the session, then any window of your account and «mbm code». If nobody answers within auto.escalate_wait (2 minutes by default), it becomes a hand-off in the project's team inbox (.mbm2/team) (or a «mbm code» notice), the call is refused with escalated: <id>, and the worker carries on with other work. mbm2 answer <id> allow|deny (or the window, or «mbm code») resumes it. /auto log lists every decision. Details: Permissions → Auto mode.

A worker woken by a message (mbm2 send --auto, a hand-off, mbm2 team send --wake) runs in auto mode and, when its turn ends, sleeps until the next message: nothing polls the model. See Waking and the inbox watcher.

7. Teams Across Folders And Hosts: The Team Store

When roles work in different folders or on different machines, or some are Claude Code, Codex or a person, they share the project's own team store .mbm2/team/: team.json names the team and its members, roles/<role>.md is each role's card (who, where, what it owns and must not do), and work moves as tasks, each shown as a file in inbox/<role>/ (What a task is). mbm2 keeps the folder out of the project's commits (/.mbm2/ in .gitignore) and its history in the project's own remote as refs/mbm2/team, so every host of the team reads the same store; mteam is the same command as mbm2 team.

$ cd ~/dev && mbm2 team init acme --prefix AC      # the store (or mbm2 team generate, below)
$ mbm2 team sync enable                            # its history to refs/mbm2/team of the remote
$ mbm2 team setup acme --from .                    # every role: folder, its link to the store, its agent
$ mbm2 team start acme/acme-dev                    # mbm2 in that folder, on that agent
$ mbm2 team inbox                                  # what was handed to you (/team inbox inside mbm2)
$ mbm2 team send acme/acme-docs "API changed" body.md
$ mbm2 team note <file> "half done"                # progress, one line; your first note takes it
$ mbm2 team reply <file> answer.md                 # answer it; the hand-off is marked done
$ mbm2 team status --stale 24                      # who waits on whom, oldest first, «⚠ silent» at 4 h

setup writes .mbm/agents/<role>.md from the card — description, mode, model, edit: deny for a role that writes no code, and no shell rules — and never overwrites one you changed. A role folder without that file is offered it once when mbm2 starts there, and /worker keeps Create 's agent from the card. mbm2 help team and mbm2 help team setup list every option; Teamwork has the details, and Moving off the AI team repository how a team that used ~/.teams moves once with mbm2 team import.

Outside a project. mbm2 team … run in a folder no team serves (the home folder) does not just say there is no team: it lists the teams the host registry knows, grouped by project folder, and says how to reach one, cd <folder> or mbm2 team --dir <folder> <command> (--dir works for every team command except install-alias, whose --dir is the folder of the link). With an empty registry it says to run mbm2 team generate in the project.

One team per project. mbm2 finds the project's team from wherever it starts: the project (~/dev), any sub-folder of it, a role's worktree (~/roles/acme-docs, a worktree of the same repository) or a role folder elsewhere that mbm2 team setup (or mbm2 team share) linked to the store. All of them show the same team:

What Where it lives Who sees it
The roles .mbm2/team/roles/<role>.md: every card is a tab named after the role, working in the role's folder on this host (a role not set up here is listed not set up here — mbm2 team setup <team>/<role>) The whole team
A role's agent .mbm2/team/roles/<role>.agent.md, else made from the card; a folder's .mbm/agents/<role>.md overrides it for you The whole team, every host
The team's extra workers .mbm2/team/workers.json, e.g. a role's helper {"name": "acme-docs-claude", "kind": "terminal", "command": "claude", "under": "acme-docs"} The whole team
Your extra workers <project>/.mbm/workers.json, one per project; a role folder's or a sub-folder's own file is merged with a note You

A project that grew several workers files (one in the project, one in each role folder) is made one with mbm2 worker consolidate --dry-run (the plan), then mbm2 worker consolidate: the role folders' workers move into the team's file under their role, the project's repeats of roles and of the team's own workers go (asking when a repeat runs something else), the folders' agents move into the store, every file is backed up first and the team's change is committed and pushed. /worker offers the same with a preview; mbm2 worker list shows what each folder sees (Workers → A team's project).

Team authority and head seats

What you need Where to look
See which rights each role has mbm2 team rights (add --format json for structured output) shows the authority table, member assignments, head seats and person-only actions.
Adjust a role's defaults .mbm2/team/rights.json may set grant, revoke and edit under rows.<role>. Without an override, the preset applies. mbm2 team check reports invalid entries.
Get approval for a protected action Ask the person. No rights row can authorize a push or deploy to production, a release, a production-gate change, handling secrets, customer data or customer installs, irreversible deletion, or an exception to a hard rule.

A head seat is not a member role. Heads can manage team records, flows and instructions and stop or move tasks, but overrides cannot rewrite the head or person rows or remove approval and review gates.

Address Recipient
<team>/main The main mbm2 tab's seat and its own inbox
<team>/<team>-boss A named external head seat, where configured
<team>/@boss The shared inbox for all head seats in this team

Send to the group when either seat can do the work: mbm2 team send acme/@boss "Review the plan" plan.md. That creates one task visible in every head seat's inbox. The first seat to take it owns it; another seat cannot take or answer it while it is held. Each seat can read its own and the shared inbox with mbm2 team inbox.

A send with --wake to @boss wakes the main tab on this host when available. External head seats receive the hand-off in their inbox, not a wake. Ordinary sends do not wake head seats automatically; these seat addresses are for the current team, not cross-project delivery.

Set up, claim and reclaim a head seat

After an upgrade: Run /restart in the mbm2 window. It starts the installed version in the same directory and restores the open tabs, their sessions and unsent prompts. If the error from a team write starts with this window's engine ( and says predates team identity: run /restart in the window, the command was refused before writing anything. This is not a saved hand-off that failed to wake its recipient. Run /restart in that window before retrying a team write. See the full diagnostic and upgrade notice. If mbm2 team send still refuses a head seat with holds no identity the engine knows or says there is no approved binding, check where the command ran. In an external head runner, run mbm2 team head claim <seat> and have the person approve it (steps 2–3 below). An engine-managed tab cannot claim a seat. If an engine-managed terminal still has an old process without an identity, close and reopen the tab when its work is done so the engine starts a new process with its assigned identity. Changing TEAM_ME alone does not fix either refusal.

Where you run the command What you can do
The person's mbm2 window or an already-recognized terminal on the engine host Review claims. Use the person's own shell for the setup and removal commands below.
A shell command run inside a Claude Code, Codex or agy session you started outside mbm2 Request a binding for that runner's named head seat. The runner is never the person.
A separate terminal you opened yourself (for example, a new SSH login to the engine host) Request recognition of that terminal's login session with mbm2 team head claim main. Do not run this inside an agent.
A session or tab started by the engine Use the identity the engine assigned. It cannot claim a different seat or the person's login.

The claim workflow below applies to v2.24.45-793a3646 on a shared local Linux engine started by an mbm2 window. Run the commands in the same team's project on the engine host, under the account that runs the window. claim main also needs login sessions recorded by the OS. See the CLI syntax and flags. These are worked examples; substitute your own team, seat and request IDs.

1. List the seats and set one up if needed. In the person's shell, run:

mbm2 team head list

Each line shows the address, runner and local instruction file (or -). mbm2/main is always listed for team mbm2. If the team has no mbm2-boss seat yet and you want one for Claude Code, run:

mbm2 team head add mbm2-boss --runner claude
mbm2 team head list

Expect seat mbm2/mbm2-boss added (claude) on success. The list now includes these rows:

mbm2/main           window  -
mbm2/mbm2-boss       claude  CLAUDE.local.md

Only a recognized head or the person can add or remove seats. With no name, add uses <team>-boss. It writes a marked heads section to a Git-ignored local instruction file, never a tracked one, backs up existing files before changing them, and notifies members. The seat record does not bind a session. --runner selects CLAUDE.local.md for claude, AGENTS.local.md for session or agy, and AGENTS.override.md for codex. Unverified: whether agy loads that file and whether your Codex build reads the override as expected; check your runner. Only the three external runners use the named claim below.

If there is already an unmarked heads section, add refuses to replace it by default. Choose one of these alternatives, not both:

# Preview replacing the handwritten section with generated instructions.
mbm2 team head add mbm2-boss --runner claude --adopt
# Or preview keeping the handwritten section and wrapping it in markers.
mbm2 team head add mbm2-boss --runner claude --keep-text

Review the preview; the confirmation defaults to no. --yes skips that confirmation for either choice, not the authority check or any future seat claim. --keep-text requires an unmarked section to keep and may report drift from the generated text. The full flag forms are in mbm2 team head --help; mbm2 team head add --help shows only --runner and --adopt besides --help.

2. Find the address and request the named claim from the external runner. Start Claude Code yourself in that project. Run these commands from the shell it uses for commands, not from the shell that launched Claude Code or from a tab the engine launched:

mbm2 team head whoami --runner claude
mbm2 team head claim mbm2/mbm2-boss

When there is one matching seat, whoami prints mbm2/mbm2-boss. It can detect Claude Code without --runner; a TEAM_ME that already names a configured seat takes precedence. If no runner or no seat matches, or multiple seats match, the command lists the seats and exits 1. Use head list to confirm which configured seat is yours; use that address explicitly rather than guessing. whoami looks up an address. Neither that output nor setting TEAM_ME binds a process or proves it belongs to the person.

The claim command prints the claim waits for the person: … need_claim_… and exits 0 when submitted for review. Pending is not approved. The engine reads the runner's process ID and start time itself. The claim does not change the runner's TEAM_ME.

3. Review and answer as the person. In your mbm2 window on that engine, open /inbox. In Decide, open the claim and check the seat, process and terminal against the runner you meant to bind. This build's claim detail shows the command to settle it, not Allow/Deny buttons. Run that command in a separate shell that the engine already recognizes as yours, such as the shell that started the window once it is available or another approved terminal. Use the ID from the actual pending item, not the examples:

$ mbm2 answer need_claim_0123abcdef012345 allow
need_claim_0123abcdef012345: allow

If the request is unexpected or the details do not match, refuse it instead. This is a different claim:

$ mbm2 answer need_claim_0123abcdef012346 deny
need_claim_0123abcdef012346: deny

The answered item leaves Decide. allow binds the named seat to that runner, replacing any previous binding for the seat. deny discards this request without granting a binding. Neither the requesting seat nor an already-bound seat can answer a claim, even with --approved. A team message is not an approval in this queue and grants no permission. See who can approve.

After allow, set TEAM_ME=mbm2/mbm2-boss in the runner's command environment for team operations. The engine checks both the address and the process binding on team writes. whoami and reading the team inbox do not verify the binding. Running the named claim again requests another decision; it is not a status check.

4. Claim another terminal as the person, if needed. In that terminal's own shell, in the same project:

mbm2 team head claim main

This asks to record its login session, not to bind an agent to main. If needed, log in as the same user on the engine host. The new terminal shows a pending need_claim_… ID. From the window, review the login session, terminal and origin in Decide. Use mbm2 answer with that ID and allow or deny in a terminal the engine already recognizes. If approved, running the same claim main command in the new terminal says this terminal is already the person's. If refused, it remains unrecognized; use the existing recognized terminal and recheck the login before requesting again.

5. Reclaim or remove. A restart clears pending claims, named bindings and additionally approved login sessions, but keeps seat records. Reopen the window as the person and repeat the relevant claim and review using a new ID. A replacement runner process also needs its own approved claim, even before an engine restart. If the seat is no longer needed, remove it from the person's shell and verify the list:

mbm2 team head remove mbm2-boss
mbm2 team head list

Success prints seat mbm2/mbm2-boss removed (claude). Removal backs up changed instructions, updates or removes the marked section as appropriate, and notifies members. Removing the last seat using a kept section returns that section to its unmarked text. The built-in main seat cannot be removed.

If you see this What to check
is no seat of the head role, or no unique whoami result Check the project and full seat address with mbm2 team head list. Ask a recognized head or the person to set up a missing seat.
no agent runner … is above the peer, or the peer was started by the engine Submit a named claim from the external runner's own command shell. An engine-launched session keeps its assigned identity.
the engine has no claim socket Confirm that the window is running a compatible shared local Linux engine and that the command is on that host under the same account. Do not use mbm2 serve, mbm2 web, macOS or Windows as a substitute for this workflow.
this system records no login sessions claim main is unavailable without OS login-session records. mbm2 doctor reports when identity relies on process ancestry instead. Do not treat that fallback as a new terminal approval.
no claim … waits, or the answer is refused Check the exact ID and engine in the person's window. The item may already be answered or lost on restart. Use an already-recognized terminal, not the runner or new terminal asking for access.
A team write is refused after approval Check that the command is still under the approved runner, that TEAM_ME names that seat, and that the engine has not restarted. Reclaim if the process or engine changed.

What a task is

Every piece of the team's work is a task: a hand-off to a member (of this team or, through a link, of another), an item on the board (<leader>t), and a task the lead delegates. A task has a title, a body, who gave it, who owns it, a state (open, taken, blocked with what it waits for, review, done, declined, withdrawn), its notes and answer, review verdicts and links (a branch, a commit). The store keeps each one as a short history in .mbm2/team/tasks/<id>/; every command adds to that history and never rewrites it, so two hosts that both change a task while apart simply end up with both changes.

Nothing changes in how you work. The commands keep their names (send, note, status, block, reply, inbox, show, sent), and the hand-off you read is still inbox/<role>/<file>.md with its «## Явц» progress and -result.md answer — mbm2 writes it again from the task after every change, so read it, but change a hand-off with the commands rather than by editing the file (an edit to its notes or status is taken in at the next command; anything else is written over). A command also takes a task's id (m-…, the Message: line of a hand-off between teams) where it takes a hand-off's path.

The first time this release opens a team's store, it turns the existing hand-offs into tasks — after copying the store to .mbm2/team/archive/<time>-tasks-migration/ — and each host's board the first time mbm2 opens there; mbm2 team check lists anything that could not be turned into a task and why. Other hosts of the team pull the converted store and convert nothing.

Who can act on a task

Unreleased. Even with read_only: true, a member can use mbm2 team status, reply, note, block, unblock, and decline on its own tasks. Those commands write to the team store, not project files, and are on the default allow list. They refuse another member's task, even for the lead acting as a member. A head seat with the close right can close another member's task, and the sender can withdraw its own request with mbm2 team status <file> withdrawn. Those exceptions do not give a member permission to answer as a person. A verified person can use mbm2 team reply <file> <answer> --as-person to answer a task they do not own.

To decline an open or taken task assigned to you, run mbm2 team decline <file> "<reason>". Give a one-line reason. The task is marked declined, and the reason goes to <team>/@boss as a hand-off that appears in Needs You until a head seat takes it. The giver is also notified unless already a head.

Review gate and read-only roles

A role's agent file can say what the role is and what it may not do (Custom agents → Role fields). Four of the fields shape how a team works together:

Field In a team
role_type: reviewer Marks the role whose pass a gated task waits for; mbm2 team roles prints role_type=reviewer after the role and /worker shows it in the role's row
read_only: true The reviewer cannot edit project files but can still act on its own tasks
review_gate: true On a builder: the lead's merge_task, and update_task … done on the builder's task, are refused until a reviewer has passed it. The refusal names the reviewer role: task t1 is by backend-t1, whose agent has review_gate: it is merged only after the reviewer role qa passes it (review_pass)
model_fallback, handoff_to A backup model for the step when the role's own cannot answer; the roles its reports go to, told to the agent

The reviewer records its verdict with the team tool review_pass (task_id, verdict pass or fail, notes). Only a worker whose agent has role_type: reviewer counts, and never the task's own owner. The last verdict decides: a fail keeps the gate shut and its notes are in the refusal; a new report_back from the builder voids the earlier verdicts, because they were about the old report. You, at the board and in the merge confirm, are not gated.

---
description: Checks the backend's work against the PRD
role_type: reviewer
read_only: true
---

Generate a team

Instead of writing seven roles by hand, mbm2 team generate (or /team generate in mbm2) makes the app-dev (the default; seven presets in all) team. The roles carry the team's role prefix and a short word you can write after @ (@pm, @lead, @ui, @api, @worker, @qa, @docs), and the preview shows a Mongolian label beside the four that have one:

Role Does Runs as Model, fallback
<prefix>-pm (төслийн менежер) triages every request; PRD.md, acceptance criteria; edits PRD.md and docs/ only (its agent's permission.edit denies the rest) session gpt-6.2-sol, deepseek-v4.1-flash
<prefix>-lead (архитектор, the lead) ARCHITECTURE.md, schema and API contracts, TASKS.md, assigns every task with no owner, merges session gpt-6.2-sol, deepseek-v4.1-flash; gpt-6.2-astra for one turn /escalate picks
<prefix>-ui the frontend Claude tab claude-opus-5.5
<prefix>-api the backend, the bulk of the coding Claude tab claude-sonnet-5.5
<prefix>-worker boilerplate, CRUD, types, seed data, batch tests session deepseek-v4.1-flash, qwen3.8-flash
<prefix>-qa (шалгагч) checks the work against PRD.md and ARCHITECTURE.md; read-only session gpt-6.2-sol, qwen3.8-flash
<prefix>-docs (баримт бичиг) all documentation: the manual, README.md, site pages and release notes; can also edit files in the mbm temp directory session gpt-6.2-sol, deepseek-v4.1-flash

The role prefix is the team's own: team.json's prefix_roles, else the first word the roles already share (zve for zangila-ve's zve-pm, zve-dev, zve-docs), else the team's name. Migrate records it in team.json when it is not the team's name, and mbm2 team check holds the roles to it. --name <team> names a new store's team and prefix (--name zb); an existing team is renamed with mbm2 team rename zb (below).

The docs role is a member like the others. Besides its place after the reviewer in the default flow, any member and you send it work directly (@docs); every other member's card says to send all documentation work to it — the manual, site pages, the README, release notes, anything a change means for the docs — instead of doing it, and to tell it when their work changes what the docs say. --without docs leaves it out.

In v2.24.45, a newly generated docs role can edit documentation and files under the mbm temp directory (<system temp dir>/mbm, usually /tmp/mbm on Linux). For example, it can edit /tmp/mbm/notes/draft.txt without an edit prompt under the preset defaults. The preset includes the resolved directory if it differs because of a symlink. This does not grant edit access to the rest of the system temp directory.

Escalation is one turn, never the default. The lead runs on gpt-6.2-sol; its agent's model_escalate: gpt-6.2-astra is the model a rare, hard decision may take. In the lead's tab, /escalate sends the next prompt on it for that one turn; the turn after is back on gpt-6.2-sol. The lead's card tells it to ask you for that turn.

Work nobody owns goes to the lead. Send work to the team without naming a member with mbm2 team send <team>/unassigned "<title>"; the pm triages (what is wanted), the lead assigns (who does it) and puts the owner on the board. The inbox watcher tells the lead once after 15 minutes that something has no owner, the pm once after an hour, and after two hours mbm2 team status shows it to you (⚠ unassigned). A hand-off in the inbox of a role with no card and no alias counts as unowned too.

--preset small makes only the lead, api, worker and qa: the lead holds the pm's duties. Each role gets a card with its duties and the files it owns, an agent with every role field (role_type — architect for the lead, reviewer for qa — model_primary, model_fallback, handoff_to, review_gate on ui, api and worker, read_only on qa; the pm, which owns PRD.md, edits only PRD.md and docs/), and a worker in workers.json: an mbm2 session in auto mode (a message wakes it; the lead also leads the team), or for ui and api a Claude Code tab (the card's Agent: claude <model>, no fallback; messages use guarded team delivery). A Claude tab signs in with Claude Code's own account, so ui and api need the claude CLI installed, not a provider connected to mbm2: with it they get their Claude models; without it they fall back to a connected model and run as sessions (install Claude Code and run mbm2 team model <team>/<role> claude-opus-5.5 to move one back, which needs no engine). The CLI is found on PATH and where its installers leave it that a non-login shell's PATH lacks (~/.local/bin, ~/.claude/local, npm's and bun's global folders); the tab then runs it from there. A fallback is never of a dearer class than its primary — the worker, fast and cheap, never falls back to astra or sol; with no model of its class connected it has no fallback. --model <role>=<model> and --fallback <role>=<model> set a role's models by its short name (--model api=claude-sonnet-5.5), and the preview prints under each role the mbm2 team model line that changes it later.

$ mbm2 team generate --dry-run
Mode:   Fresh Init
Store:  team acme (/home/you/dev/.mbm2/team)
Backup: nothing existing is replaced; …

Roles:
  create    acme-pm (төслийн менежер)     primary mbm/gpt-6.2-sol, fallback deepseek/deepseek-v4.1-flash
      change: mbm2 team model acme/acme-pm mbm/gpt-6.2-sol --fallback deepseek/deepseek-v4.1-flash
  create    acme-lead (архитектор)        primary mbm/gpt-6.2-sol, fallback deepseek/deepseek-v4.1-flash, escalate mbm/gpt-6.2-astra (one turn, when picked)
      change: mbm2 team model acme/acme-lead mbm/gpt-6.2-sol --fallback deepseek/deepseek-v4.1-flash
  create    acme-ui                       primary anthropic/claude-opus-5.5, a Claude tab, no fallback
      change: mbm2 team model acme/acme-ui claude-opus-5.5
  …
Default flow (flows/default.yaml): pm > lead > [ui, api] > qa? > [lead!, docs] > pm
Choice: team_auto is not set; the default flow needs it (--team-auto sets it in the project's mbm2.json)
dry run: nothing was written
$ mbm2 team generate --yes

The default flow: write only to the pm

See How the team works for a worked request from intake to review, with hand-offs, approvals and recovery steps.

Each role's card and agent say where its work goes next and to send it with a wake (mbm2 team send … --wake), so you write to the pm only and the rest goes on by itself:

  1. pm writes PRD.md with an «Owner's decisions» section that carries every technical direction you gave word for word, and sends it to the lead. The pm never drops, softens or reinterprets a direction; when one conflicts with the PRD it asks you.
  2. lead reads «Owner's decisions» first — it is binding unless the lead reports a conflict back — writes ARCHITECTURE.md and TASKS.md and sends each task to ui or api (small ones to a worker).
  3. They report to qa, who records review_pass or sends a fix list back. A task gets 3 rounds (each is a builder turn and a qa turn; review_rounds: 1-10 on a role changes it); a finding that repeats an earlier one unchanged is no progress and goes to the lead, then to you, at once.
  4. The lead merges under the review gate while docs brings the manual, the README and the docs site up to date with the passed change; the pm checks the result against PRD.md and reports to you.

Deploy, publish and merge keep their human approvals. flows/default.yaml holds the same path as data (pm > lead > [ui, api] > qa? > [lead!, docs] > pm) for the flow engine to run later. The default flow needs messages delivered without a person's approval, so the preview offers team_auto: true in this project's mbm2.json (--team-auto, or a yes in the terminal); the global default stays off, and waking (mode: auto) and opening tabs are separate switches.

Where it writes Files
The project has a team .mbm2/team/roles/<role>.md, <role>.agent.md, .mbm2/team/workers.json, committed in one commit under the store's lock and pushed
No team A new .mbm2/team store named after the project folder (allkino), or --name <team>; made only when you Apply, never by --dry-run. The project's .mbm/agents roles come in: a known one (coder, reviewer, pm) becomes its preset role with its instructions kept, any other a custom role <prefix>-<name>; the originals are backed up and removed, and the alias map sends their old names on

Models come from your connected providers only. The generator asks the engine which providers are connected (GET /provider's connected list, plus mbm once its key is set) and never lists a provider you have not connected. Suggestions come from the preset's models among them (gpt-6.2-sol, gpt-6.2-astra, deepseek-v4.1-flash, qwen3.8-flash and the Claude models); a role's model is used when a connected provider serves it, matched by name without case or punctuation, otherwise the best of those for the role is suggested and marked substituted (ranked by context length, reasoning flag and price; qa on a different provider from the builders; the lead never gets a Claude model because a Claude tab cannot delegate). Any other connected model is offered only when you ask for the full list: Show all models in the dialog, --any-model on the command line. In a terminal you choose Accept the suggested models for all roles or pick each role's primary and fallback; --yes accepts. With no connected provider it stops with «no active model: connect a provider first»; with none of the preset's models connected it asks for --any-model.

With roles already there, choose a mode (--migrate or --reset, or answer the question):

Mode What happens
Fresh No roles: the seven are created
Migrate (keeps your work) A role whose word after the prefix is a preset or legacy one becomes that preset role and keeps its name — zangila-ve's zve-pm is the pm, zve-dev the backend (api, role_type backend), zve-docs the docs role with its card text — so no second pm or backend is created, and @api or team model api still reach zve-dev; a bare legacy role becomes <prefix>-<short> with its instructions, permissions and tool settings kept (coder, dev, backend → <prefix>-api; tester, reviewer → <prefix>-qa; frontend, ui → <prefix>-ui; planner, pm → <prefix>-pm; architect, lead → <prefix>-lead; docs, writer → <prefix>-docs); the role fields it lacks are added; a card whose agent line names Claude Code in prose («Агент: Claude Code (cp, Remote Control)…») keeps that line and gets a Model: line; a role keeps the models you chose (its model, fallback and escalation model, a Claude tab's model and its --resume session): the preview shows the preset's model only as preset suggests: … (mbm2 team model …), --model role=… still sets it, and --reset is the way to take the preset's; a model whose provider is not connected is replaced and marked; a role the preset does not know stays exactly as it is; the missing preset roles are created. Run it again and it says no changes
Reset Every role is archived, then the seven are created from the preset. It asks you to type reset (unless --yes)

A Migrate keeps a role's own agent body and card, and that prose may still name the roles the preset renamed or archived («delegates to coder», «has the reviewer verify»). The preview lists each such line under the role: prose names old roles: coder → zve-api, reviewer → zve-qa, then the file, the line number and the line, so you can update it. Nothing is rewritten automatically; the names come from this run's renames and archives and from aliases.json, the role's own old name and headings are left out.

A backup is always made first: .mbm2/team/archive/<time>/ (committed with the change) or .mbm/backups/team-<time>/. --dry-run prints the preview (mode, roles created, migrated, archived or kept, the final models with substitutions marked, how open tasks continue, the backup path) and writes nothing.

Check temp-directory access for existing docs roles

Run mbm2 team check from the team's project. Its temp-directory check needs no running engine or model catalogue. For an existing docs role it can list the exact missing allow rules and where to put them, name a rule that already restricts the directory, or flag rule order for manual review. If the policy cannot be read, inspect the role file before acting on the advice. A warning does not change permissions, and no warning does not prove that every file under the directory can be edited.

To review migration without writing, run mbm2 team generate --migrate --dry-run. The preview still shows permission advice when it plans no write for that role. Migrate can add the preset permission block only when it can read the role's policy and finds neither a permission block nor an existing edit policy. It never extends an existing block, even a preset one with a leading deny. It also preserves legacy tool settings such as tools.edit: false. Review any suggested change yourself. If nothing else needs to change, the role file is not rewritten.

Running work is never lost or killed. The command reads the sessions that are running, the lead's tasks and the board, and the open hand-offs. While a session of the project is running it refuses; --wait waits for the running turns to end (--wait-timeout, default 10 minutes) and then goes on. The old role names are kept in an alias map (.mbm2/team/aliases.json, or .mbm/aliases.json): a hand-off sent to coder reaches acme-api, a task owner or a delegation to coder goes to acme-api, the board shows coder (archived → acme-api), and mbm2 team inbox acme-api also lists what waits in the old inbox. Worktrees, branches and uncommitted changes are never touched; the backup holds a CONTINUATION.md listing each task and hand-off that moved. The board's stored owner names are not rewritten; the alias map resolves them.

Instruction files in the role folders. CLAUDE.md, CLAUDE.local.md, AGENTS.md, AGENTS.local.md and GEMINI.md of each role folder keep the managed <!-- team:role --> block that mbm2 team setup writes: a renamed role's block names its new role, a role that goes loses it, a block found twice becomes one. Text about the role outside the block is yours: the preview lists it as «role text outside the managed block» with the file and line, and --move-role-text (or your yes) moves it into the role's card. A file git tracks (CLAUDE.md, AGENTS.md) is changed only after its diff is shown and you confirm; --yes alone skips it and says so, --edit-tracked allows it. Every changed file is copied first to .mbm/backups/team-<time>/instructions/ on this host (not committed, since it may be personal).

An old, unmarked copy of the role block goes with the managed one. A setup that came before wrote by hand a section such as # Role / «Чи бол zbackup-pm … .teams/README.md-ээс эхэл»; when a # Role section outside the markers carries the old block's words (Чи бол, .teams, .team-role, mteam) and names a former team of the store, a former name of the role (the alias map, this run's renames) or .teams/, the same rewrite removes it (down to the next heading), the preview says «old role block removed: : (it names the former role zbackup-pm)», and the file is backed up like any other instruction file. The project's main folder gets the same for its CLAUDE.local.md and AGENTS.local.md. A # Role section that names no former team or role is yours and is only listed as «role text outside the managed block».

The project's main folder is where your main session works and, in the preset, where every member's tab runs, so its CLAUDE.local.md and AGENTS.local.md get the team's block, never one member's: the team's name, its members and how to reach them (mbm2 team status --all, inbox, send), and that the AI team repository is not this team. The block and every generated role's agent name both ways to reach a member: in the window, a quick question or an answer goes with the send_message tool (to: "<member>") and the member's tab opens at once; a hand-off of work, or a message to a member on another host, goes with mbm2 team send <team>/<member> "<title>" <file> --wake. team generate --migrate rewrites the older wording («hand work on with mbm2 team send …», «Use mbm2 team send … --wake») in the block and in the agents it generated, and leaves an agent body you wrote differently alone. A member's own role comes from its start prompt and agent. Only when the main folder is a role's own (its .mbm2/role names it, as zb in zbackup's ~/dev) does it keep that role's block. Every folder of the project and of its members also loses what pointed at the AI team repository's layout — a .teams link (the clone itself is not touched) and a .team-role file — and a folder whose role was archived loses its .mbm2/role; the preview lists them under Folders, and each is copied to the run's backup first.

The seven presets

--preset <name> (and the first dialog of /team generate) picks the team. app-dev stays the default when no preset is named, and a team that exists keeps running as it is: a preset changes it only through --migrate or /team edit, after you agree. Every role has the same parts as the app-dev ones (card, agent with its role fields, worker, flow lines); the table gives each preset's members and the short word @<short> reaches them by.

Preset For Members (<prefix>-<short>) Who leads
app-dev building an application pm, lead, ui, api, worker, qa, docs lead
small a small application lead, api, worker, qa lead, holding the pm's duties
sysadmin one person running servers and devices watch (хяналт), ops (үйлчилгээ), sec (аюулгүй байдал), docs (баримт бичиг) you, from the main tab
content writing, documentation, marketing editor (редактор), writer (зохиогч), translator (орчуулагч), review (шалгагч) editor
data analysis analyst (шинжээч), sql (өгөгдөл), check (шалгагч), report (тайлан) analyst
support answering people triage (ангилагч), repro (давтагч), reply (хариулагч), kb (мэдлэгийн сан) you, from the main tab
review a read-only audit of the project lead (ахлагч), code (кодын шалгагч), sec, docs lead

Models. A role that only reads and reports takes a cheap, fast model (deepseek-v4.1-flash, qwen3.8-flash); a role that changes something or judges takes a strong one (gpt-6.2-sol, or claude-sonnet-5.5 for the roles that write queries and reproductions). Only the roles that lead (editor, analyst, review lead) carry model_escalate: gpt-6.2-astra, as the app-dev lead does. A model that is not connected is replaced by the best connected one for the role and marked substituted, as in app-dev.

A team led by you. sysadmin and support have no lead role. The main tab is the lead: the generator writes "lead": "main" at the top of the team's workers.json, the main tab's session is offered the lead's tools (delegate_task, wait_reports, review_task, merge_task) and hands out the chores, and the team panel and mbm2 team status --all say lead: you (main tab). /team lead main makes any team led by you, /team lead <worker> gives the role to a worker again. A worker that leads ("lead": true) and "lead": "main" cannot both be in one file.

Make or reorganize the team by chatting: /team edit

/team edit (and /team new, the same) in the main tab sends the agent a short prompt that loads the built-in team-edit skill. With no team the agent reads the project (languages, folders, tests, deploy) and proposes a preset and its members with a reason each (Go API and React front end: api and ui). With a team it reads the team as it runs (mbm2 team status --all, mbm2 team agents: members, models, spend, the tasks each holds and how they went) and proposes changes with reasons: add, drop, split or merge a member, change a model, rename the team, move a member to another project. Words after the command are your own wish (/team edit add a docs writer).

Every proposal is shown as the command's dry run (mbm2 team generate --dry-run, or --migrate --dry-run, or team add|remove|model|move|rename --dry-run) and applied with --yes only after you say so in the chat. Open tasks go to a successor, a backup comes first, and the agent never writes a role file by hand. At the end it offers to give the team its goal. mbm2 team edit in a terminal prints how to start the conversation in a window.

Rename the team

mbm2 team rename <new-name> (one argument that names no member) gives the team a short name — zb for zbackup. Every role that carries the old prefix takes the new one with its card, agent, inbox (hand-offs move, their To: rewritten), worker and flow member: zbackup-pm → zb-pm, zbackup-docs → zb-docs, the role named zbackup → zb. team.json keeps the old name among its former_names and the alias map the old role names, so a hand-off or a sender that still writes zbackup/zbackup-docs reaches zb/zb-docs; this host's role folders (.mbm2/role), the registry and the list of stores follow. The preview, the backup and --dry-run are generate's, and the change is one commit in the store's history. Other hosts' windows list the team under its new name once they /restart.

$ mbm2 team rename zb --dry-run
Mode:   Rename The Team
…
  rename    zbackup-pm -> zb-pm   card, agent, inbox, worker and flow member move; zbackup-pm stays an alias

Add a member

mbm2 team add <role_type> (in mbm2: /team add, or /worker → Add a role…) adds one role to a team that exists, by the same standard team generate uses: the card, the agent with every role field, the worker, the models resolved from your connected providers, a place in the handoff graph and the default flow. It shows the preview, makes a backup and applies in one commit, like every command here.

mbm2 team add worker                       # <team>-worker-2 (then -3, …): a second worker
mbm2 team add backend --name billing       # <team>-billing, from the backend template (a Claude tab)
mbm2 team add reviewer --model mbm/gpt-6.2-sol --yes
mbm2 team add custom --name docs --duty "Write the manual." --read-only
mbm2 team add --helper api-tests --under api --cli claude       # a helper under a role, no card
Request What it writes
pm, architect (lead), frontend (ui), backend (api), worker, reviewer (qa) The preset's card and agent for that type, named <team>-<short> (-2, -3… for a second of a type, or --name); models as in team generate (--model, --fallback, --any-model choose); a worker recipe: a session in auto mode, or a Claude tab for a Claude model
the handoff graph The roles whose template hands to the new type list it: the lead's handoff_to gains a builder, the qa's coverage gains every builder; the new builder hands to the qa
the default flow flows/default.yaml gains the member; a second ui or api joins the parallel step ([ui, api, billing])
@worker team.json's workers group lists every worker, so @worker is the group of all of them; the lead picks a free one
custom A role you describe: --name, --duty (one line), --read-only or not; role_type: custom, it reports to the lead
--helper <name> --under <role> A worker under a role in workers.json (no card): a session on --agent (default the role's) or a terminal --cli claude|agy|codex; it opens in the role's folder

Remove or move a member

mbm2 team remove <role> [--to <role>] (in mbm2: /team remove) takes a role out of the team without losing its work. It first checks what is in flight: a role that is working is never killed — the command refuses, or with --wait (in mbm2 the Wait row) waits for its turn to end. Then, after the preview and a backup, in one commit:

What Becomes
The role's card and agent Archived: copied into .mbm2/team/archive/<time>/roles/ and removed from the team; never deleted without that copy
Its open and taken hand-offs, with escalations Moved to --to (default the lead) with a note «reassigned from … to …»; done ones stay in the old inbox
Its open tasks, board items, the lead's tasks Reassigned by the alias role → to, so a thread, a task owner or a message to the old name still resolves
Its worker (and the helpers under it) Removed; its tab closes after its turn
The handoff graph, the default flow, the worker group The role is dropped; a lead, pm or qa step in the flow names --to
Its worktrees and branches Kept and listed in the preview

The team's last lead, or its last reviewer when roles have review_gate, asks for a replacement first (--to names the new lead, or mbm2 team add reviewer first); a Claude tab cannot take over as the lead.

mbm2 team move <role> --to-project <path> (in mbm2: /team move <role> <project folder>) moves a role to another team. Each project has one team store, so another team is another project's store (mbm2 team init <name> there first); mbm2 team move acme/acme-docs beta --to-project ../site and --name rename it there. The card, agent, worker and open hand-offs (each annotated with where it came from) arrive in the other store, the old one keeps an alias to <team>/<role>, both handoff graphs are updated, and each store is backed up and committed once — the other project's first, so a failure leaves the role where it was. The limit: a hand-off sent to the old address is routed by the alias only inside the old store (send to the other project's role from that project), and the role's folder, worktrees and branches stay where they are.

A member is a record: use commands, not file edits

In store version 3, .mbm2/team/members.json is authoritative for member settings such as runner, models, budget, review gate and who leads. team.json retains the compatibility roster. Agent files and the team's workers.json are generated. Use commands such as mbm2 team model, budget, open-on-start and lead instead of editing those outputs. mbm2 team lead <team>/<role> selects a member, main makes you the lead from the main tab, and - leaves no lead. Use --dry-run to preview.

Migration is not read-only. The first applicable operation that locks a legacy store, including plain mbm2 team check, can convert it, commit to the team store and sync if enabled. It builds records from the legacy agent files, worker entries and card metadata. When it rewrites generated files or drops entries, it copies the old files to archive/<time>-records/. Review the migration report for what was merged or dropped. A binary that finds a newer store version reads what it can but refuses changes and asks you to upgrade.

mbm2 team check reports differences between the records and generated files. In v2.19.92, --fix regenerated files from the records and kept unmatched workers. Starting with v2.20.09, --fix can take hand-edited agent settings into the record before regenerating. Review hand edits before using --fix; it is not a read-only check.

A member session cannot fall back to the team's main head seat, even if an older worker record names a generic agent such as build. If mbm2 team check reports acme-dev uses agent "build", review the finding and run mbm2 team check --fix to rebind the member to its own agent, acme-dev in this example. This repairs the agent setting, not a conflicting or unreadable saved session binding. If the check reports two tabs sharing a saved session, start a fresh session in each instead of choosing one to keep the binding.

Change a member's model

/model changes the model of the session you are in, for that session only. To change what a role runs for good:

/team model lead mbm/gpt-6.2-sol --fallback mbm/qwen3.8-flash          # or: /worker → the role → Change model
mbm2 team model acme/acme-lead mbm/gpt-6.2-sol --fallback mbm/qwen3.8-flash

It writes the role's agent file (model_primary, model_fallback) after a preview, a backup and Apply. The model must be served by a connected provider (a Claude model is taken as typed). In /worker → the role → Change model the primary is followed by a second question, the fallback (the model that takes over when the primary fails): Keep the one the role has, None, or a model of the same list; a Claude model skips it, since a Claude tab has no fallback. --fallback none is the same answer at the command line; without --fallback the role keeps its own. The workers page shows each session role's fallback beside its model («fallback mbm/qwen3.8-flash»), and mbm2 team check reports a role whose model or fallback no connected provider serves, with the command that fixes it («not checked» when no engine's catalogue is available). Moving a role to a Claude model makes it a Claude tab (the card gets Agent: claude <model>, no fallback, the worker becomes a terminal worker), and moving it off one makes it a session again (the card's Agent line goes). The lead may be a Claude tab too: the team's tools reach it, delegate_task and merge_task included. A Claude tab can carry on a Claude Code conversation you had before:

mbm2 team model zve/zve-lead claude-opus-5.5 --resume df1e3cc6-ec28-4b18-9d53-031046da9cfb

The tab then starts as claude --resume <id>. The session must belong to the same user and the role's folder (Claude Code keeps sessions per folder, under ~/.claude/projects/), and no other claude may hold it open. A later model change keeps the argument; --resume none drops it. A Claude tab has no model_escalate: it runs the model you gave it. /worker <role> focuses or opens that role's tab (/worker ui).

The escalate model is the stronger model one hard turn may take (/escalate; the leads of the presets have one). --escalate <model> writes the agent's model_escalate, --escalate none removes it, and with no model before it the role keeps the one it has:

mbm2 team model lead --escalate mbm/gpt-6.2-astra     # or: /team model lead --escalate mbm/gpt-6.2-astra
mbm2 team model lead --escalate none

The model must be served by a connected provider (a Claude model is refused, and so is a Claude tab: it has no escalate); the preview shows it («escalate mbm/gpt-6.2-astra»). A model change that names no --escalate keeps the one the role has, and a move to a Claude tab drops it. In /worker → the role → Change model a lead (role_type: architect or lead) is asked a third question after the fallback: Keep its escalate model, None, or a model of the same list; the other roles are not asked.

Inspect and repair team models

Unreleased. Run mbm2 team models in a terminal or /team models in the mbm2 window. For scripts, use mbm2 team models --format json. Each row shows one member's runner and configured primary, fallback, and escalate models. Last ran on shows which model actually ran and when, if the engine has a record. It labels that model primary or fallback if it matches the current configuration; default means neither, not necessarily the provider's default. The last-used model is read from saved assistant messages.

Mark What it means
✓ No problem found by the available checks. It does not mean a live request succeeded.
✗ A problem was found. Read the error and the exact fix command printed under the table.
? No other problem was found, but there was no engine catalogue to check against.

The default view spends no tokens. It checks model spelling and, for session models, whether the connected provider lists the model. For Claude tabs it checks spelling only. mbm2 team check also reports the static problems; it does not test whether a model answers.

In an mbm2 agent file, write a Claude model as claude/<id> (for example, claude/claude-opus-5.5). The engine rejects a bare Claude ID in model, model_primary, model_fallback, or model_escalate. The parse error names the correct spelling and mbm2 team check --fix, which can repair the agent file. This does not change the ID that the Claude Code worker itself uses.

To send a live test request, run mbm2 team models --probe. The CLI prints the request count and warns that it costs tokens before sending anything. It asks for confirmation in a terminal; without a terminal, it refuses unless you pass --yes, which skips the prompt. It sends one small request per distinct target on its runner: non-Claude models configured for session members through the engine, and Claude tabs' primary models through Claude Code, deduplicated by Claude Code model alias. A probe failure marks the row ✗ unless it was already marked ✗ for another reason. A skipped probe is not proof that the model works or that it failed.

If a member's own model fails, open Needs You with /needs or mbm2 needs. For a session member, model-not-found, auth, and provider-not-connected raise a model item. It names the failure, any fallback used, and the repair command: mbm2 team model <team>/<role> <model> --yes (replace <model> with a working model). If a usable fallback is configured, the engine can retry the step on it before any output; without one, the turn fails rather than silently taking another model. Quota, rate-limit, and provider 5xx errors can still trigger fallback but do not raise a model item. The item clears when the same model succeeds or the role's model changes, and does not survive an engine restart.

One session per member, and a new one when it stays big

Every member keeps its own session. A Claude tab starts as claude --session-id <uuid> the first time and reopens as claude --resume <uuid>; mbm2 keeps the id with the member (never --continue, which takes the newest session of the folder and so may be another member's). A --resume <id> in the worker's args is its first id.

When a member's session still holds more than session_rotate_after tokens (default 50000, 0 turns it off, in mbm2.json) after an automatic compaction, mbm2 closes it for good and starts a new one for that member, and a toast says so: zve-docs: new session (the old held 120k after compacting). The new session's first message is the compact summary, the member's open board tasks, where to read its hand-offs (mbm2 team inbox) and the old session's id. The old session stays in history. An mbm2 session says its size itself; for a Claude tab mbm2 reads the end of ~/.claude/projects/<folder>/<id>.jsonl every half minute (never the whole file). Main is never rotated.

You can ask for a fresh session yourself: /team fresh <member> [brief] in the window, mbm2 team send <team>/<role> <title> --new-session (implies --wake; needs the member's window on this host), or the pm or the lead with new_session: true on send_message or delegate_task. The member's current session is left in history and a new one starts with the brief (a Claude tab is restarted under a new --session-id). Only the pm, the lead and you may ask; anyone else is told «only the pm, the lead or the person may start a member's new session».

Open a member's tab when mbm2 starts

/worker → the role → Open on start (on or off), or

mbm2 team open-on-start acme/acme-api on          # preview, Apply; --yes, --dry-run

writes open_on_start on the member's entry in the team's workers.json (a role from its card gets an entry of its name and agent, so it keeps its folder), after a preview and a backup. With it on, the tab opens when mbm2 starts in the project. It is not team_auto_open, which opens a closed member's tab when work reaches it (§8).

Cost limits

Each role may carry a limit on what it spends in a local day. It is the agent's budget field: budget: unlimited (what team generate and team add write, and the default when the field is missing) or budget: {tokens_per_day: 400000, usd_per_day: 5}, either or both.

/team budget api $5                       # or: mbm2 team budget acme/acme-api '$5'
/team budget api $5 400k                  # both limits; 400k and 1.5m are tokens per day
/team budget api unlimited

The command writes the role's agent file after a preview, a backup and Apply, like /team model. /team lists each role's spend today against its limit:

acme-api  $3.10 / $5.00  ·  410k / unlimited tokens

and mbm2 team status --all adds a spend column and the same lines.

Blocked work and the whole board

Work that is stuck should say so. The role that holds a hand-off marks it:

mbm2 team block inbox/acme-api/2026-11-26-from-acme-lead-api.md "the TPM key"   # or the agent's own shell
mbm2 team unblock inbox/acme-api/2026-11-26-from-acme-lead-api.md

The hand-off keeps Status: taken and gains a Blocked: the TPM key line, so every tool still reads it; mbm2 lists it first as blocked, with what it waits for, in mbm2 team inbox, mbm2 team status and /team board, and never as «⚠ silent». The pm (else the lead) gets a hand-off at once; after 24 hours mbm2 team status also prints a line for you, the owner. mbm2 team status --all (and /team board) is the pm's view of everything: every hand-off, the lead's delegated tasks and the board's items with their owner, state, last progress and age. The pm's card says to read it when it starts and before it reports.

Unreleased: For a task blocked for more than a day, a person can use Close, Withdraw, or Open the task in Needs You. From a project terminal with no member role, mbm2 team status <file> <state> sets the same state as <team>/main: use done, withdrawn, or open respectively.

An ordinary blocked task is still waiting for something. mbm2 team check flags stale blocked tasks whose owner is no longer on the team or whose escalation is gone or settled. It checks the escalation only if the engine can report its state. mbm2 team check --fix closes those findings as done and leaves a note.

8. Waking And The Inbox Watcher

Every mbm2 engine watches the inboxes of the roles set up on its host (mbm2 team roles). It pulls the project's team store every minute while a role's session works or waits for an answer, and every five minutes when it is idle (spread a little, one pull per store, under the store's lock). For each new open hand-off to a role it wakes the role once:

The role's session What the wake does
Shown in a tab of an open mbm2 The tab gets the message; its team auto decides when the agent reads it
Closed, and an open mbm2 window holds the role's project and has the role as a worker (a session or a Claude tab) With team_auto_open on (the default) the window opens the role's tab in the background, without moving your focus, and delivers the wake as a team message: its team auto and budget decide, as for any message. A Claude tab gets the text typed in once it has started
Exists, its tab closed, no such window (or team_auto_open off) The session goes on headless, in auto mode
None yet A new session in the role's folder, headless, in auto mode, on its agent (.mbm/agents/<role>.md)

/team autoopen on|off (and /config → Auto-open worker tabs) writes team_auto_open. It is not team_auto: team_auto decides whether a message between members reaches an agent without your return; team_auto_open decides whether work for a closed member opens its tab or runs where you do not see it. A Claude tab is not in the registry, so the watcher also reads the inbox of every Claude tab of an open window of the project, for as long as the window is open; with no such window the hand-off waits in its inbox.

The registry follows the team. The watcher wakes only the roles mbm2 team roles lists, so the team generator keeps that list right: after team generate (fresh, --migrate, --reset), team add, remove, rename and model, it holds one <team>/<role> <folder> line for each role that runs as an mbm2 session (the project's folder, or the role folder you set up), and no line for a role that was removed, renamed or archived, for a former team of the same project, or for a Claude tab. A Claude tab is never woken headless: an open window of its project takes the wake and types it into the tab (above); with no window the hand-off waits in its inbox and shows in the open tab (✉ N; see guarded team delivery). The preview names the change (Host registry: + zve/zve-pm /home/zangila, − zangila-ve/zve-pm /root/roles/zve-pm), the old file is copied to the plan's backup on this host, --dry-run writes nothing, and the file is replaced in one rename with mode 0600. Another team in another folder is never touched. mbm2 team check reports a registry that disagrees with the team (a session member with no line, a line for a member that is gone, a folder that does not exist) and says the fix: mbm2 team generate --migrate. team setup and team import still add their lines.

mbm2 team roles inside the project lists the team's members, not only the registry: each with its role_type, its runner (mbm2 session, claude tab…), its folder and registry=yes or registry=no (a session member with no is never woken), then «other lines in this host's registry» for the teams of other folders. Outside a project it prints the registry as it is.

The message is New work in your inbox: TPM export (inbox/acme-dev/2026-11-25-from-acme-pm-tpm-export.md) — read it, mark it taken with mbm2 team status <file> taken, do it, then mbm2 team reply <file> <answer>. Its sender is who gave the work, so an escalation goes back there. Open the role's tab later and the session shows the work and a recap.

You want Do
The role to start now, not at the next pull mbm2 team send acme/acme-dev "Fix the build" body.md --wake
A host with no mbm2 open to keep watching mbm2 team watch in a terminal, or mbm2 team watch --install (a user service; prints the systemctl --user enable --now and loginctl enable-linger commands to run)
Set up a role and its service at once mbm2 team setup acme/acme-dev --from ~/dev --watch
See what is watched mbm2 team watch --status
See the role's open hand-offs ✉ N in the footer (a click opens /team inbox)
Fewer unattended turns "team_wake_per_hour": 10 in mbm2.json (default 30: woken turns, and their judge calls, per hour)
Turn the watcher off MBM_TEAM_WATCH=off in the environment mbm2 starts in

--wake for a role of another computer goes through the relay to your account's window labelled <host> <role>; when there is none it says so, and the role's own host finds the hand-off at its next pull. A hand-off is never woken twice, and team_auto_budget (500) caps the woken messages one session takes before a person prompts it.

The sender is told when the work ends. Whoever gave a task hears when it ends, whatever way it ended: the receiver answered it (mbm2 team reply), or set it done, declined or withdrawn (mbm2 team status <file> done|declined|withdrawn), or a board item you put on the workspace's board was set done. The same watcher reads each store after a pull and, for every task whose from is a member it serves (a registry role, or a Claude tab of an open window), wakes that member once: acme/acme-dev finished: TPM export — Exported 3 files. (task m-…), through the same wake as new work (its tab in the window, else headless). A task that someone ended themself tells nobody, a refused wake (the hourly budget) is tried at the next pull, and only the last day's endings count, so a long-lived store does not replay its history. When you gave the task (as main, a person of people.json or team_people, or a name that is no member of the team), it is a «Needs you» item instead (/needs, mbm2 needs): finished, from the member who ended it, with the task's id; mbm2 needs <n> opens it and clears it, and it goes by itself after a day. A hand-off to another project's team reaches the sender's store the way its answer does, and the sender's host tells it. A lead's own task in the workspace keeps report_back; the store does not tell it a second time.

Replies to escalations. When an escalation's hand-off gets a reply (mbm2 team reply <file> allow), the engine that runs the worker reads its first line at the next pull and answers as mbm2 answer would:

The escalation Answered by a reply from
A question Any role: the answer in words, or deny <why>
A permission (allow, always, deny) Only a person: a role in team_people of your global mbm2.json (mbm2 team people add acme/owner, at a terminal) that is not set up on this host

A reply by an agent's role to a permission leaves it waiting, with the reason in /auto log. A person answers with mbm2 answer esc_… allow, in a window, on «mbm code», or with a reply written as their person role (TEAM_ME=acme/owner mbm2 team reply <file> allow --as-person, which checks first).

Unreleased: A member session normally sets TEAM_ME to its own address. Explicitly setting it to that same address does not trigger the impersonation guard. Naming another member, a head seat, or <team>/main still asks, even alongside a self-assignment. --as-person, changes to team people, and other guardrails still apply. See Who can change permissions.

9. Watch And Manage

You want to Do
See every tab and job at once /activity (ctrl+alt+o)
Know what a worker did while you were away Open its tab: a recap says what was done, what runs, what waits
Read the board <leader>k
See the messages and the team /team (<leader>shift+i)
Check auto mode's decisions /auto log
Change a role Edit its file; the next message uses it, no restart
Pick another model for one tab /model in that tab; it stays the tab's model
See the team's kept rules /team rules (d revokes one)
See the role's hand-offs ✉ N in the footer, /team inbox or mbm2 team inbox
Close a tab, not its work <leader>shift+w; the session keeps running on the runtime

When Something Goes Wrong

You see Cause Fix
agent "pm" is not available in the v2 engine mbm2 older than v2.17.62 runs no custom agents mbm2 upgrade, then /restart in each window
The same command asks again after «This project» The role's own bash rule outranks the project's allow Remove bash from the agent file; keep the policy in .mbm/mbm.json
Not kept for this project … the rule … still decides Another rule read later wins: an agent file, a closer folder's .mbm/mbm.json, MBM_PERMISSION Change that rule, or choose «This session»
Each worker asks the same thing «This session» covers one session «This team» for the lead's workers, or «This project»
ls or cat still asks A rule naming the command asks, or a write or substitution is in the line Remove that rule; split the command
A worker runs on an unexpected model No model in its agent file or the project Set model; /model once in a session that already started
Messages pile up in /team Team auto is off or its budget is spent return on each, or turn team auto on
A worker stopped with escalated: esc_… Auto mode needed a person and nobody answered mbm2 answer esc_… allow or answer in «mbm code»
A hand-off arrived but the role did not start No mbm2 runs on its host, or team_wake_per_hour is spent mbm2 team watch --status there; mbm2 team watch --install
A reply allow left the escalation waiting The reply's role is an agent's, not a person of team_people on that host mbm2 answer esc_… allow at a terminal there

Published from revision f88fc66f 2026-11-30