<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Kishan</title>
    <description>The latest articles on DEV Community by Kishan (@kishanmn).</description>
    <link>https://dev.to/kishanmn</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4235280%2Fc39a6f64-5ef7-40d3-8da1-c5358593673f.png</url>
      <title>DEV Community: Kishan</title>
      <link>https://dev.to/kishanmn</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kishanmn"/>
    <language>en</language>
    <item>
      <title>I Had 4 Days to Tackle a 29-Page Issue Document. Here's How I Ran Parallel AI Agents with Git Worktrees</title>
      <dc:creator>Kishan</dc:creator>
      <pubDate>Wed, 18 Nov 2026 07:38:17 +0000</pubDate>
      <link>https://dev.to/kishanmn/i-had-4-days-to-tackle-a-29-page-issue-document-heres-how-i-ran-parallel-ai-agents-with-git-3a8l</link>
      <guid>https://dev.to/kishanmn/i-had-4-days-to-tackle-a-29-page-issue-document-heres-how-i-ran-parallel-ai-agents-with-git-3a8l</guid>
      <description>&lt;p&gt;Software development doesn't always come with comfortable timelines.&lt;/p&gt;

&lt;p&gt;Recently, I was handed a &lt;strong&gt;29-page requirement document containing 30+ issues&lt;/strong&gt;, ranging from existing bugs and functional problems to improvements and entirely new features.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;I needed a way to increase development throughput without turning the codebase into a collection of conflicting AI-generated changes.&lt;/p&gt;

&lt;p&gt;So, I experimented with &lt;strong&gt;running multiple AI coding agents in parallel using Git branches and worktrees&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;Here's how I approached task distribution, isolated agent environments, branch management, integration, and verification.&lt;/p&gt;

&lt;p&gt;This is a practical account of my experience, not a benchmark claiming that more agents automatically mean faster development.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The Architecture: OpenCode + Git Worktrees
&lt;/h2&gt;

&lt;p&gt;I used three primary components:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;OpenCode:&lt;/strong&gt; To run multiple AI coding sessions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Git branches:&lt;/strong&gt; To maintain independent development histories.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Git worktrees:&lt;/strong&gt; To provide separate working directories for different branches.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's important to understand how these components work together.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;Instead of making multiple agents work inside the same project directory, I could give each one its own workspace.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fp86vm9m3jk2xokb5zy3i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fp86vm9m3jk2xokb5zy3i.png" alt="Showing the example branching and procedure of work" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Setting up Git worktrees
&lt;/h3&gt;

&lt;p&gt;One advantage of Git worktrees is that you don't need to clone the entire repository multiple times.&lt;/p&gt;

&lt;p&gt;You can create separate working directories directly from your existing repository:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;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
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each command creates a new branch and checks it out in a separate directory.&lt;/p&gt;

&lt;p&gt;You can verify your worktrees using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git worktree list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, launch separate OpenCode sessions from each directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ../project-task-a
opencode
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Repeat this for the other worktrees.&lt;/p&gt;

&lt;p&gt;Each session now operates on its own working directory, branch, and uncommitted changes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One important distinction:&lt;/strong&gt; Running multiple OpenCode sessions doesn't automatically isolate them. The isolation comes from explicitly assigning each session to a separate Git worktree.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Task Decomposition: Not Everything Can Run in Parallel
&lt;/h2&gt;

&lt;p&gt;Creating multiple worktrees is relatively easy. Deciding what should run inside them is the more important engineering decision.&lt;/p&gt;

&lt;p&gt;Before assigning tasks, I considered three things:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Functional independence:&lt;/strong&gt; Can the task be implemented without waiting for another task?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code ownership:&lt;/strong&gt; Which modules, directories, or files will the agent modify? Are multiple agents likely to touch the same files?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dependencies:&lt;/strong&gt; Does the implementation depend on another feature, API contract, database schema, or shared component?&lt;/p&gt;

&lt;p&gt;For example, implementing a new backend API and building an unrelated frontend component can happen concurrently.&lt;/p&gt;

&lt;p&gt;However, if a frontend feature depends on an API that hasn't been defined yet, both implementations need coordination.&lt;/p&gt;

&lt;p&gt;I also treated agent instructions as implementation contracts rather than simple prompts.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;The objective wasn't to maximize the number of running agents. It was to maximize independent execution while minimizing overlapping changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Two Agents, One Issue: Comparing Different Approaches
&lt;/h2&gt;

&lt;p&gt;One of the more interesting experiments involved assigning the same issue to two different AI coding agents.&lt;/p&gt;

&lt;p&gt;I had two approaches in mind, so instead of choosing one immediately, I assigned each approach to a separate agent.&lt;/p&gt;

&lt;p&gt;Both received the same requirement but worked independently in separate Git worktrees, exploring their respective approaches and producing different implementations.&lt;/p&gt;

&lt;p&gt;I deliberately didn't share one agent's implementation with the other.&lt;/p&gt;

&lt;p&gt;Why?&lt;/p&gt;

&lt;p&gt;I wanted to see how differently the same problem could be approached without one implementation influencing the other.&lt;/p&gt;

&lt;p&gt;Once both implementations were ready, I compared them based on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Correctness:&lt;/strong&gt; Did the implementation satisfy the requirement, including edge cases?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Architectural compatibility:&lt;/strong&gt; Did it fit the existing application structure?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Maintainability:&lt;/strong&gt; Was the code understandable without unnecessary abstractions?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Testing:&lt;/strong&gt; Were there meaningful tests covering the expected behaviour?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Integration complexity:&lt;/strong&gt; How much additional work was required to introduce it into the existing codebase?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Rather than automatically choosing one agent's output, I reviewed both solutions and selected the approach better suited to the existing application.&lt;/p&gt;

&lt;p&gt;This gave me the opportunity to explore alternative solutions before committing to one implementation.&lt;/p&gt;

&lt;p&gt;The experiment looked like this:&lt;br&gt;
&lt;/p&gt;

&lt;pre data-lang="mermaid"&gt;&lt;code&gt;flowchart TD
    A["Same Feature Requirement"] --&amp;gt; B["Shared Task Brief"]
    B --&amp;gt; C["Agent A"]
    B --&amp;gt; D["Agent B"]
    C --&amp;gt; E["Implementation A"]
    D --&amp;gt; F["Implementation B"]
    E --&amp;gt; G["Comparative Review"]
    F --&amp;gt; G
    G --&amp;gt; H["Tests and Code Review"]
    H --&amp;gt; I["Select Implementation"]
    I --&amp;gt; J["Integration"]&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;However, this isn't something I'd recommend for every issue. Running two agents on the same task increases implementation and review effort.&lt;/p&gt;

&lt;p&gt;It's more useful for complex features or architectural decisions where comparing alternatives is worth the additional cost.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Branch Management: Stacking, Cherry-Picking and Integration
&lt;/h2&gt;

&lt;p&gt;In an ideal parallel development workflow, every task would have its own branch created directly from &lt;code&gt;master&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;My actual Git history was more complicated.&lt;/p&gt;

&lt;p&gt;Only two lines of work started directly from &lt;code&gt;master&lt;/code&gt;. Several other branches were created on top of existing feature branches.&lt;/p&gt;

&lt;p&gt;This resulted in a stacked branch structure.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;master
 |
 +--- feature/base
       |
       +--- feature/extension-a
       |      |
       |      +--- feature/extension-b
       |
       +--- fix/integration
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Stacked branches are useful when one implementation depends on another.&lt;/p&gt;

&lt;p&gt;Instead of duplicating unfinished changes or waiting for everything to merge into &lt;code&gt;master&lt;/code&gt;, a dependent branch can build on an existing implementation.&lt;/p&gt;

&lt;p&gt;However, this also introduces dependencies between branches. If an upstream branch changes, dependent branches may need to be rebased or updated.&lt;/p&gt;

&lt;p&gt;I also used &lt;code&gt;git cherry-pick&lt;/code&gt; to selectively move commits between development branches:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git cherry-pick &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;commit-hash&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Rather than merging every branch wholesale, I could select the commits that were actually useful and bring them into my integration branch.&lt;/p&gt;

&lt;p&gt;This gave me more control over what entered the final codebase.&lt;/p&gt;

&lt;p&gt;Out of all commits I authored during this period, around six were set aside or replaced. One documentation commit was dropped completely.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Parallel development doesn't mean accepting every agent's output. An implementation is a candidate, not an automatic contribution to the final codebase.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Integration: Where Things Get Interesting
&lt;/h2&gt;

&lt;p&gt;Worktrees solve the problem of multiple agents modifying the same local working directory. They don't eliminate integration conflicts.&lt;/p&gt;

&lt;p&gt;Two agents can independently modify different worktrees and still produce incompatible changes.&lt;/p&gt;

&lt;p&gt;For example, two features might modify the same API service, shared TypeScript interface, database model, application state, or common UI component.&lt;/p&gt;

&lt;p&gt;Their changes won't overwrite each other's local files, but they may conflict when combined.&lt;/p&gt;

&lt;p&gt;During integration, I encountered three merges that required conflict resolution. The largest conflict involved &lt;strong&gt;17 files&lt;/strong&gt;, because two competing implementations had modified several of the same areas.&lt;/p&gt;

&lt;p&gt;I used a combination of Git commands to understand and manage these changes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Inspect changes between branches:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git diff main...feature/task-a
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Understand the commit history:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git log --oneline --graph --all
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Check the working tree:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Integrate a branch:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git merge feature/task-a
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When conflicts occurred, I resolved them by understanding what each implementation was trying to achieve rather than blindly accepting one side.&lt;/p&gt;

&lt;p&gt;Git can identify conflicting changes, but it cannot determine which implementation is architecturally correct.&lt;/p&gt;

&lt;p&gt;That decision still requires engineering judgment.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Verification: Passing Individual Tests Isn't Enough
&lt;/h2&gt;

&lt;p&gt;One of the biggest mistakes in multi-agent development is assuming that if every agent reports successful implementation, the application is ready.&lt;/p&gt;

&lt;p&gt;An agent can successfully implement and test its own changes without guaranteeing that the combined application works.&lt;/p&gt;

&lt;p&gt;After integration, I still needed follow-up commits to fix TypeScript errors and update test snapshots.&lt;/p&gt;

&lt;p&gt;These fixes were completed within approximately half an hour of merging.&lt;/p&gt;

&lt;p&gt;The complete integration process, from creating the integration branch to pushing it, took roughly 40 minutes.&lt;/p&gt;

&lt;p&gt;After the fixes, the project's test run showed:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;th&gt;Count&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Passing tests&lt;/td&gt;
&lt;td&gt;~4,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Existing failures&lt;/td&gt;
&lt;td&gt;28&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The 28 failures were already present before this work.&lt;/p&gt;

&lt;p&gt;This is why having a known testing baseline matters. Without it, pre-existing failures can easily be mistaken for regressions introduced by new changes.&lt;/p&gt;

&lt;p&gt;My verification process involved reviewing the integrated Git diff, resolving implementation and type errors, checking test snapshots, running the project's test suite, and distinguishing existing failures from newly introduced issues.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Agent-level verification and system-level verification are two different things.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;An agent can verify its assigned task. The developer still needs to verify the application as a whole.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. What I'd Do Differently Next Time
&lt;/h2&gt;

&lt;p&gt;The workflow worked, but there are several things I'd approach differently in the next iteration.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Establish file ownership earlier.&lt;/strong&gt; Before launching agents, I'd define which modules and files each task is expected to modify. This would reduce overlapping changes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Define shared interfaces before implementation.&lt;/strong&gt; For tasks involving frontend, backend, and database changes, I'd establish API contracts and shared types before parallel execution.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Integrate incrementally.&lt;/strong&gt; Waiting until multiple implementations are complete increases integration complexity. I'd merge smaller changes more frequently and run regression tests after each meaningful integration.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Maintain a central task registry.&lt;/strong&gt; I'd maintain a single place containing task descriptions, branch names, worktree paths, dependencies, ownership, status, and verification results.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use competing implementations selectively.&lt;/strong&gt; Running two agents on the same issue was useful, but it also increased review and integration work. I'd reserve it for high-impact features.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Four days, a 29-page requirement document pushed me to experiment with a different approach to AI-assisted development.&lt;/p&gt;

&lt;p&gt;Using OpenCode sessions alongside Git branches and worktrees gave me a way to distribute implementation across independent environments while retaining control over integration.&lt;/p&gt;

&lt;p&gt;The two-agent experiment also showed me that parallel coding can be useful beyond implementation speed. It can help explore alternative solutions before committing to an architectural direction.&lt;/p&gt;

&lt;p&gt;But parallel execution doesn't eliminate engineering responsibility. It shifts where that responsibility sits.&lt;/p&gt;

&lt;p&gt;The agents can investigate, implement, and test. Someone still needs to decide how the work fits together, which implementation is worth keeping, and whether the final application actually works.&lt;/p&gt;

&lt;p&gt;If you're experimenting with multi-agent coding, I'd suggest starting with two or three independent tasks, giving each a separate worktree, defining clear boundaries, and integrating changes incrementally.&lt;/p&gt;

&lt;p&gt;Scale the number of agents only when your ability to coordinate and verify their output can keep up.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The next evolution of AI-assisted development isn't necessarily one agent that writes more code. It's a coordinated system of agents that can work independently without losing control of the engineering process.&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;This article documents one practical development experience, not a controlled performance benchmark. The numbers reflect my project and workflow and shouldn't be interpreted as guaranteed productivity improvements.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>git</category>
      <category>productivity</category>
      <category>softwaredevelopment</category>
    </item>
  </channel>
</rss>
