Create a Session Group in One Step
Want a clean group dedicated to one project or task? Send /group <group name> (short form /g). The bot will:
- Create a new Lark group and add you to it;
- Transfer group ownership to you;
- Reply with a card containing the join link.
Open the group and start talking to the bot. The whole group is one independent CLI session (a session is one running AI coding CLI process, such as Claude Code or Codex).
The reply looks roughly like:
Creating the group does not start a session. The session starts when you send your first message in the new group. To create the group and start on a task right away, add
--start; see "Create and start a task" below.
botmux has two kinds of "session group". This page covers both:
Create a group with /g
Group name and avatar
- With a name: your name is used and never changed afterwards.
- Starting a task (
--start): the first 20 characters of the task name the group, then a short title generated from the task replaces it (see "Create and start a task"). - Without a name (just
/g): the group starts with the placeholder "New session MM/DD HH:mm". After your first substantive message in it, the bot summarizes a title of up to 20 characters and renames the group. - Avatar: by default, the botmux logo on a gradient background (one of ten palettes, fixed per group). Add
--avatar namefor a text avatar showing the group name, or--avatar offto keep Lark's default.
A group-name text avatar generated by --avatar name
About automatic renaming:
- Slash commands, messages that only contain images/attachments, and bot messages are not used for naming.
- If you rename the group yourself first, your name wins.
- In a multi-bot group, only the bot that created the group names it.
- If naming fails, the placeholder stays and naming is retried on your next message (the two retries wait at least 30 seconds and 2 minutes), up to three rounds.
- AI naming runs the CLI once on the host, so it only works when: the CLI is Claude Code, Codex, TRAE CLI (traex), OpenCode, Antigravity, Grok, Pi or oh-my-pi; the bot has no file sandbox; the host has no device-credential isolation; no custom launch mode is used; and Codex does not use private login or an instance pool. Otherwise the placeholder stays.
Bring several bots along
@-mention bots in the command and they are all added to the new group. The first @-mentioned bot creates it:
The reply lists "🤖 Bots in the group: Claude, Codex". In the group, @ whichever bot should do the work.
If you don't want to @ every time, use --agents with names or app IDs. The bots don't have to be in the current chat, but they must be configured in this machine's bots.json with a Lark connection:
Names are case-insensitive. Unknown or duplicate names fail before the group is created; use app IDs for duplicates.
If you have set up a decision-board steward on this machine with "Add the steward to new chats" enabled, and the steward's owner is in the new group, the steward is added too (it stays silent and opens no session). Groups with only you and one bot don't get it by default.
All options
Notes:
- Values can be written as
--tag=Projectsor--tag Projects; quote values with spaces. - Missing values, invalid values and repeated options fail before the group is created, so you never get a half-wrong group.
- Unknown
--xxxwords are not errors; they stay in the group name as-is. --tagis a message group in your personal sidebar, not a tenant-wide chat tag. The first time, authorize it: send/login tagsin a chat with that bot and confirm the link. Without authorization the group is still created and the reply tells you what is missing.- Failures to invite bots, set the tag or set the avatar are reported separately in the reply; the created group is kept.
Create and start a task
With --start, the text after /g is the task (multi-line is fine):
You can also quote a message and send just /g --start; the quoted message is the task.
To make a bot's /g start tasks by default, set "autoStart": true for it (next section) and you no longer need --start; add --no-start when you only want a group. With multiple bots, the first @-mentioned bot is the creator. Multi-line command recognition uses only that creator's shared configuration, so another bot's autoStart cannot split the routing decision.
Options (--start, --tag, …) are read from the first line only; later lines are kept verbatim as the task. If the first line of the task itself contains words like --tag, put -- before the task, e.g. /g --start -- npm publish --tag canary.
After the group is created:
- The group is first named after the first 20 characters of the task, then renamed to a short title the bot's own CLI generates from the task (kept as is when the CLI has no one-shot mode or the bot is sandboxed);
- The quoted message, and the command message if it has attachments, are forwarded into the new group;
- The creating bot opens a fresh session in the new group and starts right away. Its first turn is your words plus where they came from (source chat, message, thread, quote) — no context from the old session; the bot reads the originals itself;
- Local bots in the group may @ each other without approval (talk-only grants) so they can split the work;
- You get a reply where you sent the command: the group link plus notes on anything that failed (start, forward, grants). A failure after the group exists never removes the group.
The lead-in of that first turn can be edited on the Dashboard Customization page under "Session start → /g task group".
Apply a role profile
If you keep reusable collaboration personas in a role profile, add --role-profile when creating the group:
After the group is created, the creator bot applies its own entry first, then posts @Codex /role profile apply collab-main --quiet in the new group so each other bot applies its own. A bot without an entry in the profile is fine; it keeps its default role.
Set defaults for a bot
If your team always uses the same set of bots and the same tag, give the bot defaults so a bare /g is enough. In that bot's bots.json entry:
You can also send /botconfig set groupCreation <JSON> in Lark, and /botconfig unset groupCreation to reset.
- Options in the command override the defaults.
- With a default list, @-mentioning just one of those bots with
/gstill brings in the whole team (deduplicated). --no-agents,--no-tagand--avatar offonly drop defaults; they never remove bots you explicitly @-mentioned.autoStartdefaults tofalse: the text after/gis only the group name; withtrueit is a task the bot starts on (--no-startturns that off for one command).- Without
groupCreationand without options, only the current bot and the bots you @-mentioned join.
Add missing bots to an existing group
Each bot can store its own invitation list in its bots.json entry:
Use @bot /botconfig set inviteConfig {"agents":["Review","Build"]} to save changes immediately, or @bot /botconfig unset inviteConfig to clear them. This setting is independent of /g's groupCreation; group-creation defaults are neither inherited nor migrated.
A bot admin sends @bot /invite all in a group to add missing members from that bot's inviteConfig.agents. Names and app IDs resolve as they do for /g, and must refer to configured Lark bots in this deployment. Each app ID is invited once; the current bot and existing members are skipped. An unknown or ambiguous entry, or an unavailable membership check, prevents invitations for the entire list. An empty list prompts configuration first. After a partial invitation failure, repeat the command to add the remaining bots.
Bare @bot /invite still displays usage help. @bot /invite @target and /invite --app cli_xxx continue to process only explicit targets without reading defaults. all cannot be combined with explicit targets. Invitations do not change the group's name, tag or avatar.
Revoking admin access or changing or clearing the default list during execution stops invitations that have not yet been sent. Completed invitations are kept; check access and the list before running /invite all again.
Create a group in the Dashboard
Prefer not to type commands? Open the Group Management page in botmux dashboard and click "New Chat":
- Check the bots to add (the Dashboard picks an online bot as the creator);
- Enter a group name;
- Optionally set "Bind Directory": new topics start the CLI there directly, without the repo picker;
- Optionally choose a Lark tag (sidebar message group).
For an existing group, click "Duplicate": the source group's bots and bound directory are preselected, and you can also copy the per-group roles.
"Duplicate" (the screenshot shows the Chinese UI): bots and bound directory are preselected; per-group roles can be copied too
Click "Manage" on a group to open its details. The "Leave / Disband" tab lets selected bots leave the group, or disbands it. Disbanding only succeeds when a bot in the group is the owner; otherwise have the bots leave instead.
The "Leave / Disband" tab in group details (Chinese UI shown)
The top of the Group Management page switches between "Groups / Session chats"; session chats are sorted by recent activity by default, or by creation time. See Dashboard Control Panel for more.
DM dedicated groups
Once enabled, every new message you send the bot in a DM creates a group containing just you and that bot to host the conversation, and the DM gets a receipt with the group link.
Turn it on
Either:
- Dashboard → Bot Config → Sessions → Session mode → for DMs choose "A dedicated group per message";
- or send
/botconfig set p2pMode groupin Lark (/botconfig unset p2pModegoes back to the default "Continuous chat").
After /close, the group stays. A new message in it starts a fresh session; use /resume to continue the previous one.
How the group is named
Once DMs are set to "A dedicated group per message", a Dedicated group naming option appears below it. Choose there:
Or in that bot's bots.json:
mode is ai-summary / session-title / truncate; maxLen is the maximum title length (default 20).
Notes:
- The group is named automatically once; later title changes are not followed, and a name you set by hand is never overwritten.
- "Reuse Agent session title" uses native titles from Codex and local Antigravity sessions. It also accepts titles set through BotMux, including renames in the Dashboard or inside a session.
- For AI summaries, Codex uses an isolated lightweight call: low reasoning, none of your hooks, plugins, MCP servers or project instructions, only the login credentials and model gateway settings. Enter a lightweight model your account can use in "Summary model (Codex)" (
naming.modelin bots.json), or leave it blank to use the bot's model. This only affects group naming, not conversations.
Change the tag on close
By default, dedicated groups go into a message group in your sidebar (such as "XX sessions"). To move closed sessions into another message group automatically (for example "Closed"), set Tag after closing under Dashboard "Bot Config → Sessions → Session mode → Direct messages" (shown once DMs are set to "A dedicated group per message"). Leave it empty to disable.
Equivalent bots.json:
Rules:
- The move only happens after a successful
/close(or the close-card button)./stop, failed closes, crashes and background cleanup never trigger it. - The group is added to the new message group first, then removed from the old one. A missing message group is created; one with the same name is reused. The group and its history are untouched.
- Only personal message groups (
feed-group) are supported, using the group creator's authorization; send/login tagsif it's missing. - The move runs in the background; failures are reported separately.
- Resuming a session does not move the group back. Clearing "Tag after closing" turns the feature off without bulk-migrating existing groups.
Disband a dedicated group: /dismiss
Want to delete the whole group? Send /dismiss at the top level of the dedicated group. The bot replies with a confirmation card listing:
- The sessions in this group that will be closed (including other local bots' sessions in this group);
- Disbanding this Lark group (it disappears for all members; cannot be undone);
- Removing the session-group record (resuming these sessions later will not recreate the group).
Click "Disband" to proceed. On success the group disappears and you get the result as a private card. The card also lists the worktrees those sessions used, with a one-click cleanup (equivalent to git worktree remove --force: uncommitted changes are lost, branches and committed work stay). If you don't click it, they are kept.
Limits and notes:
- Only the person who created the group, with bot operator permission, can run it.
- The bot must own the group, or be its creator with the
im:chat:operate_as_ownerpermission. - In a dedicated group it only works at the top level, not in subtopics. DMs are not supported. For ordinary groups, see below.
- It stops without disbanding, and explains why in the group, when: the group has a shared session attached via
/adopt(run/detachfirst), another local bot is offline, a session couldn't be closed safely, or a new session appeared during confirmation. - If disbanding fails, sessions that were closed stay closed; send
/dismissagain to retry. - Code and worktrees are not deleted by default. To end the session but keep the group, use
/close.
Ordinary and topic groups
Groups that were not opened from a DM (ordinary and topic groups) also accept /dismiss, from any topic, when both hold:
- The sender has bot operator permission;
- The bot owns the group and is the only bot in it. Lark cannot confirm in advance whether a disband would succeed otherwise, so the bot replies that it has no permission and closes no session.
The confirmation card lists every session this machine's bots hold in the group (every topic's session in a topic group) and states that the whole group is disbanded for everyone in it. After you confirm, those sessions are closed first, and the group is disbanded only once all of them are closed; the result arrives as a private card. It stops in the same cases as above.
Follow the owner into new groups
ownerGroupFollow is off by default for every bot. When enabled, the bot uses its owner’s own user authorization to check for new group memberships every 60 seconds. The first complete scan records existing groups; later scans invite the bot to newly joined groups.
The switch is in Dashboard → Bot defaults → Common → Working directory. The owner must authorize chat listing, member invitations and continued access, for example /login --scope im:chat:read im:chat.members:write_only offline_access. The app must also enable those user scopes. Existing platform authorization follows this bot’s credential policy.
Excluded groups receive no invitation. Once removed, the bot is not automatically re-added. Turning the feature off and back on establishes a fresh baseline. Invitation permissions and external-group restrictions still apply; failures are reported to the owner in a direct message. Periodic scanning cannot capture joins followed by leaves between scans.
