Multi-Agent Development: When Parallel Work Helps and How to Keep It Under Control


Greetings, traveler!

A navigation bug appears only when a user opens a deep link, quickly returns to the previous screen, and opens another item. The application combines SwiftUI screens, a UIKit navigation coordinator, and asynchronous data loading. Sometimes the second screen shows information from the first request.

One agent could trace the entire path. Another option is to ask separate agents to investigate navigation state, view lifetime, and asynchronous request handling. They can work at the same time, but their findings still have to be checked against the same running application. If each agent immediately edits the navigation layer, the investigation may end with several incompatible fixes and no clear explanation of the defect.

Before delegating, identify which work can proceed independently, what each agent needs to know, and who will combine the results.

Parallelism is a property of the task

Two tasks are good candidates for parallel work when each can make meaningful progress without waiting for the other or changing a resource the other needs. Investigating different causes of a bug often fits this description. So can implementing separate modules whose interfaces are already agreed upon.

Dependencies change the picture. If an API contract is still undecided, an agent building a client and another building its server may make different assumptions. Both can produce plausible code that fails at integration. In that case, settling the contract first and delegating implementation afterward can save work.

Some tasks are better divided by perspective than by component. During an incident, one agent might trace the lifetime of the affected screen, while another examines request cancellation and a third reconstructs the order of navigation events. They inspect overlapping code, but they are not competing to modify it.

A practical division also accounts for review and integration. If two branches each take ten minutes to produce but require an hour of reconciliation, the elapsed time of the individual tasks tells very little about the result. Parallelism is useful when the time or insight gained exceeds the cost of coordinating it.

Choosing between parallel and sequential delegation

Parallel agents explore or implement independent pieces at the same time. Sequential delegation passes an output from one step to the next. A developer might ask one agent to inspect a proposed change, then give a second agent the resulting requirements and implementation constraints. A reviewer can examine the finished patch afterward.

These patterns can be combined. Independent investigations can run in parallel, followed by a single implementation and a separate review. Likewise, two modules can be implemented concurrently once their shared interface has been settled, then tested together after integration.

A fresh agent can be useful for review because it may approach the change without the assumptions made during implementation. What a new agent inherits varies by tool and configuration: it may receive some conversation history, a summary, or only an explicit assignment. Provide the requirements, base revision, relevant diff, project constraints, and check results it needs. A reviewer who sees only the code may approve a clean implementation of the wrong behavior.

For a small change, an additional agent may add more overhead than value. A typo, a localized UI adjustment, or an already understood fix may only need a focused implementation and an appropriate check. Start with the complexity of the problem, not a fixed number of agents.

Give each agent a question it can answer

A broad instruction such as “investigate the navigation bug” can be useful for an independent second opinion. It becomes less useful when several agents are expected to cover different parts of the system and all receive the same open-ended task.

A delegation request should identify the behavior, the boundaries of the investigation, and the expected output. The agents also need to know whether they can edit files or run commands that change the environment. For the example above, one assignment might look like this:

Investigate whether a completed request can update a screen after the user
has navigated away and opened a different item.

Reproduction: open item A through a deep link, navigate back before its
request completes, then open item B. Item B sometimes displays A's data.

Inspect the view model, request ownership, cancellation, and the code that
applies responses. Do not edit project files or use production data.

Return:
- the relevant code locations;
- the event sequence supported by evidence;
- assumptions and competing explanations;
- a small experiment that could distinguish them.

Another agent can receive the same reproduction steps but focus on coordinator and navigation-stack behavior. A third can follow SwiftUI identity and view-model ownership. These are starting points, not rigid walls: if an investigator finds evidence outside its assigned area, it should report the connection.

Give every investigator a common baseline: the commit or branch being examined, the reproduction steps, relevant environment details, and known observations. Avoid leading them with an unverified diagnosis. An instruction such as “find the cancellation bug” can turn a question into a conclusion before the evidence is collected.

Separate observations from explanations

The results of independent analysis are most valuable when they can be compared. Ask agents to distinguish what they observed from what they infer.

For example, an investigator may report that a response handler writes to a shared property without checking which item produced the response. That is an observation supported by code. The claim that an old response caused the reported incident remains a hypothesis until the event order is reproduced or otherwise supported.

A compact record can contain:

  • the hypothesis and the behavior it would explain;
  • file locations, logs, or other supporting evidence;
  • assumptions that have not been checked;
  • a competing explanation;
  • an experiment that could disprove or strengthen the hypothesis.

The coordinator can then compare the reports instead of asking agents to vote. If two agents identify the same possible cause, that is a reason to inspect it, not proof that it is correct. They may have read the same misleading comment or relied on the same incomplete log.

Keep an investigation log

Once the initial reports are available, collect the unresolved questions in a short investigation log. Keep each original report separately so later discussion does not erase the investigators’ initial reasoning. The log belongs to the task and can be a document, an issue comment, or a file in an agreed location.

For each question, record the observations, the alternatives they leave open, and the next check. For example:

Question: Can an earlier response replace the current screen state?

Observations:
- The response handler updates a model that can outlive a selection.
- The handler does not associate its result with a request identifier.

Unresolved:
- Does the first task continue after the selection changes?
- Can its handler run after the second result has been applied?

Next check:
- In a test, control completion order and observe the model after each result.

These observations are illustrative and must be verified in the actual project. Assign one owner to update the log, or collect separate entries before combining them. Concurrent writes to the same file can lose information. Record the relevant code revision, mark disproved explanations as rejected, and revisit findings after the implementation changes.

One writer, multiple readers

For a defect that crosses navigation, screen state, and networking, a useful default is to let several agents investigate while one agent owns the implementation. Readers can inspect the same files without competing for the working tree. The writer receives the agreed constraints and makes one coherent change.

This is a coordination choice, not a limitation of multi-agent tools. Multiple agents can safely implement in parallel when their changes have clear boundaries. The distinction is whether the tasks are independent enough for separate implementations to converge without repeatedly changing the same assumptions.

Suppose one agent updates an API adapter and another builds a screen. Before they start, agree that the adapter returns an Item containing an identifier and title, and specify which error the screen should present when the item is unavailable. Assign changes to that shared interface to one owner. The agents can then work in separate files, but the integrated result still needs a test that exercises the adapter through the screen’s loading path and a review of the combined diff.

For a shared component, make ownership explicit. If an agent discovers that it must change a file assigned to someone else, it can report the required change rather than silently crossing the boundary. The coordinator can then reassign the work, settle the interface, or make the shared change separately.

Worktrees isolate files, not the whole environment

Git worktrees let multiple working directories share a repository while checking out different branches. They are useful when agents need to make independent changes without writing over one another’s files.

From a clean repository, a developer could record the base commit and create two branches from it. Run both commands in the original repository:

base_commit=$(git rev-parse HEAD)
git worktree add -b agent/api ../app-agent-api "$base_commit"
git worktree add -b agent/ui ../app-agent-ui "$base_commit"

Each agent works in its own directory and commits its own changes. By default, Git prevents the same branch from being checked out in multiple worktrees. The repository’s object database and many references are shared, so a worktree is not a separate security boundary or an independent repository. Avoid operations that unexpectedly rewrite shared branches, and inspect the working tree before creating or removing anything.

For Xcode builds, separate working directories are only the beginning. Use separate DerivedData locations when simultaneous builds could interfere with one another:

xcodebuild -scheme MyApp \
  -derivedDataPath /tmp/myapp-agent-api-derived \
  build

A second agent should use another path. The command is illustrative: a real project may also require a workspace, destination, signing configuration, and other options.

Simulators, ports, local databases, mock servers, package caches, and external test accounts can still be shared. Two agents resetting the same simulator or changing the same mock scenario can invalidate each other’s results even when their source files are isolated. Assign separate resources where practical, or serialize access. A worktree alone does not prevent an agent from accessing credentials or making network requests; permissions and sandboxing require their own controls.

When the work is ready, inspect each branch and integrate the changes using the team’s normal Git workflow. Run checks against the resulting combined state. A successful test on each separate branch does not demonstrate that the integrated application works.

Applying the approach to the navigation defect

Consider the earlier scenario in more detail. A deep link opens item A in a SwiftUI screen hosted by a UIKit navigation coordinator. The screen starts a request. Before it completes, the user returns and opens item B. On some runs, B displays A’s content.

The team gives three investigators the same reproduction and code revision. They work read-only during the first pass:

  1. The navigation investigator maps the coordinator’s push, pop, and screen replacement behavior.
  2. The SwiftUI investigator checks identity and ownership of the screen’s state and model.
  3. The concurrency investigator traces request creation, cancellation, and response handling.

Imagine that the first report finds that the coordinator correctly opens B, the second finds that the same model instance can remain in use across both selections, and the third finds that a response is applied without verifying its associated item. These findings form a plausible explanation, but they do not establish the order of events in a real run.

The next step is a controlled experiment. Replace the network dependency in a test with one that lets the test decide when each response completes. Start A, switch to B, complete B, and then complete A. Assert that the model continues to represent B. This test can establish whether the state layer accepts a stale response under that ordering. A separate integration or UI check is needed to establish whether the real navigation path creates the same sequence.

The implementation depends on the intended behavior and the existing architecture. Cancelling the old task may reduce unnecessary work, but cancellation is cooperative and a result may still arrive through a dependency that does not stop immediately. Associating each response with the active request and rejecting stale results can provide an additional state check. An item identifier alone is insufficient when two requests for the same item overlap: the older response can still arrive last. A unique request identifier or generation counter can distinguish those requests. Inspect where state belongs and choose the rule that matches the application’s intended behavior.

One agent implements the agreed fix. Another reviews whether the change preserves valid navigation and loading behavior. The final checks might include the controlled ordering test, tests for cancellation and errors where relevant, and a simulator run through the original path. Record the commands, outcomes, and environment. If the original intermittent failure cannot be reproduced, say so; a passing new test supports the tested ordering, not every possible cause of the incident.

Integrating findings without manufacturing consensus

Agents often produce different answers because they looked at different parts of the same system. They can also disagree because one missed a detail or both rely on incomplete information. Ask each investigator to identify which observation would change its conclusion, then run the smallest feasible experiment that distinguishes the alternatives.

If the available evidence cannot settle the issue, keep the uncertainty visible. An implementation can be deferred, narrowed, or accompanied by diagnostic instrumentation. A reviewer should know whether a change addresses a demonstrated cause or merely reduces exposure to a plausible failure mode.

Using different models or assigning different perspectives may broaden the search, but it does not make the results statistically independent. The agents may share training data, prompts, tools, and access to the same incomplete project. The engineer integrating their work remains responsible for checking the reasoning and deciding what evidence is sufficient.

Decide whether the extra agents paid off

Measure the complete task, from the initial request to an integrated and verified result. Useful observations include elapsed time, compute cost, human intervention, duplicated investigation, integration effort, and whether the final change satisfies the requirements. Note failures and inconclusive attempts as well as successes.

Compare approaches on similar tasks before making a process rule. Results vary with the task, model, tools, and the quality of the instructions. A complex, poorly understood defect may justify several independent investigations; a well-understood change with tightly coupled edits may not.

There is also a limit to how much parallel work a team can usefully review. Additional agents produce additional findings and diffs. If nobody has time to examine them, they can create a larger queue rather than a faster delivery. Set a clear scope and a stopping condition for each assignment, and leave room for the developer to understand the result.

Before adding another agent, identify the independent work it will take on and how its result will be checked. Afterward, compare the time and review effort for the complete, integrated task with the approach your team would otherwise have used.