I Had 4 Days to Tackle a 29-Page Issue Document. Here's How I Ran Parallel AI Agents with Git Worktrees A developer ran roughly 10 Git branches and multiple worktrees to parallelize several OpenCode AI coding agents against a 29-page requirements document containing more than 30 issues, finishing within a four-day deadline. The approach isolated each agent in its own worktree and branch, with tasks split by functional independence, code ownership and dependencies, and agent briefs written as implementation contracts with acceptance criteria. The developer framed it as a practical account rather than a benchmark, noting that isolation comes from explicit worktree assignment, not from running multiple sessions. Software development doesn't always come with comfortable timelines. Recently, I was handed a 29-page requirement document containing 30+ issues , ranging from existing bugs and functional problems to improvements and entirely new features. Handling everything sequentially with a single AI coding agent wasn't practical. Some tasks required investigating existing implementations, others involved changes across multiple modules, and a few required developing entirely new functionality. I needed a way to increase development throughput without turning the codebase into a collection of conflicting AI-generated changes. So, I experimented with running multiple AI coding agents in parallel using Git branches and worktrees . Across the workflow, I used approximately 10 branches, multiple Git worktrees, and several OpenCode sessions running parallelly. I also experimented with assigning the same feature to two different agents to compare their implementations. Here's how I approached task distribution, isolated agent environments, branch management, integration, and verification. This is a practical account of my experience, not a benchmark claiming that more agents automatically mean faster development. I used three primary components: It's important to understand how these components work together. A Git branch represents an independent line of development. A Git worktree provides a separate working directory associated with a branch. An AI agent performs the actual implementation inside that directory. Instead of making multiple agents work inside the same project directory, I could give each one its own workspace. One advantage of Git worktrees is that you don't need to clone the entire repository multiple times. You can create separate working directories directly from your existing repository: git worktree add ../project-task-a -b feature/task-a git worktree add ../project-task-b -b feature/task-b git worktree add ../project-task-c -b fix/task-c Each command creates a new branch and checks it out in a separate directory. You can verify your worktrees using: git worktree list Now, launch separate OpenCode sessions from each directory: cd ../project-task-a opencode Repeat this for the other worktrees. Each session now operates on its own working directory, branch, and uncommitted changes. One important distinction: Running multiple OpenCode sessions doesn't automatically isolate them. The isolation comes from explicitly assigning each session to a separate Git worktree. Creating multiple worktrees is relatively easy. Deciding what should run inside them is the more important engineering decision. Before assigning tasks, I considered three things: Functional independence: Can the task be implemented without waiting for another task? Code ownership: Which modules, directories, or files will the agent modify? Are multiple agents likely to touch the same files? Dependencies: Does the implementation depend on another feature, API contract, database schema, or shared component? For example, implementing a new backend API and building an unrelated frontend component can happen concurrently. However, if a frontend feature depends on an API that hasn't been defined yet, both implementations need coordination. I also treated agent instructions as implementation contracts rather than simple prompts. Each task brief needed to communicate the actual problem, expected behaviour, relevant modules, implementation boundaries, existing functionality that must remain unaffected, dependencies, and testing expectations. A vague instruction such as "fix the dashboard" leaves too much room for interpretation. A task with defined expected behaviour and acceptance criteria gives the agent a much clearer direction. The objective wasn't to maximize the number of running agents. It was to maximize independent execution while minimizing overlapping changes. One of the more interesting experiments involved assigning the same issue to two different AI coding agents. I had two approaches in mind, so instead of choosing one immediately, I assigned each approach to a separate agent. Both received the same requirement but worked independently in separate Git worktrees, exploring their respective approaches and producing different implementations. I deliberately didn't share one agent's implementation with the other. Why? I wanted to see how differently the same problem could be approached without one implementation influencing the other. Once both implementations were ready, I compared them based on: Rather than automatically choosing one agent's output, I reviewed both solutions and selected the approach better suited to the existing application. This gave me the opportunity to explore alternative solutions before committing to one implementation. The experiment looked like this: php flowchart TD A "Same Feature Requirement" -- B "Shared Task Brief" B -- C "Agent A" B -- D "Agent B" C -- E "Implementation A" D -- F "Implementation B" E -- G "Comparative Review" F -- G G -- H "Tests and Code Review" H -- I "Select Implementation" I -- J "Integration" However, this isn't something I'd recommend for every issue. Running two agents on the same task increases implementation and review effort. It's more useful for complex features or architectural decisions where comparing alternatives is worth the additional cost. In an ideal parallel development workflow, every task would have its own branch created directly from master . My actual Git history was more complicated. Only two lines of work started directly from master . Several other branches were created on top of existing feature branches. This resulted in a stacked branch structure. For example: master | +--- feature/base | +--- feature/extension-a | | | +--- feature/extension-b | +--- fix/integration Stacked branches are useful when one implementation depends on another. Instead of duplicating unfinished changes or waiting for everything to merge into master , a dependent branch can build on an existing implementation. However, this also introduces dependencies between branches. If an upstream branch changes, dependent branches may need to be rebased or updated. I also used git cherry-pick to selectively move commits between development branches: git cherry-pick