Agents and teams
Mercury runs multi-agent work as teams: named agents the user chats with, a durable file-backed mailbox between them, one role registry shared with in-session sub-agents, and boards that show the work.
Agent surfaces
/agents: Opens the Agent Studio for building and tuning agent definitions./teammates: Opens the Crew view with the focused session's sub-agents and the repository's named agents./team: Opens the crew board on/tasks, including phases and handoffs./crew: Opens the directory that binds agent identities to roles and seats./sessions: Manages the project's sessions, including named-agent chats.
Named agents are started by an explicit, billed act of the user through the spawn wizard. Boot never spawns them. A role is an agent definition, built-in, custom or supplied by an extension, and the same registry serves named agents and in-session sub-agents, so a given role is the same agent however it is launched.
Delegation switches
- Sub-agents: Turning this off removes the
Agenttool from the session, and every road that would spawn one from inside the session answers one receipt. A spawn already running finishes. - Workflows: Turning this off removes the
Workflowtool and refuses the workflow launch roads. The run board stays readable. - Boot Menu: Its Agents section sets both switches for the sessions born after the choice, and each session keeps its own setting.
The Session Concourse still launches sessions and crew seats, because the switches belong to the focused session.
Change delegation for a session
To change delegation for a session, follow these steps:
- Enter
/subagents onor/subagents offfor the required sub-agent state. - Enter
/workflows onor/workflows offfor the required workflow state.
Each switch flips at the session's next turn boundary, the tool leaves or rejoins the roster, and a receipt says so.
Bare /subagents reports both switches and their sources. The doctor's Sub-agents & workflows row reads the same.
Stop an agent
To stop an agent, follow these steps:
- Open
/teammatesor/tasks. - Select the agent.
- Press
xtwice within two seconds.
The first press names the agent the second press stops. The agent stops, its row reads stopped with the reason, and its transcript remains on disk.
Esc in the main chat interrupts that chat's own turn and nothing else; the sub-agents and workflows the turn launched keep running on their own controllers. A command a sub-agent runs in the background is a shell task of the session with a row on the /tasks board, and its finish notice goes to the agent that launched it.
Resume a stopped agent
To resume a stopped agent, follow these steps:
- Select its stopped row in the Crew view.
- Press
r.
The agent resumes from its transcript under the same identifier.
Team state
- Team directory:
<config-home>/teams/<team>/contains the roster inconfig.json, per-agent inboxes ininboxes/and consumption records indedup/. - Task lists:
<config-home>/tasks/<team>/holds the team's tasks. - Mailbox: Each team and agent pair has one inbox file. Every message carries its own identifier and sequence, so a crash between delivery and acknowledgement replays as a no-op instead of a duplicate.
- Inbox hold: Inbound agent messages that arrive while the session runs in a bypass-permissions mode are held visibly until the user returns to a prompting mode. The rule is named
MERCURY_INBOX_HOLD_BYPASS.
A team survives its lead's exit: the config, inboxes and leases stay, and only the pane-backed teammates are closed. Resuming the lead's session makes it part of the team again, and only TeamDelete removes a team. A headless lead removes its own team before its final answer.
A teammate whose first dispatch fails is refused by name with the cause and is not on the roster, and a later message to it is refused with the same cause. A seat that fails later leaves the roster the same way. A workflow that ends with agent failures says so in the first line of its notification: the count, then the first failing agent and its cause.
File leases
Teammates keep off each other's files with leases, through the tools mcp__mercury__lease_claim, mcp__mercury__lease_release, mcp__mercury__lease_list and mcp__mercury__lease_take. Every lease verb takes a paths list of repo-relative file paths; for the team lease a path may be a pattern ending in /** that covers a folder. A team claim renews the caller's lease and replaces its set, and claiming an empty set releases it. Another live holder is named and refused, and an edit under another agent's lease is denied before it runs.
Named-agent limits
- Spawn admission: The daemon enforces the floor server-side: a validated model table, a name allowlist of
[a-z0-9-], a read-only reconnaissance tool allowlist, and at most six live named agents. - Permission mode: Named agents use
flowunlessMERCURY_DAEMON_PERMISSION_MODEspecifies otherwise. MERCURY_CREW=0: Disables the Crew view and refuses the spawn request.
Related pages
Sessions, Saturn scheduling, MCPs and skills, Command-line reference