Agent Orchestrator: Solving the Git Chaos of Multi-Agent Development with Worktree Isolation
Hook
Running multiple AI coding agents simultaneously sounds productive until they all try to commit to main at the same time. Agent Orchestrator solves this with a git feature most developers have never used.
Context
The promise of AI coding agents has evolved from "autocomplete on steroids" to "autonomous developers that can implement entire features." Tools like Aider, Claude Code, and GitHub Copilot Workspace can now take a natural language prompt and generate working code, tests, and documentation. But as developers started chaining these agents together or running multiple in parallel, a brutal coordination problem emerged: how do you prevent agents from clobbering each other's work?
The naive approach—spinning up multiple agent instances pointed at the same repository—immediately creates branch conflicts. Agent A starts working on main, Agent B also checks out main, and suddenly you're manually resolving merge conflicts between two AI-generated changesets that have no awareness of each other. You could manually create branches for each agent, but now you're juggling terminal windows, losing track of which agent is doing what, and constantly context-switching between their outputs. Agent Orchestrator emerged from OrchestratorInc to treat this as an infrastructure problem: if agents are going to work in parallel, they need process supervision, workspace isolation, and operational visibility.
Technical Insight
Agent Orchestrator's core architectural insight is treating coding agents as supervised black-box processes rather than libraries to integrate. The system is a Go daemon that wraps existing agent CLIs (Aider, Claude Code, Codex, and 20+ others) using PTY attachment for terminal-based agents or JSON protocol parsing for chat-based ones. When you spawn a worker, the daemon doesn't fork the agent's code—it literally runs exec on the agent's CLI binary and watches what happens.
The coordination breakthrough is git worktree isolation. When you create a worker session, Agent Orchestrator doesn't clone the repository or create a normal branch. Instead, it uses git worktree add to create a linked working directory on its own branch:
// Simplified from the actual worker spawning logic
func (d *Daemon) SpawnWorker(task string, agentType string) (*Worker, error) {
worktreePath := filepath.Join(d.workDir, uuid.New().String())
branchName := fmt.Sprintf("agent/%s", uuid.New().String())
// Create isolated worktree on new branch
cmd := exec.Command("git", "worktree", "add",
"-b", branchName, worktreePath, "HEAD")
if err := cmd.Run(); err != nil {
return nil, err
}
// Launch agent CLI in worktree directory
agentCmd := exec.Command(agentCLIPaths[agentType], "--task", task)
agentCmd.Dir = worktreePath
pty, err := pty.Start(agentCmd)
if err != nil {
return nil, err
}
worker := &Worker{
ID: uuid.New(),
Branch: branchName,
WorkDir: worktreePath,
PTY: pty,
State: StateActive,
}
go d.superviseWorker(worker)
return worker, nil
}
This approach gives each agent a real filesystem directory with its own .git state, but all worktrees share the same object database. There's zero cloning overhead, and each agent can commit, branch, and modify files without any possibility of conflicting with other workers. When the agent finishes, the daemon automatically creates a pull request from that branch, and the worktree can be cleaned up or persisted for review feedback loops.
The supervision model is where things get interesting. The daemon doesn't parse code or understand what the agent is doing semantically—it observes at the infrastructure level. For each worker, it:
- Captures stdout/stderr through the PTY to stream progress to the UI
- Polls
git statusin the worktree to detect uncommitted changes - Watches
git logto track commits and correlate them to file modifications - Uses filesystem watches (via fsnotify) to detect writes outside git's awareness
- Polls the GitHub API to sync PR status (draft/ready/approved) and CI check results
These observations get projected into a unified operational state machine. A worker transitions from Active to WaitingForCI when it opens a PR, then to WaitingForReview when CI passes, and finally to ReviewFeedback if a human requests changes. The Electron UI renders this as a Kanban board, but it's actually a live system dashboard—each card represents a supervised process, and the swimlanes reflect the worker's position in the PR lifecycle.
The orchestrator planning agent is architecturally distinct from workers. It's a persistent conversation thread (stored as JSON event logs) that maintains project context across sessions. When you describe a feature, the orchestrator doesn't implement it—instead, it decomposes the work into tasks and invokes the same daemon APIs the UI uses to spawn worker agents:
// Orchestrator agent invoking daemon API to spawn workers
type TaskDecomposition struct {
Tasks []Task `json:"tasks"`
}
type Task struct {
Description string `json:"description"`
AgentType string `json:"agent_type"`
Dependencies []string `json:"dependencies"`
}
func (o *Orchestrator) ExecutePlan(plan TaskDecomposition) {
for _, task := range plan.Tasks {
// Wait for dependencies to reach merged state
o.waitForDependencies(task.Dependencies)
// Spawn worker using same API as UI
worker, err := o.daemon.SpawnWorker(
task.Description,
task.AgentType,
)
if err != nil {
o.logError(task, err)
continue
}
// Track worker in orchestrator context
o.trackWorker(task, worker)
}
}
This design means the orchestrator can't micromanage workers—it spawns them, tracks their lifecycle, and potentially re-spawns them if they fail. But it can't intercede in their decision-making or provide mid-flight guidance. The tradeoff is that supporting new agent types requires zero integration work—if it has a CLI, the orchestrator can supervise it.
One subtle detail that matters for web development workloads: the daemon manages browser profile isolation when agents need to test UIs. Each worker gets its own Chromium profile directory, preventing cookie and localStorage collisions when multiple agents are testing the same localhost:3000 application. This is the kind of operational detail that only surfaces when you've actually tried to run parallel agents and hit weird Selenium flakiness.
Gotcha
The git worktree architecture has a hard dependency that limits applicability: everything must happen in a git repository. The documentation mentions "branchless directories" for standalone agent sessions, but these are second-class citizens—they don't get PR creation, CI integration, or the full supervision lifecycle. If you're prototyping in a scratch directory or working in a non-git monorepo, Agent Orchestrator can't help you.
The supervision model's black-box approach is both a strength and a limitation. Because the daemon only observes filesystem and git state, it has no backpressure mechanism when agents make bad decisions. If a worker commits deeply flawed architecture or gets stuck in a loop of CI failures, the orchestrator can't course-correct—it can only show you the mess and let you kill the process. There's no "agent quality score" or automatic rollback based on detected thrashing. The multi-agent support claims ("25+ agents") are misleading when you dig into the capability matrix—most agents have partial support as Workers only, with limited Chat or Reviewer integration. You're realistically using Aider, Claude Code, and maybe two others with full feature support.
Finally, the Electron-only interface is a deployment constraint. There's no headless mode for CI integration, no server deployment for team coordination, and no way to supervise agents running on remote development machines or in cloud environments. This is explicitly designed for solo developers running everything locally on their desktop.
Verdict
Use if: You're already juggling multiple coding agents manually (keeping three terminal tabs open running Aider, Claude Code, and Codex simultaneously), losing track of which branch each is on, and spending cognitive overhead tracking PR states. Use if you're doing parallel feature development where tasks are genuinely independent—refactoring the auth system while another agent updates documentation while a third writes tests. Use if you want operational visibility into agent work without building custom tooling. Skip if: You're running agents in CI/headless environments, you need programmatic control over agent decision-making (not just supervision), your workflow isn't git-based, or you want agents that can negotiate conflicts and coordinate semantically rather than just work in isolation. Skip if you're perfectly happy with one agent at a time—this solves coordination problems you only have at scale. The value proposition is narrow but real: it's infrastructure for multi-agent operations, not magic that makes agents smarter.