Skip to main content

How to run multiple coding agents at once

Summary

  • Give every agent its own git worktree and its own task, then review one pull request per agent. A git repository can support multiple working trees, so agents can check out different branches at the same time.
  • You can start sessions yourself in separate terminals, ask one agent to spawn subagents, or let a supervisor launch them. Claude Code's own parallel features run only Claude sessions, while Omnigent coordinates Claude Code, Codex and other agents in one session.
  • Omnigent is an open-source meta-harness (status alpha, and in Beta on Databricks). Its Polly agent fans independent tasks out to sub-agents, each in its own git worktree, and each opens its own pull request.
  • More agents means more model requests. Launch them with ug claude and ug codex so Unity Gateway applies rate limits, budgets and usage records.
  • Keep a person at the merge. Polly never merges, and automated tests do not replace human review.

How to run multiple coding agents at once

Give every agent its own git worktree and its own task, then review one pull request per agent. You can start the sessions yourself, ask one agent to spawn subagents, or let a supervisor such as Omnigent's Polly launch them. Route all of them through one gateway so rate limits, budgets and usage records cover every agent.

What patterns work when several agents run at once?

Anthropic's guidance on building agents names two forms of parallelization. Sectioning breaks a task into independent subtasks that run in parallel. Voting runs the same task several times to get diverse outputs, for example several different prompts reviewing one piece of code for vulnerabilities. When you can't predict the subtasks, an orchestrator-workers design lets a central model break the work down and delegate it, which suits coding changes that touch an unknown number of files.

How do you start several agents in parallel?

Approach How it works Stage or caveat
Separate terminals One agent per terminal, each in its own git worktree. Claude Code and Codex sessions can sit side by side. You assign tasks and merge
Claude Code claude --worktree <name> starts an isolated session. Subagents, agent view and agent teams run several tasks at once. Agent view is a research preview. Agent teams are experimental and off by default
Codex Ask it to spawn subagents in parallel and it collects their results. The app can start a chat in its own worktree. agents.max_concurrent_threads_per_session caps spawned threads
Omnigent Polly omni polly starts Polly, whose /fanout skill runs independent tasks in parallel, with one worktree, sub-agent and pull request per task. Open source with status alpha. In Beta on Databricks

In Claude Code's own approaches the workers are all Claude sessions, and its docs say to expose any other tool as an MCP server. Omnigent, a meta-harness, mixes Claude Code, Codex and other agents in one session, and Polly runs each sub-agent on its own harness.

How do you keep parallel agents from colliding?

Isolate files first. git worktree add ../hotfix creates the branch hotfix and checks it out at ../hotfix. Claude Code automates the step: claude --worktree feature-auth creates .claude/worktrees/feature-auth/ on a new branch named worktree-feature-auth. Claude Code agent teams don't isolate teammates in worktrees, so give each teammate a different set of files.
Omnigent adds guardrails. The worktree_guard policy blocks file writes outside a worker's git worktree, and spawn_bounds limits how many sub-agents one turn can dispatch (the default is 5). Polly's native workers run unattended, so their bundles declare a full-bypass stance for tool approvals, and the blast_radius policy still denies the catastrophic commands. A cloud sandbox host runs the agent in an isolated remote container instead of your personal machine.

How do you keep cost and rate limits under control?

Claude Code's docs say that running several sessions or subagents at once multiplies token usage, and Codex notes that each subagent does its own model and tool work. Unity Gateway puts the controls in one place:

  • Install the ug launcher with uv tool install git+https://github.com/databricks/unity-gateway, then start agents with ug claude or ug codex so requests go through a Databricks model service.
  • Rate limits count requests or tokens per minute, for a whole service or per user. None are set by default. Past the limit the service returns HTTP 429, so clients should retry with exponential backoff.
  • A monthly budget can send an alert, block usage, or both, at a shared or per-user threshold. Enforcement uses near real-time estimates, so final spend can pass the threshold.
  • Smart Routing (Beta) routes each subagent's task independently, so one run can use several models.

How do you review what parallel agents produce?

Each Polly implementer opens its own pull request, and /cross-review sends a diff to a reviewer from a different vendor, looping blocking issues back as fixes. Polly never merges, and the human decides. Anthropic's guidance adds that tests verify functionality, while human review remains crucial for fit with the broader system.

FAQs

Can I run Claude Code and Codex at the same time?

Yes. Run them in separate terminals with separate worktrees, or put both under Omnigent. Both can also connect through Unity Gateway with ug claude and ug codex.

How many agents can I run at once?

It depends on your rate limits, your budget and how many diffs you can review. Codex exposes agents.max_concurrent_threads_per_session, and Omnigent exposes spawn_bounds, which limits sub-agent dispatches per turn.

Is Omnigent ready for production?

Its FAQ says teams use it for real work, but releases ship often and can include breaking changes, so pin a version. The open-source repository lists "Status: alpha", and on Databricks "Omnigent is in Beta".

The information provided herein is for general informational purposes only and may not reflect the most current product capabilities or configurations.