Coding-Agenten parallel betreiben: Arbeit aufteilen und Ergebnisse zusammenfuehren
Wer mehrere Coding-Agenten wie Claude Code, Codex und Cursor gleichzeitig laufen laesst, aehnelt der Fuehrung eines kleinen Teams: Die Aufgaben muessen so aufgeteilt werden, dass niemand dieselben Zeilen bearbeitet, und die Aenderungen werden einzeln reviewbar zurueckgeliefert.

Veröffentlicht am 30. November, ursprünglich erschienen auf sandscale.dev
Einen Coding-Agenten laufen zu lassen ist ein Gespräch. Fünf gleichzeitig zu betreiben kommt eher der Leitung eines kleinen Teams nahe: Die Arbeit muss aufgeteilt werden, damit niemand dieselben Zeilen bearbeitet, jeder braucht einen Ort zum Arbeiten, jemand schaut nach dem Fortschritt, und die Ergebnisse kommen als Änderungen zurück, die man einzeln reviewen kann.
Dieser Beitrag handelt von der zweiten Situation, für Teams, die Claude Code, Codex oder Cursor verwenden. Er behandelt, wie die Arbeit aufgeteilt wird, warum jeder Agent eine eigene Maschine bekommen sollte, und die Befehle zum Überwachen und Reviewen mehrerer Agents mit der Sandscale CLI (Version 1.4.1). Er wiederholt nicht die Argumente gegen den Betrieb von Agents auf einem Laptop; unser Beitrag zu den Kosten von Laptop-Agents für das Team deckt das ab.
Die meisten gescheiterten Parallelläufe scheitern an der Aufteilung, nicht an der Maschine. Zwei Agents, die beide die API-Schicht aufräumen sollen, erzeugen zwei Branches, die überall konfliktieren, und jemand verbringt den Nachmittag mit dem Zusammenführen.
Gute Aufgaben, die sich parallel ausführen lassen, haben folgende Eigenschaften gemeinsam:
Eine kurze Aufgabenliste im Repository oder im Issue-Tracker, mit den gehörten Pfaden und dem Check pro Aufgabe, bringt einem Parallellauf mehr als jede Einstellung.
Getrennte Clones oder git worktrees auf einem Rechner lösen das Dateiproblem. Sie lösen den Rest nicht: Die Agents teilen sich weiterhin Ports, CPU, Arbeitsspeicher, Caches und das Benutzerkonto. Zwei Dev-Server wollen denselben Port, der Build eines Agents verlangsamt die Tests eines anderen bis zu Timeouts, und der Agent deutet diesen Timeout als echten Bug.
Mit einer Maschine pro Agent verschwinden diese Probleme konstruktionsbedingt. Sandscale gibt jedem Agenten einen eigenen Workspace: einen dauerhaften Cloud-Rechner auf seiner eigenen Firecracker-MicroVM, mit eigener Festplatte, eigenen Ports, eigener CPU und eigenem Arbeitsspeicher. Repository, Branch, installierte Tools und die Session des Agents sind beim nächsten Öffnen noch da.
sandscale workspace templates-list sandscale workspace create --name agent-search --template-id TEMPLATE_ID sandscale workspace create --name agent-billing --template-id TEMPLATE_ID sandscale workspace create --name agent-docs --template-id TEMPLATE_ID Vollbildmodus öffnen Vollbildmodus beenden Benennen Sie jeden Workspace nach seiner Aufgabe, damit die Liste wie Ihr Taskboard aussieht. create fragt vor jeder Änderung nach Bestätigung. sandscale workspace list zeigt alle mit ihren IDs.
Verbinden Sie sich mit jedem Workspace, klonen Sie das Repository, checken Sie den Branch der Aufgabe aus und starten Sie den Agenten in tmux, damit er weiterläuft, wenn Sie die Verbindung trennen:
sandscale workspace ssh agent-search tmux new -s run Vollbildmodus öffnen Vollbildmodus beenden Geben Sie dem Agenten die Aufgabe, die Pfade, die ihm gehören, und den Check, der sie abschließt. Wenn Ihr Repository eine AGENTS.md hat, lesen Claude Code, Codex und Cursor sie alle; unser Beitrag zu einer AGENTS.md für Agents auf eigenen Maschinen behandelt, was hineingehört. Trennen Sie die Session mit Ctrl-b d und fahren Sie mit dem nächsten Workspace fort.
Ein Agent in einem Workspace benötigt Netzwerkzugriff, um seinen Modellanbieter und Ihren Git-Host zu erreichen. Prüfen Sie daher vorab, was Ihr Tarif und die Richtlinie Ihrer Organisation erlauben.
Sie müssen keine Shell auf jeder Maschine öffnen, um den Stand zu sehen. workspace exec führt als Sie einen Befehl in einem laufenden Workspace aus und liefert dessen Exit-Code, Ausgabe und Fehler zurück:
sandscale workspace exec --ws-id WORKSPACE_ID --command '["sh", "-c", "cd ~/app && git log --oneline -5 && git status --short"]' Vollbildmodus öffnen Vollbildmodus beenden Führen Sie es für jede Workspace-ID aus workspace list aus. Jede Ausführung wird bestätigt, da sie Zustände auf der Maschine ändert. Die Hilfe der CLI besagt, dass nur der Eigentümer des Workspaces Befehle auf diese Weise ausführen kann, mit seiner eigenen Anmeldung, und dass jede Ausführung ohne den Befehlstext im Audit-Log landet. Dieselbe Befehlsform führt den Check einer Aufgabe auf ihrer Maschine aus, sodass Sie sehen können, ob die Tests eines Agents durchlaufen, ohne den Agenten zu fragen.
Bevor Sie einen Diff lesen, schauen Sie sich an, was der Agent gebaut hat. Da jede Maschine eigene Ports hat, kann jeder Agent denselben Dev-Server-Port verwenden, und Sie leiten jeden auf einen anderen Port Ihres Rechners weiter:
sandscale workspace port-forward agent-search 3001:3000 sandscale workspace port-forward agent-billing 3002:3000 Vollbildmodus öffnen Vollbildmodus beenden Die Weiterleitungen lauschen auf 127.0.0.1, bis Sie Ctrl+C drücken. Unser Beitrag zum Port-Forwarding eines Dev-Servers aus einem Workspace enthält die Details.
Um Code auf der Maschine eines Agents in Ihrem Editor zu lesen und zu bearbeiten, gibt sandscale workspace ssh-config agent-search einen Host-Block für ~/.ssh/config aus. Fügen Sie ihn einmal hinzu, und laut der Hilfe der CLI listen VS Code Remote-SSH und Cursor den Host auf. Der Block enthält keinen Schlüssel und kein Token; die CLI signiert jede Verbindung mit einem kurzlebigen Zertifikat.
Jeder Agent pushed seinen eigenen Branch und eröffnet einen Pull Request, daher ist das Review dasselbe wie bei menschlicher Arbeit: ein Pull Request nach dem anderen, mit dem Check der Aufgabe in CI. Mergen Sie zuerst diejenigen, die gemeinsamen Code berühren, und bitten Sie die übrigen Agents dann, in ihrem eigenen Workspace auf main zu rebasen, bevor Sie sie reviewen. Ein Rebase-Konflikt auf der Maschine eines Agents ist ein Problem, das der Agent löst, nicht Sie.
Wenn eine Aufgabe erledigt ist, stoppen Sie ihren Workspace:
sandscale workspace stop --ws-id WORKSPACE_ID Vollbildmodus öffnen Vollbildmodus beenden Die Festplatte bleibt erhalten, und die Rechenleistung wird nicht weiter genutzt. Ein laufender Workspace verbraucht die vCPU-Stunden Ihres Tarifs, egal ob der Agent arbeitet oder wartet. Stoppen Sie also diejenigen, die Sie nicht nutzen. Sie können beim Anlegen eines Workspaces auch eine Time-to-live setzen, wie in unserem Beitrag zu nächtlichen Agent-Läufen beschrieben.
Auf Pro und darüber übernimmt Agent Cloud das Starten und Einsammeln für Sie: Sie geben einem Agenten in einem Ihrer Workspaces eine Aufgabe, sehen ihm bei der Arbeit zu und bekommen einen Branch und einen Pull Request zurück. Ein Lead-Agent kann Aufgaben an andere Agents vergeben, diese verfolgen und die Pull Requests einsammeln. Jeder Schritt läuft über die Richtlinien und Freigaben Ihrer Organisation und landet im Audit-Log.
Der Sinn einer Maschine pro Agent ist, dass die Agents sich gegenseitig und Sie nicht mehr stören, sodass das Team so viele Agents betreiben kann, wie es reviewen kann, und mehr geschafft bekommt.
Für den Einstieg führt der Quickstart durch das Verbinden von Claude Code, Codex oder Cursor, und der Workspace-Guide behandelt Workspaces Schritt für Schritt.
Ursprünglich veröffentlicht im Sandscale-Blog.
Automatisch übersetzt. Das Original auf Englisch ist unten aufklappbar.
Original (Englisch) anzeigen
Posted on Nov 30 • Originally published at sandscale.dev
Running one coding agent is a conversation. Running five at once is closer to running a small team: the work has to be split so people do not edit the same lines, everyone needs somewhere to work, someone checks in on progress, and the results come back as changes you can review one at a time.
This post is about that second situation, for teams using Claude Code, Codex or Cursor. It covers how to split the work, why each agent should get its own machine, and the commands for checking on and reviewing several agents with the Sandscale CLI (version 1.4.1). It does not repeat the case against running agents on a laptop; our post on what laptop agents cost the team covers that.
Most failed parallel runs fail at the split, not at the machine. Two agents that both "clean up the API layer" will produce two branches that conflict everywhere, and someone spends the afternoon merging them.
Good tasks to run side by side share these properties:
A short task list in the repository, or in your issue tracker, with the owned paths and the check for each task, does more for a parallel run than any setting.
Separate clones or git worktrees on one computer solve the file problem. They do not solve the rest: the agents still share ports, CPU, memory, caches and the user account. Two dev servers want the same port, one agent's build slows another agent's tests into timeouts, and the agent reads that timeout as a real bug.
With a machine per agent, those problems are gone by construction. Sandscale gives each agent its own workspace: a persistent cloud computer on its own Firecracker microVM, with its own disk, ports, CPU and memory. The repository, branch, installed tools and the agent's session are still there the next time you open it.
sandscale workspace templates-list sandscale workspace create --name agent-search --template-id TEMPLATE_ID sandscale workspace create --name agent-billing --template-id TEMPLATE_ID sandscale workspace create --name agent-docs --template-id TEMPLATE_ID Enter fullscreen mode Exit fullscreen mode Name each workspace after its task, so the list reads like your task board. create asks you to confirm before it changes anything. sandscale workspace list shows all of them with their ids.
Connect to each one, clone the repository, check out the task's branch, and start the agent inside tmux so it keeps going when you disconnect:
sandscale workspace ssh agent-search tmux new -s run Enter fullscreen mode Exit fullscreen mode Give the agent the task, the paths it owns and the check that ends it. If your repository has an AGENTS.md, Claude Code, Codex and Cursor will all read it; our post on one AGENTS.md for agents on their own machines covers what to put in it. Detach with Ctrl-b d and move on to the next workspace.
An agent in a workspace needs network access to reach its model provider and your git host, so check what your plan and your organization's policy allow before you start.
You do not need to open a shell on each machine to see how it is going. workspace exec runs one command in a running workspace as you and returns its exit code, output and errors:
sandscale workspace exec --ws-id WORKSPACE_ID --command '["sh", "-c", "cd ~/app && git log --oneline -5 && git status --short"]' Enter fullscreen mode Exit fullscreen mode Run it against each workspace id from workspace list. It asks you to confirm each run, since it changes state on the machine. The CLI's help says only the workspace's owner can run commands this way, with their own sign-in, and that every run is audited without its command text. The same command form runs a task's check on its machine, so you can see whether an agent's tests pass without asking the agent.
Before you read a diff, look at what the agent built. Because every machine has its own ports, every agent can use the same dev server port, and you forward each one to a different port on your computer:
sandscale workspace port-forward agent-search 3001:3000 sandscale workspace port-forward agent-billing 3002:3000 Enter fullscreen mode Exit fullscreen mode The forwards listen on 127.0.0.1 until you press Ctrl+C. Our post on port-forwarding a dev server from a workspace has the details.
To read and edit code on an agent's machine in your editor, sandscale workspace ssh-config agent-search prints a Host block for ~/.ssh/config. Add it once, and the CLI's help says VS Code Remote-SSH and Cursor list the host. The block holds no key or token; the CLI signs each connection with a short-lived certificate.
Each agent pushes its own branch and opens a pull request, so review is the same as for a person's work: one pull request at a time, with the task's check in CI. Merge the ones that touch shared code first, then ask the remaining agents to rebase on main in their own workspace before you review them. A rebase conflict on an agent's machine is the agent's problem to solve, not yours.
When a task is done, stop its workspace:
sandscale workspace stop --ws-id WORKSPACE_ID Enter fullscreen mode Exit fullscreen mode Its disk is kept and its compute stops being used. A running workspace uses your plan's vCPU-hours whether the agent is busy or waiting, so stop the ones you are not using. You can also set a time to live when you create a workspace, as in our post on overnight agent runs.
On Pro and up, Agent Cloud does the start-and-collect part for you: you give a task to an agent in one of your workspaces, watch it work, and get a branch and a pull request back. A lead agent can hand out tasks to other agents, follow them, and collect the pull requests. Every step goes through your organization's policies and approvals and lands in the audit log.
The point of one machine per agent is that the agents stop interfering with each other and with you, so the team can run as many as it can review, and get more done.
To start, the Quickstart walks through connecting Claude Code, Codex or Cursor, and the workspace guide covers workspaces step by step.
Originally published on the Sandscale blog.