What you need before coding agents can safely share a repository.
By Sumant Thakur
Published: 2026-09-30
URL: https://sumantthakur.substack.com/p/multi-agent-coding-workflow
Kiro Crew orchestrates Codex and OpenCode in isolated Git worktrees, followed by independent review, an evidence package, and human approval.
I used Kiro Crew to coordinate a small multi-agent coding experiment.
Codex and OpenCode received separate Java tasks inside isolated Git worktrees. Antigravity reviewed the resulting changes from an independent, read-only lane.
One agent implemented an EmailNormalizer. The other implemented a WordCounter.
Both changes passed their tests, and the review found no blocking issue.
Everything important appeared to have worked.
Yet I was not ready to call the workflow trustworthy.
Correct code was only one part of the result. The system also had to establish which agent acted, which model it used, what repository state it received, what it was allowed to modify, and what evidence existed before a human approved the change.
The Java methods were simple.
The surrounding protocol was not.
A few weeks ago, I wrote that AI coding is moving beyond the agent. The individual coding session is becoming a worker inside a larger development environment.
This experiment showed me what that environment actually requires.
Multi-agent coding is a distributed-systems problem
Once several coding agents operate concurrently, you no longer have a collection of smarter chat sessions.
You have workers that can fail, retry, stall, read stale state, or interfere with one another.
One task may finish while another remains blocked. A model may change without the task changing. The repository may advance while an agent continues reasoning over an older commit. Two agents may independently produce valid changes that become incompatible when combined.
These are familiar distributed-systems problems.
The agents are workers.
The orchestration layer is the control plane.
In this experiment, Kiro Crew played that control-plane role. It coordinated the coding lanes and the handoffs around them, while Codex and OpenCode remained the workers performing the implementation.
Git worktrees provided isolated state.
Locks and ownership rules limited concurrent access.
Tests and review produced evidence.
Human approval defined the boundary before a consequential transition.
Thinking this way changes how you design a multi-agent coding workflow.
You stop focusing only on whether an agent can write code. You start designing the system that determines where it works, what it can touch, how its actions are recorded, and when it must stop.
The model still matters. But the architecture surrounding the model determines whether its work can be trusted.
This is not an OpenCode-specific problem. The same control-plane requirements apply whether the worker is OpenCode, Claude Code, Codex, Cursor, or another coding agent.
I made the programming tasks deliberately boring
This was not intended to be a model benchmark.
I did not want a complicated algorithm, unfamiliar framework, or ambiguous requirement to explain the outcome. The implementation tasks were intentionally narrow so that failures in the surrounding workflow would be easier to see.
That proved useful.
When the code is simple, a broken workflow cannot hide behind the excuse that the model struggled with a difficult programming problem.
The experiment was testing whether several agents could behave like an engineering team rather than a collection of disconnected sessions.
That required more than assigning each agent a prompt.
Each agent needed a defined responsibility, an isolated workspace, a known runtime, a verification path, and a clear limit to its authority.
The code itself was the fastest part.
Establishing the boundaries around it took most of the effort.
The first meaningful failure was about identity
At one point, Kiro Crew began refusing worker operations with an identity_unattested condition.
Restarting the orchestrator resolved the immediate problem.
But the failure exposed an important distinction.
An agent can be available without being trusted. It can be authenticated to a model provider without having an identity the surrounding control plane is prepared to accept. It can have access to tools without having the authority to use them in the current workflow.
Availability, authentication, and attestation are different states.
That distinction becomes important as soon as an agent can modify files, run commands, or interact with external systems.
In a single-agent chat, saying “the agent changed the code” may feel specific enough.
In a multi-agent system, “the agent” is no longer a useful identity.
The execution record should connect a change to a particular agent instance, model configuration, tool set, starting state, and scope of authority.
Without that information, you may have working code, but you do not have reliable provenance.
This can feel excessive during a local experiment. Inside a team or production environment, it becomes basic operational hygiene.
You would not accept a deployment made by an unknown service account. Agentic development should not receive a weaker standard simply because the actor communicates through natural language.
Model selection is part of the runtime
We also had to verify that Codex and OpenCode were using the models we intended.
This is easy to overlook when you use one assistant through one interface. The model feels like an internal detail of the tool.
That assumption breaks when a workflow supports several providers, automatic routing, fallback behaviour, or different models for different roles.
The repository can remain unchanged.
The prompt can remain unchanged.
The orchestration code can remain unchanged.
A different model can still produce a materially different result.
Model selection therefore belongs in the execution record.
For exploratory work, allowing a tool to choose automatically may be reasonable. For repeatable engineering work, the model should be pinned or, at minimum, recorded.
The record should include the provider, model, relevant configuration, and any fallback that occurred.
You would not try to reproduce a build without knowing the compiler version or dependency set. The model is becoming another part of the development runtime.
Without recording it, you can reproduce the prompt but not the execution.
Parallel coding agents need isolated state
Each implementation lane operated inside a separate Git worktree.
That choice mattered more than any clever wording in the prompts.
Without isolated workspaces, two agents can edit the same files, reset each other’s changes, run tests against mixed state, or build on top of work that has not yet been reviewed.
The resulting repository may still compile.
That does not mean you can explain how it reached that state.
A worktree gave each lane a defined starting commit, its own filesystem, a separate branch, and a bounded diff.
The EmailNormalizer task belonged to one lane.
The WordCounter task belonged to another.
Each agent could progress without silently changing the state seen by the other.
This is ordinary concurrency control applied to AI workers.
Natural-language interfaces do not make race conditions disappear.
In some ways, non-deterministic workers make isolation even more important. A human developer may notice that someone else is changing the same area and stop to coordinate. An autonomous agent may interpret newly appearing files as valid context and continue working.
By the time a test fails, the original boundary between the changes may already be lost.
If you want coding agents to work in parallel, give them parallel workspaces.
A shared repository should not mean shared mutable state.
Repository rules should outlive the prompt
A persistent agent crew should not depend on a human restating the engineering process in every prompt.
A detailed prompt can guide one execution.
It is a weak place to store permanent policy.
Build commands, directory ownership, testing expectations, architectural constraints, and approval boundaries should live close to the code. Every agent should encounter those rules in a consistent form, regardless of which model or tool receives the task.
Otherwise, every session begins with policy reconstruction.
The human remembers some instructions and omits others. The wording changes. Context gets shortened. Different agents interpret the same rule differently.
That is not governance.
It is repetition.
In our broader setup, repository-native controls included explicit lane responsibilities, verification commands, ownership rules, readiness checks, and clear expectations about what counted as complete.
The exact mechanism may vary. It could be agent instruction files, CODEOWNERS, contribution guides, policy definitions, or machine-readable task contracts.
The principle remains the same:
The repository should carry not only the software, but also the rules for changing the software.
Those rules survive longer than a prompt, a chat session, or a particular model provider.
They also make agents easier to replace. When the operating contract lives in the repository, moving from one coding agent to another does not require rebuilding the entire process from memory.
Verification is evidence, not authority
Both Java implementations passed their tests.
That established something useful but narrow: the code satisfied the behavioural checks we had written.
It did not establish that the entire execution was trustworthy.
A green test cannot confirm that the intended model performed the task. It cannot prove that the agent started from the approved commit. It cannot show that another worker did not alter the workspace during verification.
It also cannot establish that the agent stayed within its assigned scope.
A passing test is evidence.
It is not permission.
That distinction matters when agents can do more than propose a patch. Merging a branch, deploying an application, or changing infrastructure carries a different level of consequence from editing a local file.
The useful output of an agent lane is therefore not just code.
It is an evidence package.
For a coding task, that package may contain:
-
The starting commit and resulting commit
-
The files changed and final diff
-
The tests and verification commands executed
-
The model and agent identity
-
Relevant tool activity
-
The independent review findings
-
Confirmation that the workspace ended in the expected state
The human does not need to manually reproduce every action.
But the human should receive enough evidence to approve the transition using judgment rather than trust.
This is where human-in-the-loop design is often misunderstood.
The goal is not to place a human inside every agent action. That would preserve control by removing most of the value of automation.
The better design places human authority at consequential boundaries.
Agents can plan, implement, test, and prepare the evidence. The system pauses before a change becomes difficult to reverse.
The reviewer needs different authority from the implementer
Antigravity reviewed the resulting changes from a separate, read-only lane.
The separation mattered.
A reviewer should inspect the implementation, compare it with the task, identify risks, and produce findings. It should not quietly become another implementer unless that transition is explicit.
When the same agent authors, modifies, verifies, and approves a change, the workflow may still produce good code.
But authorship and review have collapsed into one execution.
That makes the result harder to audit.
A separate reviewer creates a cleaner handoff. The coding agent produces the change and its supporting evidence. The reviewer evaluates both. The human receives the implementation and the critique as distinct inputs.
Human engineering teams already understand this separation.
The author may test the code, but an independent reviewer brings a different responsibility and perspective.
Agent teams need the same distinction, enforced through permissions and workflow boundaries rather than job titles.
The minimum operating contract for a coding crew
This experiment left me with six requirements for a trustworthy multi-agent coding workflow.
1. Attestable identity
Every material action should be connected to a known agent instance and execution context.
“The coding agent did it” is not a sufficient audit trail once several workers exist.
2. Isolated state
Parallel agents should not silently share mutable workspaces.
Each lane needs a defined starting point, bounded scope, and inspectable output.
3. Recorded model selection
The model is part of the runtime.
Pin it when repeatability matters. Record it even when automatic routing is allowed.
4. Repository-native rules
Engineering policy should survive beyond the prompt.
The repository must explain how both humans and agents are permitted to change it.
5. Independent verification
Tests, static checks, and review should produce evidence that can be examined separately from the agent’s own completion message.
A confident summary is not a substitute for a reproducible result.
6. Explicit approval boundaries
Agents should know where autonomous preparation ends and accountable authority begins.
The system must pause before consequential or difficult-to-reverse transitions.
None of these requirements makes a model better at implementing a Java method.
They make the resulting development system safer to operate.
That is the more important problem.
More agents do not automatically create a team
The experiment succeeded.
Kiro Crew coordinated the workflow.
Codex completed one implementation task.
OpenCode completed another.
Antigravity reviewed the results.
The tests passed, and the independent review found no blocking issue.
But the result did not come from putting several capable agents near the same repository.
It came from creating boundaries between them.
Each agent had a defined responsibility. Each implementation lane had isolated state. The selected models were verified. The repository carried the operating instructions. The reviewer had a separate role. The workflow stopped at the point where human authority was required.
That is what began to turn several tools into a crew.
As you add coding agents to your own development process, the most valuable improvement may not be another specialist model.
It may be the protocol surrounding the models you already use.
Before adding the next worker, make sure the system can reconstruct the actor, starting state, model, authority, and evidence behind every change.
When those details remain visible, agents become easier to trust, debug, and replace.
When they remain implicit, every additional agent increases both output and uncertainty.
The code was the easy part.
The protocol was the real system.
What broke first in your own multi-agent workflow?