Documentation / Mix agents in one task
Mix agents in one task
One task can use several agents. Claude Code writes the code, Cursor reviews it, Copilot watches CI. Each stage picks its agent and model in .natamux.json.
- Each agent is good at different jobs. Pick the one that fits the stage.
- A new agent reviews with fresh eyes. It did not write the code, so it does not defend it.
- Several providers share the cost and the rate limits.
Set agent and args on a stage. In Project settings → Stages, they are Agent and Arguments.
- Open Project settings → Stages and click the stage, for example Review.
- In Agent, pick the agent. Task’s agent keeps the task’s own.
- Optional: in Arguments, add words for its command line, such as
--model gpt-5. - Click Save, then commit
.natamux.json.
The flow chart on top then shows the agent’s icon and the model (from --model or -m) under the stage’s name.


For example, a stage configured for Cursor can look like this:
{ "id": "agent-review", "kind": "agent", "gate": "auto", "output": "review.md", "ownShell": true, "agent": "cursor", "args": "--model gpt-5" }agentisclaude-code,codex,gemini,copilot,cursor,opencode,qwen,droid,amp,kimi,goose,aider,crush,cline,kiroormuse.argsadds words to the command line of that agent, such as a model flag. See Choose a model.- Any
agentortestingstage can have them, from the catalog or your own. A stage that would run in Terminal 1, such as Spec or Implement, then runs in a terminal of its own, from Terminal 6, as Follow CI does in the Team example. Terminal 1 keeps the task’s agent and its session. - The configuration reference lists where
agentandargsare allowed.
Terminals
Section titled “Terminals”Each task has a few terminals. See Terminals and agents for the full table.
| Terminal | What runs there |
|---|---|
| Terminal 1 | The task’s agent, in one session for the stages in a row. The agent starts with the first stage that runs in Terminal 1. It is never closed before the task ends. |
| Terminal 2 | Test spec, when it has no agent of its own. |
| Terminal 5 | A stage with ownShell and no agent or args of its own. |
| Terminal 6 and up | A stage with its own agent or args: Terminal 6 plus the place of the stage among all stages of the task, counted from 0. No two stages share one. |
A stage that runs again, for example after a send back, gets its prompt in the agent of its terminal. That agent still knows the last round. To start fresh each time, set "endShell": true.
A stage keeps its terminal until it starts again. If you change its agent or args while the task runs, the change applies at the stage’s next start.
End a stage’s terminal
Section titled “End a stage’s terminal”"endShell": true closes the terminal when the stage is done. This frees memory, and the next run starts a new session. It never closes Terminal 1. See End a stage’s terminal.
Run with a workflow
Section titled “Run with a workflow”"workflow": true offers Run with a workflow on a stage. Claude Code then works with sub-agents inside that one stage. Use it on a hard stage such as Implement. It uses more tokens, and only Claude Code does it. See Run a stage as a workflow.
Why each stage uses its own agent
Section titled “Why each stage uses its own agent”The two examples in Build a workflow list which agent and terminal each stage uses. The reasons:
| Stage | Why |
|---|---|
| Spec, Plan, Implement | One session in Terminal 1 keeps the context of the spec for the code. Implement can add sub-agents with a workflow. |
| Test spec | It writes cases without reading the code. Its terminal frees its memory when done. |
| Review | An agent that did not write the code reads it. A new session per round. |
| Review PR | It reads a teammate’s work with a new session. |
| Watch CI and merge, Follow CI | It moves CI and merge work off the main session. A failed job sends the task back. |
| Verify impact list | It checks the change with a new session. |
| Definition of done and review request | Another provider for the last check. |
What each agent needs
Section titled “What each agent needs”Every agent you use in a stage must run on the machine of the task.
- Installed, and its command runs in a terminal.
- Logged in.
- Hooks: Natamux adds them for each agent it starts, so the dashboard shows its state.
Details per agent:
- Claude Code
- Codex
- Gemini CLI
- Copilot CLI
- Cursor CLI
- OpenCode
- Qwen Code
- Factory Droid
- More terminal agents: Amp, Kimi, Goose, Aider, Crush, Cline, Kiro and Muse Code, followed by their terminal
- Other agents: without hooks, Natamux sees less
The agent token
Section titled “The agent token”Task terminals get an agent token, not the daemon’s token. An agent cannot approve, skip or pass a stage, so a stage with another provider cannot move the task past a gate. It can run natamux done and natamux stage back. See Security and privacy and The agent token.
Related
Section titled “Related”- Build a workflow: the two example files
- Stages: terminals, models and workflows
- Agents and hooks: how each agent reports