Skip to content

Documentation / The review loop

On this page

The review loop

Agents check each other. In the default pipeline (Context, Spec, Implement, Review, Release) you approve the spec, the task’s agent implements it, and a second agent reviews the changes and sends the task back to Implement until the review passes.

This page shows the loop with more stages from the catalog: Plan, Test spec next to Implement, and Automated tests. After you approve the plan, two agents work at the same time: one writes the test cases from the spec, the other writes the code. When both are done, the tests run. Then a third agent, in a terminal and session of its own, reviews the changes. If it finds problems, it sends the task back to Implement by itself, with the reasons, and the loop runs again until the review passes.

A stage pipeline with catalog stages: Context, Spec, Plan, then Test spec and Implement side by side, Automated tests, Review and Release. Review sends the task back to Implement when it finds problems. side by sideFindings: back to ImplementContextASpecAPlanBTest specAImplementAAutomatedtestsCReviewReleaseSent back 1× A stage pipeline with catalog stages: Context, Spec, Plan, then Test spec and Implement side by side, Automated tests, Review and Release. Review sends the task back to Implement when it finds problems. side by sideFindings:back to ImplementContextASpecAPlanBTest specAImplementAAutomatedtestsCReviewReleaseSent back 1×
  • A The task's agent, Shell 1
  • B Test spec agent, Shell 2
  • C Review agent, Shell 5
  • Waits for your approval
The flow in words
  1. Context: Natamux writes context.md from your notes, a GitHub issue or a skill.
  2. Spec: the task's agent (A) writes spec.md in Shell 1. You approve it.
  3. Plan: agent A writes plan.md in the same session. You approve it.
  4. Test spec and Implement start together. Agent B writes test-spec.md in Shell 2 without reading the code; you approve it. Agent A writes the tests and the code in Shell 1.
  5. Automated tests: when both are done, agent A adds a test for each case and runs all tests.
  6. Review: agent C starts in Shell 5 and writes review.md.
  7. With findings, agent C sends the task back to Implement with the reasons. Implement, Automated tests and Review run again. A third send back is refused, and the task waits for you instead.
  8. Without findings, the task goes to Release. You open the pull request; the merge finishes the task.

With these stages you approve three things: the spec, the plan and the test spec. Everything after that runs on its own, unless an agent asks you something, a check fails twice, or the loop reaches its limit.

# Stage Who works Terminal You
1 Context Natamux, or the task’s agent for a skill or MCP source none, or Terminal 1 Nothing for notes you typed: it passes by itself
2 Spec The task’s agent (agent A) writes spec.md Terminal 1 Approve or Send back
3 Plan Agent A writes plan.md, in the same session Terminal 1 Approve or Send back
4 Test spec Agent B writes test-spec.md from the spec, without reading the code Terminal 2 Approve or Send back
4 Implement Agent A writes the tests first, then the code Terminal 1 Nothing
5 Automated tests Agent A adds a test for each case of the test spec, then runs all tests and fixes failures Terminal 1 Nothing
6 Review Agent C reads the changes against the spec and writes review.md Terminal 5 Nothing
7 Release Your git host none Open the pull request and merge it

The two stages of step 4 run side by side as one group, Test spec and Implement. The group ends when both stages are done, so Automated tests starts only after you approve the test spec and Implement has finished.

If you turn Plan off in project settings, the two agents start right after you approve the spec.

When the task reaches the group, Natamux starts both stages at the same moment.

  • Implement stays in Terminal 1. Its prompt goes into the session that wrote the spec and the plan, so the agent keeps what it already read, and its prompt cache.
  • Test spec gets Terminal 2 and a new session. Its prompt tells it not to read the code. The test cases come from the spec alone, so they test what was asked, not what was built.
  • Each terminal shows the state of its own stage in its pane header. The sidebar shows both stages under the task while it is open.
A native task workspace with Implement in Terminal 1 and Test spec in Terminal 10 running side by side. The Progress chart shows both stages running in the parallel group.A native task workspace with Implement in Terminal 1 and Test spec in Terminal 10 running side by side. The Progress chart shows both stages running in the parallel group.
Test spec and Implement run side by side in separate native terminals. Terminal output is scripted.

Test spec waits for your approval because the test cases decide what Automated tests checks. Read them in the Docs tab (key 4) and fix them by hand before you approve, if you like.

Review is an agent stage with its own terminal ("ownShell": true). It runs in Terminal 5, apart from the agent that wrote the code.

  • It reads spec.md and the reports of earlier stages, such as test-spec.md in this workflow, then the changes: what is not committed (git status, git diff) and the commits of the branch that are not on the default branch.
  • It does not change code.
  • It writes review.md. Each round adds a Revision N at the end of the file, with a Findings section: each problem that must be fixed, with its file and why, or “None”. Earlier rounds stay in the file, and only the newest revision counts.
  • Its gate is auto. With no findings it runs natamux done, its checks pass, and the task goes on to Release without waiting for you.
A native task workspace with three terminal panes: Terminal 1, Test spec in Terminal 10, and Review running in Terminal 12. The Progress panel shows Test spec and Implement completed before Review.A native task workspace with three terminal panes: Terminal 1, Test spec in Terminal 10, and Review running in Terminal 12. The Progress panel shows Test spec and Implement completed before Review.
Three native task terminals beside the workflow. Review runs in its own terminal. Terminal output is scripted.

The review agent is the task’s agent unless you pick another one. A second agent, or a stronger model, often finds what the first one missed.

  1. In the sidebar, click the gear next to the project, or Settings in its menu.
  2. On the Stages tab, click Review.
  3. In Agent, pick the agent, for example Codex. Task’s agent keeps the task’s own.
  4. Optional: in Arguments, add words for its command line, such as --model sonnet.
  5. Click Save (Mod+Enter). Natamux writes .natamux.json. Commit the file to share it.
The Review stage in native Project settings, with Agent set to demo-reviewer. Arguments is empty and shows --model sonnet as a placeholder.The Review stage in native Project settings, with Agent set to demo-reviewer. Arguments is empty and shows --model sonnet as a placeholder.
Review selected in native Project settings. This demo uses the scripted demo-reviewer agent and no extra arguments.

In the file, these are the agent and args fields of the Review stage:

.natamux.json
{
"id": "agent-review",
"name": "Review",
"kind": "agent",
"gate": "auto",
"output": "review.md",
"sections": ["Findings"],
"ownShell": true,
"agent": "codex",
"args": "--model gpt-5"
}

The agent can be claude-code, codex, gemini, copilot or cursor. The same works for Test spec, which also starts its own agent. There is no global review setting: each project sets it on its Review stage. See Choose a model.

When the review finds a problem, the agent runs:

Terminal window
natamux stage back $NATAMUX_TASK_ID --reason "<the problems, one per line>"

and stops, without natamux done. Then:

  1. The task goes back to Implement, the last agent stage before Review. Test spec is done and does not run again.
  2. Agent A gets the Implement prompt again, with What to change: <the reasons> added at the end. It goes into the same session in Terminal 1.
  3. Automated tests and Review run again after it. The review agent gets its prompt in the same Terminal 5 session, so it knows what it asked for.
  4. The Implement card in Progress shows Sent back 1×, and the panel counts the times the task was sent back.
A native task workspace with its terminals and Progress panel. Review has a second-run count and the task waits at Manual review.A native task workspace with its terminals and Progress panel. Review has a second-run count and the task waits at Manual review.
Review has run twice and the task waits at Manual review. The native workspace keeps its terminals and stage progress together. Terminal output is scripted.
Follow the real workflow through review and a retry, then the Manual review gate. Real native app and workflow. Scripted demo agents. Natamux 1.0.17. Recorded 2026-11-03.

These are the real rules:

Rule What happens
A send-back limit, when you set one. With agents.maxSendBacks, Natamux counts the times the Review stage sent the task back by itself since you last stepped in: sent the task back, approved, marked as done, skipped or set the state. A natamux stage back past the limit is refused. The task goes to Needs input with “Review sent the task back 2 times. Decide what to do.” Without a limit, the agent may send back as often as it likes.
You can always send it back. Send back in the stage card, or natamux stage back T-0001 --reason "...", has no limit.
A check that fails twice waits for you. When review.md is missing, empty or has no Findings section, the reasons go to the agent once. The second failure moves the task to Needs input.
Agents do not commit. Implement and Automated tests leave their changes for you to read in the Changes tab. Commit them before you open the pull request, or let Generate draft the message.
Release waits for you. The pipeline never pushes the work or opens a pull request by itself. The one push it makes is the CI snapshot, to natamux-ci/<branch>, for a task with Check on CI ticked. Release waits until the pull request is open, and the task is done when it is merged.

When the task waits for you after the last send back the limit allows, you decide: fix the code yourself and press Mark as done on Review, Send back with your own reason, or Approve anyway. Each of these starts the count again, so the agent may send the task back up to the limit once more.

Implement and Automated tests can also wait for your CI. Tick Check on CI on the stage card of a task. When the agent is done, Natamux pushes a snapshot to natamux-ci/<branch> and waits for the runs. A failed run on Automated tests goes back to Implement, within the same send-back limit. See Check a stage on CI.

In project settings you can:

  • turn Test spec or Review off, or turn Wait for my approval on for Review;
  • add Manual review after Review, so a person reads the diff before release;
  • add more report stages, such as Security review. All stages with their own terminal share Terminal 5: when the Review agent still runs there, a later report stage gets its prompt in that same session, not a new agent;
  • add a CI watcher stage that sends the task back when a check fails (see the examples in Build a workflow);
  • run a hard stage, such as Implement, as a workflow with Claude Code.