agent_spawn
Launch a project-locked worker agent (Claude or Codex) in a shared tmux pane, automatically briefed and ready for assignments.
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. The worker is locked to this project. Humans can watch with: tmux attach -t hive-main.
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). | |
| placement | No | split (default): 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). | |
| 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 | ||
| brief_path | No | ||
| codex_home | No | ||
| tmux_target | Yes | ||
| instructions | No | ||
| config_warnings | No | ||
| worktree_install | No | ||
| landed_in_project | No | ||
| codex_instructions | No |