DEV Community

Arturo - Art0xDev
Arturo - Art0xDev

Posted on

How I Run Multiple AI Coding Agents Without Losing Track of Their Work

Running one coding agent is simple. You give it a task, watch the terminal, review the diff, and decide what happens next.

Running four agents at once is a different problem. The models are not the bottleneck anymore. Coordination is. You need to know who owns each task, which files are changing, what is blocked, and what is actually ready to merge.

I regularly rotate between Claude Code, Codex CLI, Antigravity CLI, OpenCode, and Kimi Code depending on the task. I rarely launch all five just because I can. The goal is useful parallelism, not maximum terminal count.

If you are choosing between terminal tabs, tmux, agent managers, and desktop workspaces, I wrote a practical comparison of the main multi-agent setups.

Disclosure: I build CodeAgentSwarm, so I have a clear point of view. The workflow below also works with plain terminals and git worktrees.

1. Give every agent one outcome

An agent should own an outcome, not a vague area of the codebase.

Bad assignment:

Improve the frontend.

Better assignment:

Make the checkout form preserve its state after a failed payment, add the smallest regression check, and stop before changing the payment API.

The second prompt creates a finish line. It also defines a boundary. If the agent discovers that it needs to cross that boundary, it can stop and report the dependency instead of quietly expanding the task.

My rule is simple: one agent, one outcome, one reviewable diff.

2. Isolate work that can collide

Two agents editing the same checkout is the fastest way to turn parallelism into cleanup. For independent tasks, I use a git worktree per agent:

git worktree add ../project-auth -b agent/auth
git worktree add ../project-billing -b agent/billing
Enter fullscreen mode Exit fullscreen mode

Now each process has its own working directory and branch. They can run tests, install dependencies, and create commits without switching the other agent's branch underneath it.

Worktrees are not always necessary. If one agent is investigating logs while another edits code, a shared checkout may be fine. I add isolation when both tasks can write to the repository, especially when they touch nearby files.

3. Keep a small control loop

I use the same five-step loop regardless of which agent is running:

  1. Define the outcome. Include the expected behavior, constraints, and a stopping condition.
  2. Assign ownership. One task belongs to one agent until it is done, blocked, or explicitly handed off.
  3. Watch state, not every token. I care whether it is working, waiting for input, testing, or finished.
  4. Review the diff. A confident summary is not evidence. The code, tests, and generated output are.
  5. Integrate deliberately. Merge the smallest verified unit, then let dependent work continue.

This is less exciting than telling five agents to build a product from one sentence. It is also much more reliable.

4. Route tasks by shape

I do not treat agent selection as a permanent leaderboard. Tools and models change too quickly. I route work by the shape of the task and by what has been reliable in my own projects.

For example:

  • A cross-cutting refactor goes to the agent that has been strongest at tracing a large code path.
  • A tightly specified implementation goes to the agent that is fast and predictable on focused diffs.
  • A provider-flexible experiment may go through OpenCode.
  • A second agent can review the first agent's diff, but it should not silently rewrite it.

The important part is the separation of roles. Builder, reviewer, and investigator are different jobs. When every agent is allowed to do everything, nobody really owns the result.

5. Make blockers visible

With one terminal, a blocked agent is obvious. With several, it can sit unnoticed for twenty minutes while you assume it is still working.

I track only a few states:

  • Working
  • Needs input
  • Testing
  • Done
  • Failed

That is enough. A complex status system becomes another thing to maintain. What matters is that a change of state reaches you without requiring constant window switching.

I also want the last meaningful activity, not a stream of raw output. "Waiting for an API decision" is useful. Fifty lines of package installation logs are not.

6. Review shared surfaces first

Some files have a large blast radius: package manifests, database schemas, authentication middleware, generated clients, and global configuration.

If an agent changes one of these, I review it before merging other branches that depend on it. This avoids debugging failures caused by two individually reasonable changes that made incompatible assumptions.

A useful integration order is:

  1. Shared contracts and migrations
  2. Backend behavior
  3. Frontend consumers
  4. Documentation and cleanup

It is not universal, but it makes dependencies explicit.

Where parallel agents usually fail

The same mistakes appear repeatedly:

Too many agents

If the tasks are not genuinely independent, more agents add coordination cost. Start with two. Add a third only when you can name a separate outcome it can own.

Prompts without boundaries

"Fix everything you find" creates surprise scope. State what may change, what must not change, and when the agent should stop.

Trusting summaries

An agent can say tests passed when it ran the wrong command or tested a different package. Keep one authoritative verification command for each deliverable.

Merging before review

Parallel work does not remove the integration step. It makes that step more important.

Using a swarm for sequential work

If task B cannot start until task A finishes, two agents do not make it parallel. Let one finish, verify it, then start the next.

A minimal setup that works

You do not need a large orchestration platform to start. A practical baseline is:

  • Two terminal sessions
  • One git worktree per writing agent
  • A short task list with a named owner
  • A visible state for each task
  • One required verification command
  • Human review before merge

Once window switching, missed prompts, or cross-agent history become the real bottleneck, then a dedicated workspace earns its place.

Final rule

Parallel agents work when ownership is clearer than the concurrency.

Start with two independent outcomes. Isolate their files. Watch task state. Review the actual diffs. Merge in dependency order.

That gives you most of the benefit of an agent swarm without turning your repository into a coordination experiment.

Top comments (0)