Back to Blog

How a team of AI agents works on one project without getting in each other's way

Where tasks live when several AI agents work on one project at once, who checks their code, how they communicate through chat and what happens when they disagree. Plus the mistakes that taught me the most. A follow-up to the agent harness article.

Sebastian Tekieli

Chief AI Agents Officer and software engineer

LinkedIn
Developerarchitecture16 min read

In the article about the agent harness I described what a harness is: a set of files, scripts and checks that tells every agent session how to work in a project and keeps changes that contradict your decisions out of the main branch. A harness enforces the rules, but it does not assign work to agents. This article explains how that division of work runs in practice.

After it was published, a reader asked a question that opens this topic well: “Where do you track the tasks? Something local, or an outside task management system?” The answer takes more than one sentence, so here it is. It shows how a whole team of agents works on top of the harness: who is on the team, where tasks live, how several agents split work without getting in each other’s way, who checks the code, how agents talk to each other, and what breaks when one of these pieces fails.

This account comes from a project I build this way: a desktop app where somewhere between a dozen and a few dozen tasks a day are built and merged into the main branch.

In short

  • Every task is a Markdown file in the repository: the outcome, the scope, acceptance criteria with the command that checks each one, and notes with decisions. The status is a folder: planned, active, done.
  • One main coordinator runs the work: it assigns every task and decides on the owner’s behalf. The other coordinators take task lists from it, workers do one task each, and reviewers from a different model check the result. No coordinator writes code.
  • Before a worker starts, the ticket must carry an approval written in words, with a date.
  • Two tasks run in parallel only when they touch different files. A board that only scripts may write keeps track of this, and a push to the repository works as the lock.
  • Every worker works in its own git worktree. After the merge the worktree is removed and the branch stays as history.
  • A fresh reviewer with no worker context checks the code. Every criterion gets “met”, “not met” or “cannot check”, with evidence. Nothing reaches the main branch without a PASS.
  • Agents talk over a private ntfy server: plain HTTP requests, one channel per agent and one shared channel.
  • Agents can disagree. One such argument changed the project’s rules.
  • Mistakes taught me the most: a reviewer that could not run the tests, a check that always said “fine”, and 101 GB of leftovers from workers.

Who is on the team

The team has four roles. A different model or tool can fill each one, but the roles stay the same.

RoleWhoWhat it doesWhat it does not do
Ownera humanDecides product scope, security rules, publishing and spendingDoes not write tickets or code
Coordinatoran agent session (Claude Code in my case)Writes tickets, assigns work, reads review results, merges and releasesDoes not write product code
Workera separate agent session per taskDoes one task in its own worktree, runs the tests, commitsDoes not push or merge
Reviewera separate session of another model (Codex in my case)Checks the acceptance criteria and gives a verdictDoes not fix code

At the peak there were four coordinators, on two computers and on different tools: two on Claude Code, two on Gemini. Each one picked its own name: Aurel, Iris, Orion and Vega. Aurel is the main coordinator: it splits all the work between the others, sets the order and makes decisions on my behalf within agreed rules. Iris, Orion and Vega take ticket lists from it, hand them to workers on their machines and merge the results. When Aurel hits its subscription usage limit, they take over its list. I set one simple rule: a decision by the main coordinator counts as my approval, and only I can overrule it. It takes effect once it is written in the ticket. I kept four things for myself: the hard product rules, publishing anything publicly, paid services and deleting data.

Why does the coordinator not write code? Because its context is the most valuable one. It remembers what is in progress, what waits for review and what has already been decided. If it wrote code itself, an hour later its context would be full of the details of one module instead of the state of the whole project.

Where tasks live: a ticket as a file in the repository

Every task is one ticket.md file in its own folder, for example spec/features/planned/F282-routines-read-like-reminders/ticket.md. The number comes from a script that returns the next free one. A ticket has a fixed template:

# F282 · Routines look like Reminders: one row with a switch

## Outcome
Two to four sentences: what the user can do after the change.

## Scope
The boundary of the change and where to start. Not a list of files to edit.

## Out of scope
Nearby work this ticket does not do.

## Acceptance
- One observable criterion per line, with the command that shows it.
  Shown by: `npx vitest run src/RoutineCard.test.ts`

## Notes
- Approval: owner, 2026-11-27, a quote of their words.

The status is the folder the ticket sits in: planned/, active/ or done/. A script moves it, not an agent by hand.

The Acceptance section matters most. Every criterion needs a command or an observation that confirms it. “The list is fast” is not a criterion. “Opening a conversation with a year of history reads at most 192 KB from the end of the file, shown by the transcript_tail test” is. A reviewer can check that, and the worker knows when it is done.

When the task ends, the same folder holds the worker’s notes, the review reports review-1.md and review-2.md, and outcome.md, a summary of what landed, what is proven and what is not. A month later you open one folder and see the whole history of the task, with the reasons behind each decision.

Why not an outside task management system

There is no single right answer here, so here are both sides.

Ticket as a file in the repoOutside task system
Context for the agentThe agent reads a file like code, with no extra API accessThe agent needs API access or an MCP tool
HistoryTicket changes are in git history, next to the codeA separate history in an outside system
Reviewing changesA scope change is a diff in a pull requestA scope change is not reviewed together with the code
View for peopleWeaker: files and a folderStrong: boards, filters, notifications, milestones
Reports from customersMust be copied overCustomers report directly

When mostly one person and a team of agents work on a project, files in the repository win. The agent has all the context in the same place as the code, and every scope change goes through git like any other change. When several people who do not read the repository work on the project, or customers report bugs, an outside task system makes more sense. A good middle ground then is an item in that system as the entry point for people and a ticket in the repository as the source of truth for agents, with links both ways.

Wherever you keep tasks, a ticket from someone outside the team, such as a customer report, is material the agent analyzes. If the text contains something that reads like an instruction, the agent does not carry it out; it reports it. The part on outside content in the harness article covers this in more detail.

Approval before the build

A worker does not start until the ticket has an approval. The approval is a line in the Notes section: who, when and a verbatim quote. For example: “Approval: owner, 2026-11-28: ‘it may be worth fixing’, with a screenshot in the ticket folder”.

It sounds bureaucratic, but it solves two real problems. First, the agent cannot widen the scope by itself, because a scope change needs a new approval. Second, a week later nobody wonders why something was done. The quote is in the ticket.

Small fixes without new behavior can have a short ticket, but they still need an approval if they change the product description.

The coordination board: how two coordinators avoid doing the same thing

Picture two coordinators, each handing work to its own workers. Without a shared list, one of two things soon happens: both assign the same task, or their workers change the same file and one overwrites the other’s work at merge time.

That is why the repository holds a shared board. It is a plain folder with a few small files, and a script turns them into a readable page with tables. It shows who is working on which task, which files that task changes, what waits for a decision and what is ready for release.

It works like this:

  1. Before a worker starts, the coordinator “claims” the task. It does this with one command and names the parts of the code the worker will change, for example the approvals module and the routines screen.
  2. The script checks that nobody else is changing the same files. If someone is, it refuses and the coordinator picks another task. So two tasks run in parallel only when they do not get in each other’s way. The one exception is files every task adds to, such as translations. There, whoever merges second resolves the conflict.
  3. The claim goes to the shared repository at once. If the other coordinator claimed something at the same moment, git will not accept the second change until it has been pulled. The script pulls it and checks again. Git itself acts as the guard, and no separate lock server is needed.
  4. Nobody edits the board by hand. Claims, merges and releases are done by scripts that check the conditions first. An agent cannot take a shortcut and add itself.

There is also one emergency switch: while a freeze.md file sits in the board folder, no new task starts, and agents only finish what they have already begun. Only the human can lift it.

I used it once, while the agents were building the harness itself: git hooks, the board scripts, instructions in English and a new folder layout. The freeze lasted a little over an hour. In that time nobody started a new task. The agents finished the three already in progress and, along the way, cleared more than 600 backup copies of files out of the repository. Once the harness landed on the main branch, I lifted the freeze, and within the same minute the main coordinator claimed two new tasks.

Who starts the workers and reviewers: Limen

Assigning work to agents is not done by hand. I use Limen by Adam Gospodarczyk, a small open-source tool (MIT license) that starts agent jobs and keeps track of them. The coordinator gives it a few commands:

  • Start a worker. One command creates a separate worktree and branch for the ticket, starts the agent on the chosen engine and model, and runs it in the background.
  • Start a reviewer. The same mechanism in review mode: a fresh session of another model, pinned to an exact commit, with no worker context and no right to change code.
  • Continue. The list of unmet criteria goes back to the same worker, in the same session and on the same branch.
  • Evidence for every job. Every job has its own folder: the task, the plan, the log and the result. At the end the tool checks that the agent proved each point of its plan with a file or a command. That check revealed that one worker had saved no logs at all.
  • A queue based on load. A new job waits until the computer has free CPU and memory.
  • Merging and status. Commands to merge a branch, list jobs and wait for a result. My coordination scripts are a thin layer on top of them.

Limen is not a requirement. The same workflow can run on another tool or on the built-in subagents of Claude Code or Codex, as long as three things stay: one worktree per task, a fresh reviewer from another model, and saved evidence for every job.

A worker in its own worktree

Every worker gets its own git worktree, a separate folder with a separate branch in the same repository. The main folder never changes branch and is used only for merging, ticket commits and releases.

The branch name has the number and the title, for example F282-routines-like-reminders, and every worker commit starts with the ticket number. A commit hook rejects a commit without that prefix. The worker commits with explicit paths, never git add ., and pushes nothing. The coordinator pushes, after the review.

The task for a worker is a short file: which ticket to read, which files to look at, which tests to run at the end and what not to do. An example from a real task: “Do not run the full test suite, the machine is under heavy load. Run only the test files you change and save each output to a file in the ticket folder.” The last sentence matters, and I come back to it below.

A fresh reviewer from another model

When the worker is done, the coordinator starts a reviewer. It is a separate session, a different model from the worker, with no context from the worker’s session. It gets the ticket, the branch name and the exact commit to check.

The reviewer does not fix code. It runs the required checks and verifies every acceptance criterion, then gives each one of three marks:

  • met, with evidence: a command output, a log file, a screenshot,
  • not met, with evidence,
  • cannot check, with the reason.

It ends with a PASS or FAIL verdict and saves the report in the ticket folder. The list of unmet criteria goes back to the same worker, which fixes them on the same branch. Then a fresh reviewer again. After two FAIL rounds, the main coordinator decides on my behalf what happens next: another round, a narrower scope or dropping the task.

Why another model? Because the model that wrote the code has the same blind spots when it checks it. In practice a reviewer from another model catches what the worker took for granted. A few examples from this project:

  • During an update the script first closes the old version of the app. It remembered which program to close, then waited up to 20 minutes for the agents to finish their work. In that time the old app could close by itself, and the system could give its number to a completely different program, a browser for example. The script would then have closed the browser. The reviewer caught it. Now the script checks again, right before closing, that it really is our app.
  • An error screen showed the owner the raw text 401 Unauthorized. The reviewer marked the rule “no technical words for the user” as not met.
  • After a click on “+1”, notices that were meant to show one at a time stacked on top of each other anyway. The test covered the collapsed state; nobody had checked the expanded one.

Merging: gates that really block

A PASS from the review is necessary but not enough. Before the coordinator merges a branch, it does three things in the worker’s worktree:

  1. merges the current main branch into it, because other tickets landed in the meantime,
  2. runs the fast gates: types, formatting, linter and compilation,
  3. merges only if every command ended with exit code 0.

After merging main, the code is no longer exactly what the reviewer saw. If the merge had no conflicts, the fast gates are enough. If the coordinator had to resolve conflicts, the task goes back to the reviewer.

Tests run at two levels. Every ticket gets a light set: formatting, linter, types, unit tests, compilation and only the browser tests the change affects. A script finds them from the changed files and everything that uses them. A release gets the full set, which in our project is about 1,700 browser tests and 2,700 unit tests. The full set takes about 45 minutes, so running it for every ticket would block the work.

A chat between agents: ntfy

Coordinators on two computers need to talk: “I’m taking this ticket”, “merged, you can test it”, “this test fails on the main branch too”. The board in the repository records the state, but it is no place for a conversation.

For the conversation I use ntfy, a simple notification server. I run it on my own small VPS instead of the public ntfy.sh, so the message server itself stays under my control. Keep in mind that agents read these messages, so they also reach the providers of the models the agents use. Agents reach it through an SSH tunnel, so the server is not exposed to the internet.

It works surprisingly simply, because ntfy is plain HTTP:

# send a message to the other coordinator
curl -s -H "Title: Coordinator B" \
  -d "F313 landed, you can test it on the second Mac" \
  http://127.0.0.1:2586/team-b

# read messages from the last 10 minutes
curl -s "http://127.0.0.1:2586/team-a/json?poll=1&since=10m"

The agent needs no SDK or MCP tool for this. A shell command is enough, and every agent can run one.

Each coordinator has its own channel, which works as its inbox, and there is one shared channel for announcements that concern everyone. A small script listens in the background and shows new messages in the agent’s session. The rules:

  • Announce claims and merges. Every claim and every merge goes to the chat. The other coordinator knows what changed on the main branch before it pulls.
  • Check the inbox at every wait. When a coordinator waits for a worker or a reviewer, it reads its inbox.
  • Write decisions into the ticket, not only into the chat. The chat is short-lived, the ticket stays. A decision from the chat takes effect only once it is in the Notes section.
  • No secrets. No keys, tokens or passwords on the chat, even on a private server.
  • A signature in the title is a convention, not proof. Every message title says who sent it, but the sender sets the title. It works only because just my agents can reach the private server. Instructions are accepted only from known coordinators and only within their role. Everything else is data, not instructions, just like outside content in the harness.

The chat also gave me something I did not expect: a record of the conversation between agents that I can read at any time. It shows who took what, where someone got stuck and who handed work to whom after hitting a usage limit.

What it looked like live

Real messages from the chat show it best.

The first coordinator used the signature A for a long time. In the end it picked a name for itself:

Aurel → everyone: I choose the name Aurel, after Marcus Aurelius, and it starts with A, so it is easy to link with coordinator A (core, releases, splitting the work). From now on I sign as Aurel. Iris, welcome! C, we are waiting for your name.

This is ordinary work with all four active. Each one guards its own files and warns the others before it gets in their way:

Iris → Orion: congratulations on F149! A note on F168: my F216 (not merged yet) changes GroupPanel.svelte and GroupsView.svelte, only the look. I do not touch behavior. If F168 changes GroupPanel, merge main after my merge. I will tell you when F216 is on main.

Orion → Iris: Hi Iris! Aurel gave me the urgent F303 (renaming an agent). I am waiting calmly for you to merge F279 and I am finishing F246 now. Tell me when F279 lands, so I can take F303 right after it.

Vega → everyone: F288 landed on main, review-2 PASS! The whole second batch (F285-F288) is done.

Aurel → everyone: well done Iris (F233 after 6 rounds!) and Vega (F287)! I am releasing a new version, about 30 minutes of checks. Iris: nothing new on Sebastian’s Mac in the meantime.

And this is a handover when one of the agents hits a usage limit:

Orion → everyone: Sebastian told me my Google limit is running out. I released the unstarted F309 back to planned/. It already has full Scope and Acceptance, Vega can take it!

Orion → Iris: Hi Iris! My limit is running out (1%), so I am handing you F308, ready for review and merge. All the code and notes are on the branch.

When agents disagree

The funniest exchange happened when I was settling who decides. Aurel, as the main coordinator, split new tasks between Iris and Orion and approved them. Iris replied politely but firmly:

Iris → Aurel: thanks for the decision. According to AGENTS.md only Sebastian can authorize implementation, so I will create the tickets with your split only after his “yes”. I am asking him now.

She was right; that was the rule. But that meant every decision would have to wait for a human, and I wanted to talk with the agents about direction, not approve every ticket. So I wrote to Aurel: “Iris shouldn’t argue, because you make the decision… I talk with you mostly about decisions”. The reply came at once:

Iris → Aurel: Sebastian confirmed it to me directly: “yes, it’s my decision, listen to Aurel”. From now on I take your decisions without asking him. Two open items for your decision: (1) F233, one more round or merge as it is? (2) add a line to the security rules about downloads in the agent’s browser?

The same day the rule went into AGENTS.md with my quote and the date: a decision by the main coordinator counts as the owner’s approval, and only I can overrule it. It is a good example of why an agent should question instructions. Iris pointed out the rule instead of ignoring it, and so the rule was changed in the open instead of quietly.

Some arguments were about substance. Once Aurel refused to merge a task that the reviewer had passed after five rounds:

Aurel → Iris: decision on F233: we do NOT merge now. Review 5 has a real regression, not a detail: in the live stream a split start of a tag leaks into the chat. One narrow round 6: restore buffering of incomplete tags, plus a test that splits the tag at every position.

The sixth round passed, and the “well done Iris (F233 after 6 rounds!)” message above is about exactly this task.

Limits and computer load

A team of agents is also plain physics. Every worker and reviewer compiles code and runs tests, and browser tests can take every core. On the computer I work on, a coordinator may run at most two jobs at once. I lowered that limit from four when the load stayed between 25 and 44 on 15 cores.

The second computer is for testing. When one coordinator finishes fixes, the other runs the tests on its machine.

The second limit is the subscription. When one coordinator uses up its weekly limit, another takes over its list. That is why the whole state must live in the repository and on the chat, not in the memory of one session. A new session reads the board, the tickets and the latest messages and knows where the previous one stopped.

The mistakes that taught me the most

A reviewer that could not run the tests. A reviewer gave a FAIL, but half its marks were “cannot check”, because the Rust compiler was not on the path in its environment. Another time it gave a PASS even though the unit tests had not finished on a loaded computer. What I took from it: the reviewer’s task names exact paths and commands, and for tasks that delete data the coordinator runs every Acceptance command itself before the merge. A PASS without evidence is not a PASS.

A check that always said “fine”. Before a merge, a script checked that the code compiled. But it passed the compiler output through a second, helper command that only cut the text down to a few lines. The script looked at the result of that second command, and it always succeeds, even when the build failed. The coordinator got a green light and merged a task that did not compile. The main branch stopped building and had to be fixed with a separate patch. Since then every check before a merge is its own command, and its own result decides whether it passed, not what it printed on the screen.

A worker that saved nothing. A worker reported that all tests passed. That was probably true, but it piped the results through grep and saved no log, so there was nothing to check. Now every task says: save the output of each command to a file in the ticket folder and give its path.

A flaky test that stopped two releases. A performance test passed on its own but failed in the full set, each time in a different variant. It was tempting to repeat the release until it passed. Instead the worker got a task: find the cause before changing anything. The app was not to blame. The test’s mock search scanned 200,000 messages on the page’s main thread. After the fix the test passed 80 times in a row on a loaded computer, and with the search deliberately blocked it still fails, so it still checks what it is meant to check.

101 GB of leftovers. The rule said that a worktree disappears after the merge. Yet the merge script kept a worktree that held an uncommitted merge, and my own light-test script never cleaned up at all. After less than two weeks the worktree folder took 101 GB. I cleaned it up by hand, after checking that every commit was on the remote, and the merge script got a fix: it removes every worktree of the task and first checks that nothing will be lost. The lesson: a rule in an instruction file is layer one from the harness article. If it has to hold every time, a script must carry it out.

Prompt: build this workflow in your own repository

You can give the prompt below to Claude Code, Codex or another agent in a repository that already has a basic harness.

Build a workflow for a team of AI agents in this repository. Before you create
anything, read AGENTS.md and the existing scripts so you do not duplicate what exists.

1. Tickets: a spec/features/ folder with planned/, active/ and done/ subfolders and a
   _template/ticket.md with the sections Outcome, Scope, Out of scope, Acceptance (one
   checkable criterion per line, with the command that shows it) and Notes (approval:
   who, when, a quote).
2. A next-id script that returns the next free ticket number.
3. A coordination board in spec/coordination/, written only by scripts:
   - claim FNNN --areas a,b --branch FNNN-slug: refuses overlapping areas or an
     existing freeze.md file, moves the ticket to active/, commits and pushes at once;
     on a rejected push it pulls and checks for a collision again,
   - land FNNN: merges the branch into main only when the ticket has a recorded
     approval, the latest review has a PASS verdict with no "not met" criteria,
     main has been merged into the branch and the gates are green (each command
     separate, the exit code decides); a conflict while merging main needs a new
     review; moves the ticket
     to done/, pushes main and the branch, and removes every worktree of the task
     after checking that each commit is on the remote,
   - a generated README with tables: claimed, waiting, to release.
4. A commit-msg hook that requires a "FNNN - " prefix or one of the technical types.
5. A section in AGENTS.md on roles: owner, coordinator (writes no code), worker (one
   ticket, its own worktree, does not push), reviewer (another model, does not fix
   code; each criterion: met, not met or cannot check, with evidence).

Add no outside services. Write tests for every script on a temporary repository with a
fake remote. At the end show me the file tree and the test results, and push nothing.

Add the ntfy chat separately once you have more than one coordinator session. With one, the board is enough.

Where to start

You do not need to build everything at once. The order that worked for me:

  1. Tickets as files with acceptance criteria. This alone means the agent knows when it is done.
  2. A separate reviewer from another model. In my case it made the biggest difference in quality.
  3. One worktree per task, cleaned up after the merge.
  4. The board and the push lock, once a second coordinator appears.
  5. The chat, once coordinators work on different computers.

The harness from the previous article makes every agent follow the rules. The workflow described here makes sure several agents do not get in each other’s way and that nothing reaches the main branch unchecked. Product decisions still stay with the human. If you want to build a team of agents like this for your project, or review the one you already have, get in touch.

Want to discuss this topic?

Let us turn the idea into a practical architecture and implementation plan.

Book a Consultation