agent_spawn
Spawn a project-locked worker agent in a tmux pane or window to delegate assignments, with automatic briefing, harness selection, and optional read-only enforcement.
Instructions
Spawn a worker agent (default: claude, or the project's hive.yml agents: default). A claude worker is briefed automatically: the full brief is appended to its system prompt, so send it its assignment directly. A command or harness that resolves to a known harness (claude, codex) not listed in the project's hive.yml agents: is refused; absent agents: means claude only. A command hive cannot classify the screen of (claude and codex both do; a harness with no entry does not) can be spawned but NOT typed into: the receipt carries brief_path and says so, and agent_send's text path and wakes both refuse that pane. A same-project worker or lead on that harness's active usage limit makes this spawn retryable until its reset or bounded deadline; hive does not queue spawns. Set read_only: true to block local file writes and mutating shell while keeping Hive MCP available; agent_resume preserves this mode and agent_status reports it. Only bare claude/codex executables are supported in this mode, with only effort-setting extra_args. The worker is locked to this project. Humans can watch with: tmux attach -t hive-main.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "agent_spawn"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Working directory, e.g. a git worktree path. Defaults to the project root. | |
| name | No | Display name; defaults to worker-N. This is how you address the worker later. | |
| model | No | Passed as --model to the agent command. | |
| layout | No | How to arrange the lead's window when placement is split. main-vertical gives the lead the left half with workers stacked on the right; tiled (default) splits evenly. Projects can set a default in hive.yml. | |
| command | No | Raw agent command to run. Overrides harness when both are given. Defaults to the project's hive.yml agents: default, or claude. Refused if it resolves to a known harness the project's agents: list does not allow. | |
| harness | No | Spawn a known harness by name (e.g. "codex") instead of a raw command. Ignored when command is also given. Must be in the project's hive.yml agents: list (default: claude only). | |
| todo_id | No | The todo this worker is on, recorded as a link (a non-archived todo in the same project). Changes no todo status. | |
| placement | No | Omit this to use the project's hive.yml placement, else HIVE_SPAWN_PLACEMENT, else split. split: the worker appears as a pane in the lead's window, auto-tiled, so the whole crew shares one screen. window: its own tmux window (an iTerm tab under control mode). agent_output reads scrollback, so a crowded window does not limit what a lead can read. If workers end up in other windows, run hive layout to gather them. | |
| read_only | No | Prevent local file writes and mutating shell commands while allowing Hive MCP tools. Only bare claude/codex executables. Extra args allow codex -c model_reasoning_effort=low|medium|high|xhigh, or claude --effort low|medium|high|xhigh|max; all other arguments are refused. | |
| extra_args | No | Extra CLI arguments. | |
| project_id | No | Different project override. Use ONLY when the user explicitly asks for another project by name; otherwise stay in the current scope, even when results are empty. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| note | No | ||
| tail | No | ||
| ready | No | ||
| exited | No | ||
| layout | No | ||
| actor_id | Yes | ||
| agent_id | Yes | ||
| read_only | No | ||
| brief_path | No | ||
| codex_home | No | ||
| hive_notice | No | ||
| tmux_target | Yes | ||
| instructions | No | ||
| config_warnings | No | ||
| worktree_install | No | ||
| landed_in_project | No | ||
| codex_instructions | No |