Skip to content

ManualTerminal

Agent teams

Start a lead and worker agents in named terminals from a dialog or cs, and give agents the workspace over MCP.

What you can do

  • Start a lead and up to eight workers, each in a named terminal, from one dialog or one command.
  • Lay the team out as tabs in one pane or as a grid of panes.
  • Give every member one brief and a shared process for tasks and journals.
  • Save the team in the workspace and start it again later.
  • Send an agent text by name, submitted the way it expects.
  • Let agents read, search, and edit the workspace over MCP.

Agents are ordinary terminal programs, installed where the terminal runs. Teams need a workspace window: New team and cs terminal team refuse in a standalone terminal.

The New team dialog

  1. Open it

    Run New team from the pane menu or the command launcher. A terminal for the lead opens under the Spawn agents dialog; Cancel closes both.

  2. Name yourself and the team

    Names get an @@ prefix unless you clear Auto-prefix. Pick New and a team directory, such as teams/review, or Load for a saved team. With New, an optional brief goes into the team's bootstrap.md.

  3. Add the members

    Pick 1 to 9 agents. Give each a name and a command such as claude, and mark one Lead. Run an agent chan recognises as the lead, one listed under command, or name it in the lead's CHAN_AGENT.

  4. Lay them out

    Tabs in current Hybrid stacks the team in the lead's pane. Split panes lays out a grid of up to nine panes: drag members into cells, or let the robot button do it.

  5. Bootstrap

    chan saves the team, starts the lead, then the workers. Only the lead gets a first prompt, submitted the way its agent expects: it names the workers and points at the team's bootstrap.md. The workers wait for the lead to hand them tasks. When Bootstrap closes the dialog, keyboard focus returns to the active terminal in the lead's pane.

The team directory and config.toml

A team is one directory in the workspace. The dialog and cs terminal team read and write the same files.

In the team directoryHolds
config.tomlThe team. You may edit it; it is checked again on every load. Loading a team into the dialog and bootstrapping it without changes keeps an existing file byte for byte. Editing the loaded team or choosing New writes the dialog's fields, dropping comments, custom key order and keys the dialog does not model. A missing file is created.
bootstrap.mdThe process every member reads: the roster, the brief, task files, journals, and how the lead reaches you. Creating a new team writes it; loading a saved team keeps an existing copy.
tasks/One file per task, task-{from}-{to}-{n}.md.
journals/One journal per member, journal-{member}.md.
followups/Follow-ups, followup-{from}-{to}-{n}.md.

From a terminal, start with a configuration file such as this team.toml:

team_name = "review"
host_name = "You"
host_handle = "@@Host"
tab_group = "review"

[[members]]
handle = "@@Lead"
command = "claude"
is_lead = true

[[members]]
handle = "@@Reviewer"
command = "codex"
KeyMeaning
team_name, host_name, host_handleRequired: the team's name, yours, and the handle agents use for you.
tab_groupThe group every member's terminal joins. A group already running gets -2, -3, and so on.
mcp_envtrue gives members the MCP variables. Off by default.
[[members]]One to nine, exactly one with is_lead = true.
handleThe member's tab name and $CHAN_TAB_NAME.
commandWhat the terminal runs. The agent is read from it: agy, claude, codex, gemini, kimi, muse, or opencode. Anything else is a plain shell member, which cs terminal team sends no first prompt.
envExtra environment, such as { CHAN_AGENT = "gemini" } for a wrapper script whose name says nothing. none or shell forces a shell member.
position{ row = 0, col = 1 }, the member's cell in a pane grid of at most nine panes. Without positions the team stacks as tabs.

Run a team from a terminal

Create the team, or start a saved one again:

$cs terminal team new teams/review --config team.toml
$cs terminal team load teams/review
Command or flagWhat it does
team new DIR --config FILEWrites DIR/config.toml, regenerates bootstrap.md, creates the folders, then starts the team, lead first. --stdin reads the configuration instead.
--brief FILEPuts FILE into bootstrap.md after the roster. The way to give a team its work. new only.
--mcp-env onGives the team's terminals the MCP variables.
--tabsStacks the team as tabs, ignoring positions.
--window, --pane, --side a|bWhere the tabs go.
--scriptPrints the whole bootstrap as a shell script and changes nothing.
team load DIRStarts the saved team again from DIR/config.toml. Writes nothing.

Running a team load --script script writes config.toml and bootstrap.md only where each is missing. Existing files are kept byte for byte, including comments and hand edits. A team new --script script writes both files from the supplied configuration and brief.

Named terminals without a team

Without a team, start and address named terminals directly:

$cs terminal new --tab-name reviewer --tab-group review --command codex
$cs terminal write --tab-name reviewer --submit=codex "Review the current diff"
$cs terminal list --json
CommandWhat it does
cs terminal write --submit=AGENTWrites the text and the submit keys AGENT expects. Without --submit the text waits unsent in the agent's input.
cs terminal scrollback --tab-name NAMEPrints that terminal's output.
cs terminal surveyAsks you a question with up to four answers, over the window holding the named tab, and prints your answer.
cs terminal close --tab-group NAMECloses every terminal in the group.
cs dump-skillPrints the agent manual, offline. --list shows its topics and --topic teams reads one.
Details and limits
  • Every member's process comes from bootstrap.md: the lead hands out work and reaches you with cs terminal survey, and workers do not contact you directly.
  • Bootstrapping from the dialog turns group broadcast off in every terminal; turn it on yourself when you want it.
  • cs terminal team sends every agent member its own first prompt once the agent is ready for input: the lead's says to hand out the work, a worker's to wait for the lead. A member not ready within 15 seconds is named and gets no prompt, and the command exits non-zero.
  • A member whose command fails to start is reported, and the rest of the team still starts. From the dialog, a lead that fails to start stops the bootstrap.
  • A grid layout needs a window with a single pane. Close the other panes, pass --tabs, or name a pane with --pane.
  • --submit encodes one agent per command, so a group of mixed agents needs one write per agent.
  • Writes are queued and delivered when the terminal goes quiet, at most 4096 bytes each. Put longer text in a file and send its path.
  • A survey waits 600 seconds by default, then exits 124. [F] answers that you will follow up later.
  • A survey over a terminal takes the keyboard when that terminal is visible in the focused pane. In another pane it stays visible and you can click an answer while typing continues in the focused pane. Returning to its pane gives the survey the keyboard.

Give agents the workspace over MCP

Each workspace runs an MCP server, chan, for its files, search, and graph. chan never edits an agent's configuration: a terminal carries the server's descriptor in its environment, and you add it to your agent.

  1. Turn on MCP discovery

    Turn on Settings → Terminal → MCP discovery, or run the command below; for a team, tick the dialog's MCP box or pass --mcp-env on. It is off by default because a stray descriptor stops codex from starting.

    $chan config set terminal.mcp_env true
  2. Read the descriptor in a new terminal

    Only terminals opened after the change carry it.

    $echo "$CHAN_MCP_SERVER_JSON"
    {"args":["__mcp-proxy","/run/user/1000/chan-mcp-48213-9f3c0a1e.sock"],"command":"/usr/bin/chan","name":"chan"}
  3. Add it to your agent

    Copy the name, command, and arguments into your agent's MCP settings.

VariableHolds
CHAN_MCP_SERVER_NAMEchan
CHAN_MCP_SOCKETThe server's socket.
CHAN_MCP_COMMANDThe command that connects to it, chan __mcp-proxy SOCKET, with the full path of chan or Chan Desktop.
CHAN_MCP_COMMAND_JSONThe same command as a JSON array.
CHAN_MCP_SERVER_JSONThe descriptor: name, command, and args.
ToolWhat it does
read_fileReads a text file, 256 KiB per call.
write_fileReplaces a text file, at once.
list_filesLists paths, up to 2,000.
resolve_pathGives the host path of a workspace path.
workspace_searchSearches content and entities, and walks the graph.
read_mediaReturns an image or a PDF, up to 10 MiB.
repo_reportLanguages, line counts, complexity, and a COCOMO estimate.
Details and limits
  • chan asks nothing before an agent writes; writes apply immediately.
  • Every path stays inside the workspace. write_file takes editable text files only, and a new file is capped at 2 MiB.
  • Only your own user account can reach the socket.
  • There are no tools for terminals, panes, or windows. cs does that, and cs search, cs open, and the rest work without MCP.
  • A draft is out of reach until it is saved to the workspace (see drafts).
  • A standalone terminal window has no MCP server, so the setting does nothing there.
  • A team's terminals follow the team's own MCP setting, not the Settings switch.
  • The socket changes each time the server starts. Outside Windows, if a terminal's socket is gone, the proxy connects to your newest live chan MCP socket, which may be another workspace's; open a new terminal to be sure.
  • cs dump-skill --topic mcp prints this contract for agents.

Next