I'm Tony. I build and operate web products, and Claude Code is my main development tool every day. Assigning implementation, testing, and code review to different agents sounds like a natural way to get more work done. The difficulty appears when those agents touch the same files, make incompatible assumptions, or produce changes that nobody owns as a complete feature. You can end up spending more effort integrating their work than you saved by running them concurrently.
Parallel execution helps when the work can actually be separated. The important decisions happen before starting the agents: what each agent owns, what information it needs, which changes must happen in sequence, and who will integrate the results. I'll walk through a repeatable workflow using a fictional TypeScript monorepo, with practical task contracts, Git worktree isolation, review steps, and a way to compare parallel work against a sequential baseline. You'll leave with a small set of reusable templates and a process you can apply to your own repository.
Parallel work creates a coordination problem
A coding agent works from the instructions, repository state, and tools available to its session. When multiple agents work independently, each can produce a locally reasonable implementation without understanding the decisions made by the others. Two correct implementations can still be incompatible when they disagree about an API contract, shared type, or database behavior.
Consider a TypeScript monorepo containing four main areas:
.
├── apps/
│ ├── admin/ # Administration web app
│ └── api/ # Multi-tenant API
├── packages/
│ ├── ui/ # Shared components
│ └── shared/ # Types and utilities
├── pnpm-workspace.yaml
└── package.json
Suppose you need to implement CSV report exports for organization administrators. The feature includes an export endpoint, authorization, tenant-scoped queries, CSV generation, and an interface for downloading the result. Only authorized organization administrators can export reports, and every export must contain data belonging to the authenticated organization.
You could assign the API to Agent A, the frontend to Agent B, and testing to Agent C. But what happens when Agent A decides the endpoint returns a file stream while Agent B expects a JSON response containing a download URL? Agent C might write tests against an API contract that neither implementation follows.
The agents have completed their individual tasks, but the feature is not integrated. More independent execution has created more decisions that must be reconciled.
The distinction I use is simple: independent tasks can run in parallel, but shared decisions need one owner. That owner does not have to write every line of code. The owner must establish the decisions that other agents depend on and make sure the final implementation follows them.
Decide whether the work is actually parallelizable
Before assigning agents, I break the feature into tasks and identify their dependencies. The goal is not to distribute work evenly. It's to find tasks that can finish independently without repeatedly changing each other's assumptions.
For the report export feature, an initial decomposition might look like this:
| Task | Main scope | Dependency |
|---|---|---|
| Define export API contract | API request and response | None |
| Implement export endpoint | apps/api |
Approved API contract |
| Build export UI | apps/admin |
Approved API contract |
| Implement API security tests | API test files | Endpoint behavior |
| Verify complete workflow | Integrated application | API and UI completed |
The frontend and backend can progress independently after the API contract is approved. Before that decision, running both agents increases the chance of incompatible implementations.
I check four conditions before parallelizing:
- Dependencies: Can the task start without waiting for another task's decisions?
- Shared state: Will agents modify the same files, schemas, configuration, or external resources?
- File ownership: Can each task have a clear scope with minimal overlap?
- Coordination cost: Is the work substantial enough to justify separate instructions, review, and integration?
File separation is useful, but it doesn't guarantee independence. Two agents working in different directories can still disagree on shared behavior. For example, changing the API authorization contract affects the frontend even if the files never overlap.
A task dependency graph makes those relationships visible. I mark decisions that must happen first, identify independent branches of work, and reserve the integration phase for checking how those branches interact. My rule is to parallelize implementation after stabilizing the necessary interfaces, not to parallelize unresolved architectural decisions.
Give each agent an explicit work contract
A prompt such as "implement the frontend while another agent handles the backend" leaves too much room for interpretation. It doesn't establish the expected API, which files can change, or what counts as complete.
I use a work contract that makes those responsibilities explicit. Each agent receives a self-contained description rather than depending on information buried in another conversation.
Claude Code subagents have their own context windows and return summaries to the main conversation. They don't inherit the main conversation history or its automatic memory. For exploration tasks, I provide the relevant system constraints directly instead of assuming the subagent already knows them.
For implementation, a work contract can look like this:
# Agent B: Report export UI
## Objective
Implement the report export action in apps/admin.
## Inputs
Approved API contract:
- Method: GET
- Route: /reports/export
- Response: text/csv
- Authentication: existing session
- Authorization: enforced by API
## Ownership
Allowed:
- apps/admin report UI
- Related frontend tests
Do not modify:
- apps/api
- packages/shared
- packages/ui
## Constraints
- Use existing application conventions.
- Do not create a new API response format.
- Do not change role definitions.
- Do not introduce dependencies without approval.
## Expected output
- Export action for authorized admins
- Download handling
- Loading and error states
- Relevant frontend tests
## Completion evidence
Report:
- Files changed
- Commands executed
- Test results
- Unverified behavior
- Assumptions requiring confirmation
Stop if the approved API contract
cannot support the implementation.
The restrictions matter as much as the objective. Without them, an agent encountering a missing shared type might modify packages/shared while another agent is changing the same package.
I keep stable repository conventions in CLAUDE.md, while the work contract captures decisions specific to the task. The article on CLAUDE.md and Skills in this series covers that distinction in more detail.
The contract also defines when an agent must stop. If completing the task requires changing an approved interface or another agent's files, that is a coordination issue, not permission to silently expand the scope.
For exploration, I can delegate narrower questions to a subagent:
Use a subagent to investigate how
apps/api enforces tenant isolation
for report queries.
Do not modify files.
Return:
- Relevant file paths
- Existing authorization checks
- Tenant-scoping mechanism
- Related tests
- Confirmed findings
- Unresolved questions
This is particularly useful for noisy investigation because the main session receives a focused summary rather than the full exploration context.
Isolate changes where necessary
Clear ownership reduces conflicts, but isolation provides another layer of protection. If two implementation agents use the same working directory, one agent can encounter partially edited files from the other. Tests can also observe intermediate changes that don't belong to the task being verified.
Git worktrees let me give implementation sessions separate working environments while keeping them associated with the same repository. Claude Code supports starting a session in its own worktree:
claude --worktree report-api
A second session can use another worktree:
claude --worktree report-ui
Each starts in a separate Git worktree on its own branch. The repository must have at least one commit before this works. I use separate terminal sessions for the two commands, and each agent receives its assigned work contract.
The worktree boundary protects the files in each checkout from concurrent editing. It does not automatically prevent semantic conflicts between branches, shared service interference, or incompatible assumptions.
For example, both worktrees might use the same development database. If test suites reset that database while running concurrently, test failures can appear unrelated to either code change. Separate working directories do not isolate every external dependency.
I handle this by specifying which resources each task can use. If reliable test isolation is unavailable, I serialize the tests even when implementation proceeds concurrently. An important distinction: a worktree is an isolation mechanism, not an integration strategy. Before starting parallel implementation, I also make sure the base branch has a known state and that each agent understands which branch its work will eventually join.
Define the integration owner before starting
The most important role in a parallel workflow is often the one that doesn't write the most code. I assign one integration owner before any implementation begins. In a small project, that owner is me, supported by a coding agent for review and investigation. The role is responsible for maintaining the approved feature contract, accepting or rejecting individual changes, and verifying the combined result.
The integration owner needs to answer five questions:
- Does each implementation satisfy its assigned contract?
- Does the change remain within its ownership boundary?
- Are the implementations compatible with one another?
- Do the combined changes meet the original acceptance criteria?
- What evidence supports that conclusion?
For the report export feature, the original acceptance criteria might be:
| Criterion | Required evidence |
|---|---|
| Authorized admin can export | Successful API test |
| Unauthorized user cannot export | Authorization test |
| Tenant A cannot export Tenant B data | Cross-tenant integration test |
| CSV handles special characters | CSV content tests |
| UI downloads the result | Browser verification |
| Existing permissions remain unchanged | Regression tests |
I review each branch separately before integration. The goal is to avoid combining unexplained changes and then debugging the entire result as one large problem.
A practical Git review begins with the branch diff:
git diff main...report-api
After accepting the API implementation, I merge it into the integration branch, resolve any conflicts, and run the relevant checks. Only then do I integrate the frontend branch.
git switch integration/report-export
git merge report-api
pnpm -F api test
git merge report-ui
git diff main...HEAD
These commands assume you've created the integration branch and are using the indicated branch names. The exact branch names and verification commands should match your repository.
Merging one branch at a time helps identify which change introduced a problem. If the API passes its checks before the UI integration but fails afterward, I have a narrower area to investigate.
I don't treat an agent's statement that its tests passed as final verification. I inspect the diff and rerun the relevant tests in the integration environment.
This is where the earlier article on trusting code you didn't write in this series connects directly to multi-agent development. Adding agents doesn't reduce the need for evidence. It increases the number of independent outputs that need to be verified.
Handle conflicts and failed work without hiding them
Parallel workflows become difficult when agents try to resolve conflicts by making unilateral changes outside their contracts. Suppose the frontend agent expects the response to contain a downloadUrl, while the API agent implements a streaming CSV response. One agent might update the shared contract to match its implementation. The other might add an adapter that conceals the mismatch.
Both changes can appear reasonable locally while making the integrated system unnecessarily complex. When I find conflicting implementations, I return to the approved contract. I identify which branch diverged, whether the contract itself needs revision, and what the smallest correction should be.
I don't ask another agent to "make everything work" without explaining the conflict. That instruction transfers the unresolved decision to a new agent.
I use a structured review prompt:
Review these two implementations
against the approved export contract.
Do not modify files.
Identify:
1. Contract violations
2. Conflicting assumptions
3. Changes outside file ownership
4. Missing test evidence
5. Potential regressions
For every finding, include:
- Affected files
- Expected behavior
- Actual implementation
- Recommended correction
Separate confirmed conflicts from
potential risks.
Missing evidence is another type of incomplete work. If an agent reports that tenant isolation is correct but cannot identify the test that verifies it, I mark the criterion as unverified.
A task can also fail because its assumptions were wrong. For example, the API might not support incremental CSV generation through the expected query mechanism. The agent should report that limitation instead of silently changing the architecture.
I keep three states distinct:
- Accepted: Implementation reviewed, required evidence present.
- Needs correction: Known conflict or failing verification.
- Incomplete: Missing implementation, decision, or evidence.
These states make handoffs explicit. They also prevent incomplete work from being mistaken for finished work simply because an agent stopped responding.
Compare parallel execution with a sequential baseline
Running three agents does not imply a threefold reduction in completion time. The actual workflow includes planning, agent setup, implementation, review, conflict resolution, integration, and verification.
To evaluate whether parallel work helps, I compare it with a sequential run of the same representative task. Both runs need the same starting commit, acceptance criteria, and verification requirements.
I separate the work into measurable phases rather than comparing only code generation.
| Phase | Sequential | Parallel |
|---|---|---|
| Explore and plan | One task plan | Dependency and ownership plan |
| Implement | Tasks executed in order | Independent tasks overlap |
| Review | Review after each task | Review each branch |
| Integrate | Continuous shared state | Explicit branch integration |
| Verify | Final checks | Final integrated checks |
| Rework | Record corrections | Record conflicts and corrections |
A useful experiment requires two independent runs from identical starting snapshots. For the fictional monorepo, the representative task is the same CSV report export feature.
I would run the sequential implementation with one agent, then repeat from a clean starting point with separate API and UI agents. Both workflows must complete the same acceptance tests before I consider them comparable.
A simple measurement log is sufficient:
# Execution comparison
Task: Organization report export
Base commit: <commit SHA>
## Sequential
Started:
Completed:
Implementation elapsed:
Review elapsed:
Integration elapsed:
Verification elapsed:
Total elapsed:
Failed tests:
Rework required:
Final verification:
## Parallel
Started:
Completed:
Number of agents:
Agent setup elapsed:
Implementation wall time:
Review elapsed:
Integration elapsed:
Verification elapsed:
Total elapsed:
Conflicts:
Failed tests:
Rework required:
Final verification:
I would record elapsed time using shell timing or timestamps captured during execution. The comparison should also record human intervention, failed test runs, and unresolved work.
There are no measured results to report for this fictional example. Presenting a speedup percentage without executing both workflows would say nothing reliable about the coordination cost.
The important metric is completion of verified work, not the number of simultaneously active agents. A workflow that finishes implementation quickly but requires extensive manual repair during integration has not necessarily improved productivity.
For an actual repository, I also compare the final diffs. Two implementations can satisfy the same acceptance criteria while differing substantially in complexity, maintainability, and operational impact.
Know when one agent is the better choice
I don't use multiple agents simply because multiple sessions are available. Some tasks have dependencies so tight that parallel execution adds coordination without creating useful independence.
A focused authorization change is a good example. If the task requires tracing one request through middleware, session context, tenant resolution, and a database query, splitting those layers between agents can fragment the understanding required to make a safe change.
One agent working sequentially can maintain that context while implementing and verifying the correction. I generally keep work sequential when:
- The change is small enough for one focused implementation.
- Several tasks must edit the same file or shared contract.
- The architecture remains unresolved.
- Each task depends on decisions from the previous task.
- Shared test environments cannot be isolated.
- Review and integration would dominate the implementation effort.
Parallelism is more useful when tasks have stable boundaries, substantial independent work, and clear completion evidence. Even then, I keep the number of agents tied to the available independent tasks. Claude Code agent teams give each teammate its own context window, and spawn prompts contribute to that context from the beginning. Keeping teams small and shutting down teammates after their work is complete reduces unnecessary coordination.
I also use planning before dispatching implementation work. Claude Code provides Plan mode:
claude --permission-mode plan
You can also enter Plan mode with Shift+Tab. For a multi-agent task, I use that stage to identify dependencies, confirm the interface decisions, and prepare the individual contracts before implementation begins.
The earlier articles on context and memory, permissions and MCP, and Playwright browser testing in this series address different parts of the same problem. Parallel work depends on agents receiving the right information, operating within defined permissions, and producing results that can be independently checked.
A reusable parallel-agent workflow
I keep a small workflow directory that can be copied into a project. It holds task boundaries, work contracts, an integration checklist, and the final verification report.
parallel-agent-workflow/
├── task-decomposition.md
├── agent-work-contract.md
├── integration-checklist.md
├── verification-report.md
└── sample-task/
└── report-export.md
The first file records dependencies and ownership:
# task-decomposition.md
Feature:
Base commit:
Integration owner:
## Tasks
| ID | Owner | File scope | Depends on |
|----|-------|------------|------------|
| A | API agent | apps/api | Contract |
| B | UI agent | apps/admin | Contract |
## Shared decisions
- API request and response
- Authorization rules
- Tenant isolation requirements
## Integration order
1. API branch
2. UI branch
3. Combined verification
Each agent receives a copy of agent-work-contract.md, filled with its objective, approved inputs, ownership boundaries, constraints, expected outputs, and required evidence. The UI contract earlier in this article is a complete example.
The integration checklist stays with the integration owner:
# integration-checklist.md
- [ ] Shared contracts approved
- [ ] Agent ownership documented
- [ ] Each diff reviewed separately
- [ ] Out-of-scope changes explained
- [ ] Conflicts resolved explicitly
- [ ] Branches merged one at a time
- [ ] Focused tests rerun
- [ ] Full relevant tests rerun
- [ ] Security criteria verified
- [ ] Browser behavior checked
- [ ] Remaining gaps documented
The verification report links each acceptance criterion to evidence rather than relying on a general statement that the feature works.
# verification-report.md
Base commit:
Integrated commit:
Reviewer:
| Criterion | Evidence | Result |
|-----------|----------|--------|
| Authorized export | Test reference | Pending |
| Rejected access | Test reference | Pending |
| Tenant isolation | Test reference | Pending |
| CSV correctness | Test reference | Pending |
| UI download | Browser result | Pending |
## Commands executed
Command:
Result:
## Conflicts resolved
## Known limitations
## Final decision
Accepted / Needs correction / Incomplete
For the reproducible sample task, sample-task/report-export.md describes the objective, repository structure, approved CSV response contract, tenant isolation requirements, acceptance criteria, and baseline commit. The execution procedure is straightforward: start from that commit, run the sequential implementation, capture its verification report, reset to the same commit, and run the API and UI implementations in separate worktrees. Review each branch, integrate them individually, run the same verification suite, and compare the complete execution records.
You can use claude --continue or claude --resume to return to existing sessions when necessary. The work contracts and verification report remain the durable record of decisions and evidence, regardless of which session produced the changes.
The templates are intentionally small. Their purpose is to make responsibility visible, not to create another documentation system that requires more work than the feature itself.
Parallelism should follow the structure of the work
The benefit of multiple coding agents comes from executing genuinely independent work concurrently. It doesn't come from dividing every feature into as many tasks as possible.
I start by identifying shared decisions and dependencies, then assign bounded implementation work. I isolate changes when necessary, review each result separately, and keep one integration owner responsible for the complete feature. If the work cannot be divided without repeated coordination, I use one agent. The final standard stays the same whether one agent or several produce the code: the implementation must be understandable, maintainable, and supported by verification evidence.
When you run multiple coding agents, what usually becomes the bottleneck: task planning, conflicting changes, review, or integration?



Top comments (2)
For us the bottleneck was always the shared decisions, which is why Halfcycle settles them first. The architect fixes the contracts and a person signs them off before the engineer agents build in parallel, and reviewers that didn't write the code check where the pieces meet. It does the job of your contracts and checklist without the templates to maintain. Try npx halfcycle on a feature like the CSV export and compare it with your sequential baseline.
branch each worktree off origin/main, not your local main. ours came off the primary checkout's main, which nothing ever pulled, so on most of our machines new agent work started 7 to 21 days behind