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
-
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.
-
Name yourself and the team
Names get an
@@prefix unless you clear Auto-prefix. Pick New and a team directory, such asteams/review, or Load for a saved team. With New, an optional brief goes into the team'sbootstrap.md. -
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 undercommand, or name it in the lead'sCHAN_AGENT. -
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.
-
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 directory | Holds |
|---|---|
config.toml | The 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.md | The 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"
| Key | Meaning |
|---|---|
team_name, host_name, host_handle | Required: the team's name, yours, and the handle agents use for you. |
tab_group | The group every member's terminal joins. A group already running gets -2, -3, and so on. |
mcp_env | true gives members the MCP variables. Off by default. |
[[members]] | One to nine, exactly one with is_lead = true. |
handle | The member's tab name and $CHAN_TAB_NAME. |
command | What 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. |
env | Extra 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 flag | What it does |
|---|---|
team new DIR --config FILE | Writes DIR/config.toml, regenerates bootstrap.md, creates the folders, then starts the team, lead first. --stdin reads the configuration instead. |
--brief FILE | Puts FILE into bootstrap.md after the roster. The way to give a team its work. new only. |
--mcp-env on | Gives the team's terminals the MCP variables. |
--tabs | Stacks the team as tabs, ignoring positions. |
--window, --pane, --side a|b | Where the tabs go. |
--script | Prints the whole bootstrap as a shell script and changes nothing. |
team load DIR | Starts 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| Command | What it does |
|---|---|
cs terminal write --submit=AGENT | Writes the text and the submit keys AGENT expects. Without --submit the text waits unsent in the agent's input. |
cs terminal scrollback --tab-name NAME | Prints that terminal's output. |
cs terminal survey | Asks you a question with up to four answers, over the window holding the named tab, and prints your answer. |
cs terminal close --tab-group NAME | Closes every terminal in the group. |
cs dump-skill | Prints 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 withcs 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 teamsends 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. --submitencodes 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.
-
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 -
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"} -
Add it to your agent
Copy the name, command, and arguments into your agent's MCP settings.
| Variable | Holds |
|---|---|
CHAN_MCP_SERVER_NAME | chan |
CHAN_MCP_SOCKET | The server's socket. |
CHAN_MCP_COMMAND | The command that connects to it, chan __mcp-proxy SOCKET, with the full path of chan or Chan Desktop. |
CHAN_MCP_COMMAND_JSON | The same command as a JSON array. |
CHAN_MCP_SERVER_JSON | The descriptor: name, command, and args. |
| Tool | What it does |
|---|---|
read_file | Reads a text file, 256 KiB per call. |
write_file | Replaces a text file, at once. |
list_files | Lists paths, up to 2,000. |
resolve_path | Gives the host path of a workspace path. |
workspace_search | Searches content and entities, and walks the graph. |
read_media | Returns an image or a PDF, up to 10 MiB. |
repo_report | Languages, 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_filetakes 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.
csdoes that, andcs 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 mcpprints this contract for agents.