Human-in-the-Loop Task Manager for AI Agents
Tested November 29, 2026 | All Tutorials

Planner, Builder, Reviewer Agent Team in Parallel

One coding agent doing everything is slow and grades its own work. A small team is better: a Planner that splits the work, several Builders that write code at the same time, and a Reviewer that reads every change before you merge it. The hard part is keeping them out of each other's way: two agents in one folder overwrite each other's files, fight over the checked-out branch, and race for the same port.

This tutorial builds that team in AgentRQ. Each role is its own workspace. Named events hand the work from one role to the next, with no polling and no glue code. Each Builder runs in a fork with its own git worktree and branch, so three of them can work on one repository at once without a single conflict. You stay in the loop where it matters: you merge.

Every screenshot comes from a real run on November 29, 2026: one feature request, gift cards for a checkout, went through the whole loop.

The agent team: you ask the planner for a feature; the planner fires plan_ready three times, which gives three builder forks a task each, each in its own git worktree; each builder fires code_changed, which gives the reviewer a task; the reviewer fires review_passed, which gives you a merge task, or changes_requested, which sends the work back to a builder

What You Build

Role Workspace Folder Fires Gets a task when
Planner planner ~/code/shop plan_ready, once per work item you ask for a feature
Builder builder, plus one fork per item a git worktree each code_changed plan_ready or changes_requested fires
Reviewer reviewer ~/code/shop-review review_passed or changes_requested code_changed fires
You planner none nothing review_passed fires

Three ideas make it work:

  • → One role, one workspace. A workspace is an isolated queue with its own agent, its own MCP token and its own folder. The role is written in the workspace's mission, so every agent that connects reads it.
  • → Events carry the handoffs. An event is a name, like code_changed. A trigger subscribes a workspace to it: each time the event fires, that workspace gets a new task built from a template, with what the publisher sent pasted in.
  • → Forks keep builders apart. A fork is a copy of a workspace with its own queue and agent. On the machine, AgentRQ gives it a git worktree on a new branch, so its files, its branch and its index are its own.

Before You Start

  • → An AgentRQ account, and a computer enrolled with agentrqd 0.9.3 or newer, the first release that makes fork folders. See machines and the connect agents guidelines.
  • → A git repository. The example is ~/code/shop.
  • → Claude Code, or any agent you start through the ACP Gateway.

Step 1: Give Each Role Its Own Folder

Never put two agents that write in one folder. Git worktrees give you several checkouts of one repository that share its history but not their files. Run this once:

bash
cd ~/code/shop                                    # the planner reads the main checkout
git worktree add --detach ~/code/shop-build main  # the builder's base
git worktree add --detach ~/code/shop-review main # the reviewer's checkout
git worktree list

Both new worktrees are detached on purpose. Git lets a branch be checked out in only one worktree at a time, and main is already checked out in ~/code/shop. A detached reviewer can then run git switch --detach on any builder's branch while that builder still has it checked out.

You only need these three folders. The forks in step 5 get their worktrees from AgentRQ.

Step 2: Create a Workspace per Role

Create three workspaces: planner, builder and reviewer. In each one's settings, set the Working Directory to its folder from step 1, and write the role in the Mission Description.

1. Its own folder. The agent starts here, and a fork of this workspace makes its worktree from this repository. 2. The role, in plain words. Say what the agent does, what it never does, and which event it fires when it is done.

Step 2: the planner workspace's General settings, with arrows pointing at the Working Directory, /home/dev/code/shop, and at the Mission Description, which starts

The three missions used in this run:

text
planner:  Role: Planner. You plan, you never edit code.
          Read the request and the code in this folder, then split the work into small
          tasks that can be built in parallel without touching the same files. For each
          one, call workspace publishEvent with name plan_ready, this task's id, and a
          payload holding the task's title, the files it may change, the branch name to
          use (feat/<slug>) and how to test it. Then complete your task.

builder:  Role: Builder. You write code for one plan item at a time.
          Work on the branch the plan names, commit small, run the tests, and never push
          to main. When the item is done, publish code_changed with the branch, the
          commit and what to look at.

reviewer: Role: Reviewer. You read and test changes, you never fix them yourself.
          Check out the branch from the payload (git switch --detach <branch>), read the
          diff against main and run the tests. Publish review_passed when it is ready to
          merge, or changes_requested with a numbered list of what to fix.

The planner's last rule matters most: work items that touch the same files cannot be built in parallel, whatever the folders.

Step 3: Name the Four Events

Open Events, click New Event, and create one event per handoff. Each event's payload guidelines tell the agent that fires it what to send.

Step 3: the Events list with plan_ready, code_changed, changes_requested and review_passed, and an arrow at each one saying who fires it and who gets a task
Event Payload guidelines
plan_ready One plan item: title, files it may change, branch name (feat/ and a short name), how to test it.
code_changed Branch name, last commit SHA, what changed and what the reviewer should check first.
changes_requested Branch name and a numbered list of what to fix.
review_passed Branch name, last commit SHA, and a one-line summary for the merge.

Step 4: Wire Each Event to a Role with a Trigger

Open plan_ready and click Add Trigger.

1. The role that gets the task: builder. 2. Its title: Build a plan item. 3. The instructions. Click Event payload to insert {{EVENT_PAYLOAD}}, which becomes the plan item the planner sent. Event FAQ inserts the questions and answers that came with it.

Step 4: the New trigger form on plan_ready, with builder picked as the workspace, Build a plan item as the title, and the instructions containing {{EVENT_PAYLOAD}} and {{EVENT_FAQ}}, with arrows at all three

Lower in the form, keep Who works on it on Agent. 1. Then fire code_changed: under When the task is completed, fire, pick code_changed. AgentRQ adds a line to every task this trigger creates that tells the agent to publish code_changed, with that task's id, before it completes. 2. Save it with Create Trigger.

Step 4, continued: the lower half of the trigger form with code_changed picked under

Add the other three triggers the same way:

Event Workspace Who Title Then fire
plan_ready builder Agent Build a plan item code_changed
code_changed reviewer Agent Review a change nothing: its instructions say to fire review_passed or changes_requested
changes_requested builder Agent Fix review comments code_changed
review_passed planner Human Merge a reviewed branch nothing

The reviewer's trigger fires nothing by itself, because a trigger can chain only one event and the reviewer has two outcomes. Its instructions name both, and the reviewer publishes one of them itself. The last trigger is assigned to Human: the loop ends with a task for you, not with an agent merging to main.

Step 5: Ask for a Feature and Watch It Fan Out

Create a task in planner: "Plan gift cards for checkout. Customers should be able to buy a gift card and redeem it at checkout." The planner read the code and fired plan_ready three times, once per item. Each one became a builder task.

1. The trigger: a builder task, then code_changed. 2. One builder task per plan item, listed on the event's page.

Step 5: the plan_ready event page, showing the builder trigger that then fires code_changed and the three tasks it created: Build gift card field, Build gift card redeem and Build gift card model

Every task a trigger creates gets the trigger's title. We renamed the three with Edit so each one says which item it is. Spin up names the fork after the task, so this also gives the forks clear names.

Step 6: Spin Up One Builder Fork per Task

The three tasks sit in builder, but one builder agent would work through them one at a time. To run them in parallel, give each task its own fork. Hover over a task and click the bolt, 1. Spin up in a fork.

Step 6: the builder workspace with three not started tasks, and an arrow pointing at the Spin up in a fork button on the hovered Build gift card redeem row

Spin up asks one question: what to run, and where. 1. The fork's name comes from the task. 2. Where its agent runs: your machine. 3. Spin up forks builder, moves the task into the fork and starts an agent there, in one step.

Step 6, continued: the Spin up popover, which forks builder as build-gift-card-redeem, on dev-laptop, with Claude Code picked, and arrows at the fork's name, the machine line and the Spin Up button

You can also make a fork yourself: right-click builder in the sidebar, choose Fork workspace, 1. name it and 2. click Fork. Then move tasks into it with Move Task, and start its agent.

Step 6, another way: the Fork workspace dialog for builder, with build-gift-card-ui typed as the name, and arrows at the name field and the Fork button

The first time a fork's agent starts, agentrqd makes its folder in ~/.agentrq/forks, in a folder named after the fork's id:

  • → The builder's folder is in a git repository, so the fork gets a git worktree on a new branch named agentrq/fork- followed by the fork's id, checked out at the builder's HEAD. The builder agent then creates the plan's branch inside it. A folder that is not in a git repository gets a plain copy instead.
  • → The fork's terminal opens with the exact git worktree add command it ran.
  • → The worktree also gets the builder's untracked .mcp.json and .claude folder, with the builder's own AgentRQ entry taken out, so the fork's agent connects as the fork and never as its parent. If your repository commits .mcp.json, the fork's copy gets the fork's entry and is marked skip-worktree, so its token never shows up as a change.

1. Three builder forks, each with its own agent. They sit under builder in the sidebar with a fork mark. 2. Each one works in its own worktree, on its own branch, at the same time as the others.

Step 6, result: the build-gift-card-model fork's task, ongoing, where the agent says it is on branch feat/gift-card-model in this fork's worktree, with arrows at the three forks under builder in the sidebar and at the agent's message

A fork keeps its own name, queue, agent and folder. It shares the builder's memory, skills and settings, so a lesson one builder saves, such as "run make generate before the tests", the other two read on their next task.

Step 7: The Reviewer Picks Up Every Change

When a builder finishes, it publishes code_changed with its branch, and the reviewer gets a task. This run's UI builder sent:

text
Branch: feat/gift-card-ui
Commit: a3f91c2
What changed: a gift card field on the checkout page, with code validation and an error state.
Check first: the error message when a code is expired.

1. The branch to review and 2. where to look first arrive in the reviewer's task, from the code_changed payload.

Step 7: the reviewer workspace with two Review tasks, one per builder, and the open task showing the payload, with arrows at the Branch line and the Check first line

The reviewer runs git switch --detach feat/gift-card-ui in ~/code/shop-review. Worktrees share one repository, so a commit made in a fork's worktree is already there, with no push and no fetch. The builder fork still has the branch checked out, and that is fine: the reviewer is detached.

Step 8: Send Requested Changes Back to the Fork

In this run the reviewer passed the UI change and found a bug in the redeem change: a gift card balance larger than the order total made the total negative. It published changes_requested with a numbered list, and builder got a Fix review comments task.

That task lands in builder, the workspace the trigger names, not in the fork that wrote the branch. Move it there: right-click the task, choose Move Task, 1. pick the fork that built the branch, and 2. click Move. The fork's agent fixes it on the same branch, in the same worktree, and code_changed sends it back to the reviewer.

Step 8: the Move Task dialog for fix-review-comments, which lists the builder's three forks under it, with build-gift-card-redeem picked and arrows at it and at the Move button

Step 9: You Merge

review_passed gives you a Merge a reviewed branch task in planner: 1. assigned to you, with 2. the branch from review_passed.

Step 9: the planner workspace with the Merge a reviewed branch task, assigned to a human, showing Branch feat/gift-card-ui, commit a3f91c2 and a summary, with arrows at the HUMAN label and the Branch line

Merge the branch the way you always do. From the main checkout:

bash
cd ~/code/shop
git merge --no-ff feat/gift-card-ui     # or open a pull request from it

Then merge the fork back into builder: right-click it in the sidebar and choose Merge into builder. 1. The dialog shows the fork's worktree. 2. Tick Delete the fork's folder on the machine to remove the worktree as well. The git branch stays, so no commit is lost, but uncommitted changes in the folder go with it. 3. Merge stops the fork's agent, moves its tasks back to builder with their threads, and removes the fork.

Step 9, continued: the Merge into builder dialog for build-gift-card-ui, showing the fork's folder /home/dev/.agentrq/forks/0mobCpY8dWf and the Delete the fork's folder checkbox, with arrows at the path, the checkbox and the Merge button

A merge is refused while any of the fork's tasks is unfinished, so a fork cannot be merged away with work still in it. A fork cannot be deleted or archived, only merged.

How the Team Avoids Conflicts

Conflict What prevents it
Two agents editing the same files Each agent has its own folder: three worktrees you make, plus one AgentRQ worktree per fork
Two builders changing the same lines The planner's mission: items that can be built in parallel touch different files
A branch checked out in two places Builders work on their own branch; the reviewer checks out detached
A fork connecting as its parent The fork's .mcp.json gets the fork's own entry; a committed one is marked skip-worktree
One builder's task picked up by another Every fork has its own queue: its agent never sees the other forks' tasks
Ports taken by another builder's dev server Give each builder a port in its plan item, or tell builders to use any free port
Missing .env or node_modules in a fork A worktree has only what git tracks, plus .mcp.json and .claude. Copy the .env yourself and install dependencies in each fork
Work the fork never got A fork's worktree starts at the builder's last commit: uncommitted changes in builder are not in it
Losing work at the end Merging moves every task back with its thread; deleting the folder keeps the branch

Draw It as a Workflow Instead

The triggers above fire every time their event fires. To see the same loop as a graph and run it as a named pipeline, build it as a workflow: pick plan_ready as the start event, then drag each role onto the event it reacts to. Use one or the other: a workflow step and a trigger on the same event both create a task, so you would get each task twice.

Run It Without the Web App

Everything here also works from an agent. The supervisor workspace has workspace.fork and workspace.mergeFork for forks, and events.createTrigger for the wiring. A worker agent fires events with workspace publishEvent, the same call the planner, builders and reviewer made in this run. The MCP integration page lists every tool.

FAQ

Do I need a fork for every builder task? No. A builder without forks works through its tasks one at a time, in ~/code/shop-build. Fork when you want tasks to run at the same time.

Can the forks run different agents? Yes. Each fork has its own agent: Claude Code in one, an ACP agent such as Codex or Gemini CLI in another. Pick it in Spin up, under What to run.

Where is a fork's folder, and which branch is it on? In ~/.agentrq/forks on the machine that ran it, in a folder named after the fork's id, on a branch named agentrq/fork- followed by the fork's id. agentrqd serve --forks-dir puts the folders somewhere else, such as on another drive.

What if my folder is not a git repository? The fork gets a copy of the folder instead of a worktree. The rest is the same.

Can a fork be forked? No, forks are one level deep. The supervisor workspace and archived workspaces cannot be forked either.

Should I turn on YOLO mode for the builders? Only when you trust what they run. Every permission request otherwise waits for you, which is the point of the human in the loop. The trigger form has a YOLO mode switch per trigger.

Start Free