AI Coding Agents: A Coordinator-Worker Workflow
Coordinate parallel AI coding agents with durable state, clear stop rules, and model choices that reduce context switching, wasted runs, and review risk.

Stop Babysitting AI Coding Agents: Use a Coordinator and Workers
Running a few AI coding sessions at the same time feels efficient. One agent can chase a bug, another can update a separate repository, and a third can investigate a technical question. But without coordination, you end up doing the glue work yourself - switching tabs, reconstructing context, checking what each agent actually changed, and deciding what happens next.
That's easy to underestimate. A single session can look productive while the overall workflow gets harder to supervise. Agents can loop on the same investigation, make changes that drift beyond the task, or "finish" without leaving a clear handoff. The core issue usually isn't that you need more watching. It's that the work has no shared operating model.
A coordinator-worker pattern fixes that: one session owns assigning and tracking bounded work, while specialist sessions do the execution. Durable state files keep context between runs, checkpoints cut the cost of interruptions, and explicit stop rules reduce drift. This guide walks through how to set up that system, when it helps, and where human review still matters.
Why do multiple AI coding agents become hard to manage?
Parallel sessions can look like coordinated work, but they don't automatically produce a coordinated workflow. Each agent has its own context, assumptions, and idea of what "progress" looks like. Without a way to share decisions and status, you effectively get several isolated workers and one human acting as the dispatcher.
That coordination load grows fast. You have to keep track of which agent owns which task, whether its latest output is trustworthy, what it changed, and whether another task depends on it. In practice, the cost isn't only time lost switching tabs. It's the attention required to rebuild context every time you come back.
Parallel work needs boundaries
Good parallel work has clear boundaries: a separate repository, a well-defined component, or an investigation that doesn't depend on someone else's edits. If two agents touch overlapping files with no plan, you can end up with conflicting implementations or integration headaches. More sessions don't fix a task that should be decomposed first.
Before you start workers, ask whether each unit can be finished and checked on its own. If the answer is no, split it differently - or have one agent investigate and report before you assign implementation. Parallelism helps when the work is separable. Otherwise it just increases coordination and review time.
The human should set direction, not relay every update
In a manual setup, you translate your goal into instructions, inspect outputs, and pass information between agents over and over. A coordinator can take over the routine parts: distribute specific tasks, read worker status, collect results, and produce a single consolidated update. You still own prioritization and the decisions that actually matter, but you're no longer the message bus.
This is mainly about reliability. A coordinator doesn't magically make a worker's output correct. It makes the work easier to observe and manage. You still need tests, code review, and clear ownership of decisions. The pattern reduces administrative overhead - it doesn't replace engineering judgment.
A good first use case is a small batch of independent tasks across separate repositories. For instance, one worker can update a validation rule in a service while another documents a migration in a different project. The coordinator tracks both, but each worker gets a bounded assignment and a definition of done. If one task stalls, the other can still complete without derailing the whole workflow.
How does the coordinator-worker pattern work?
Think in three roles: you set priorities and constraints, the coordinator manages the work, and workers complete bounded tasks. The coordinator is the single place you review progress and ask for a summary. Workers execute their specific tasks and return evidence: what they did, what remains, and what's blocked.
This doesn't require a heavyweight "multi-agent" framework. It can run with separate AI sessions and a shared state file. The key is making responsibilities and handoffs explicit.
Define a task before launching a worker
Each worker assignment should include enough detail that the agent isn't guessing:
- Task: the specific change or investigation requested.
- Context: relevant repository, files, constraints, and prior decisions.
- Definition of done: observable conditions that mean the task is complete.
- Verification: tests, checks, or inspection the worker should run.
- Boundaries: what not to change and when to stop or escalate.
For example, "improve the API" is too broad. "In the billing service, add validation for an empty account ID, add a test for the rejection response, run the relevant test suite, and do not change the response schema" gives the worker a real boundary.
The coordinator also needs to track dependencies. If a worker's task depends on a design decision or another branch, it shouldn't be launched as if it were independent. The coordinator should either identify that dependency and ask for a decision, or assign a discovery task first.
Make handoffs auditable
When a worker finishes, the message should be short but concrete: what files changed, what checks ran, the results, remaining risks, and what decision (if any) is needed. "Done" isn't enough.
For code changes, useful evidence includes the test command and result, a concise diff description, and any checks that were skipped. With that, the coordinator can report what's complete and what still needs human review. That keeps "work performed" separate from "work verified."
Keep the coordinator narrow
A coordinator can become another overworked agent if you expect it to make every technical decision, resolve conflicts, and rewrite everything. Keep its job focused on assignment, state, and reporting.
Let workers do the bounded implementation or investigation. Pull decisions back to the human when the scope, architecture, data handling, or product behavior isn't clear.
Practically, this gives you one reliable point of control. It should make the workflow easier to inspect - not hide complexity behind a polished summary.
How should coding agents preserve state between sessions?
A new session can't safely rely on the previous session's memory. Some models won't retain context across sessions, and even a continuous session can drop details in a long chat. If the next worker needs a fact to proceed, store it somewhere durable: a project instruction file, a task board, or a small state document that lives with the work.
The state doesn't need to capture every conversation. Its job is to make the next action clear and prevent repeated discovery. A short, current record beats a long transcript no one can scan.
Use a compact state format
For each task, record three essentials:
- Done: completed work and relevant verification.
- Exact next step: one unambiguous action the next session can take.
- Blocked: what failed, what was tried, and what decision or condition is needed to continue.
A simple entry could look like: "Done: added the account ID validation and regression test; relevant tests pass. Next: inspect the diff for unintended schema changes. Blocked: none." If the task is stuck, be equally precise: "Blocked: migration test fails on the existing fixture; tried updating the fixture and running the test in isolation; need a decision on whether the fixture represents supported legacy data."
The point is to describe the state of the work, not just the agent's activity. "Worked on tests for 20 minutes" doesn't help the next session. "The new test fails because the fixture omits a required field; update the fixture only if it is not intended to test legacy behavior" does.
Checkpoint after each unit of work
Don't wait until the session ends to write state. Update it after a meaningful unit is finished: a test passes, a file change is complete, or an investigation produces a decision. Sessions can end unexpectedly - timeouts, quota limits, network issues, or you switching tasks. Frequent checkpoints limit how much useful work disappears.
Checkpoints should take less effort than reconstructing the work later. Keep them brief, include the next action, and avoid copying full conversation logs. If the project already has a reliable issue tracker or task system, use that instead of creating a second source of truth. The exact format matters less than having one obvious place to see current status.
Read state before acting
Make "read the saved state" the first step for both coordinator and worker sessions. Then check whether the task or requirements changed. If they did, update the assignment before editing code. If they didn't, continue from the recorded next step instead of repeating the same investigation.
This prevents a common failure: an agent confidently acting on context that only existed in an older conversation. A state file only helps if sessions consistently read and update it. Treat stale or contradictory state as a reason to pause and reconcile - not as permission to guess.
How do you control scope, cost, and risk?
An agent needs a stopping condition just as much as it needs a task description. Instructions like "keep improving this" or "work until the session ends" invite unnecessary changes. The agent might polish long after the useful work is done - or expand the task because there's no clear signal to stop.
A practical stop rule combines a definition of done with limits on time and repeated failure. For a longer task, stop when the first condition is met: the definition of done is satisfied, 60 minutes have passed, or the same problem has failed three times. If you hit a limit before completion, record the state and mark the task blocked or incomplete. Don't let the worker silently redefine success.
Separate completion from approval
A worker can meet its definition of done without having authority to merge or release its changes. Set verification and approval boundaries based on risk.
Routine, reversible edits might only need lightweight review. Changes to authentication, payments, production data, security controls, or user-facing behavior should have stronger human oversight.
Tell the worker what it may change and what requires escalation. For example, it can propose a database migration but shouldn't apply it directly to production. It can prepare a dependency update, but the team decides whether to accept a breaking change. Keep autonomy proportional to the consequence of an error.
Match model cost to task difficulty
The most capable model isn't always the right default. Use a stronger model for ambiguous requirements, architecture decisions, hard debugging, or careful synthesis. Use a less expensive model for repetitive file edits, formatting, status updates, or routine checkpointing.
This isn't a universal ranking. A cheaper model can cost more overall if it misunderstands the task and creates changes that require lots of repair. Start with the least costly option that reliably meets your quality bar, then move up when the work shows you need it. Track the outcome - model cost, rework, review time, and whether the task actually finished - because that's the real cost.
A safe first scheduled worker
Before automating recurring work, try a small scheduled task with a tight scope. Use a state file containing one to three tasks, each with a definition of done. Run it at a predictable time - overnight when no one is using the account - and add a rule to do nothing if requirements haven't changed since the last run.
Require a checkpoint after every completed unit, use a low-cost model by default, and escalate only when the task truly calls for it. Keep the first run low-risk and review the diff before expanding what the worker is allowed to do.
Scheduling is a good fit when the task is stable and repeatable. It's a poor fit when priorities are changing or key product decisions are still unresolved.
Key takeaways
- Assign independent, bounded work rather than launching agents against overlapping code.
- Use one coordinator to track tasks and report results, not to replace human decisions.
- Persist the exact next step and checkpoint after each meaningful unit.
- Set a definition of done, verification expectations, and a clear stop rule.
- Spend more model capability where ambiguity or consequence justifies it.
Conclusion
The coordinator-worker pattern is a small change in how you run AI coding sessions, but it targets the main source of friction: unmanaged handoffs. One session tracks the work, workers take bounded assignments, and durable state makes the next action visible even when a session ends.
Start with a couple of independent tasks, write down what "done" means, and require a checkpoint before a worker stops. Keep permission and review requirements proportional to the consequences of the changes. If the system makes progress easier to inspect and interruptions easier to recover from, it's working. If it adds yet another layer of status management, simplify it.