🤖 Parallel AI Development with Cursor and Git Worktrees
on February 15, 2026
In this article, I want to show a concrete example of how to parallelize development using Cursor, Git worktrees, and a real Symfony bundle:
👉 https://github.com/darkwood-com/ia-exception-bundle
The goal is simple: improve the bundle by working on two independent features at the same time without conflicts using AI agents.
Context
I’m currently working on a Symfony bundle called:
Darkwood IA Exception Bundle Repository: https://github.com/darkwood-com/ia-exception-bundle
Its purpose is to enhance Symfony exceptions using AI:
when a 500 occurs, the bundle analyzes the exception and generates structured diagnostics (probable causes, suggested fixes, confidence score, etc.).
However, while working on it locally, I identified two improvements.
🟥 Issue 1 Improve the error icon
The current icon is a standard Bootstrap “danger” icon. It works, but it does not visually communicate that the exception is AI-augmented.
The idea: Replace it with a more appropriate AI-themed danger icon.
🟦 Issue 2 Render AI analysis asynchronously
Currently:
- An exception occurs.
- The AI call is triggered.
- The HTTP response waits for the AI.
- The full page is rendered only once the AI finishes.
This introduces latency.
Instead, we want:
- Immediate exception rendering.
- AI analysis loaded asynchronously.
- The page updated once the AI response arrives.
For this, we use Symfony UX.
The Challenge
How can we work on both issues in parallel using Cursor without creating file conflicts?
The answer comes from an idea popularized in recent articles about AI coding agents:
Use Git worktrees for context isolation.
Git Worktrees Quick Reminder
A Git worktree allows you to create a new working directory attached to the same repository.
It’s not a full clone.
It shares the Git history but lives in a separate physical directory.
Example:
git worktree add ../feature-ai-icon feature/ai-icon
git worktree add ../feature-async-render feature/async-render
Now you have:
- Main repo
- Worktree A → Feature 1
- Worktree B → Feature 2
Each can evolve independently.
No file conflicts. No context pollution.
Why This Matters for AI Agents
With Cursor, you can assign an AI agent to each worktree.
Agent 1 works only inside:
feature/ai-icon
Agent 2 works only inside:
feature/async-render
Each agent operates in isolation.
This is what we call:
Context isolation
And it’s essential when parallelizing AI-driven development.
Practical Implementation
Step 1 Create Two Worktrees
I manually created two worktrees corresponding to the two issues.
Then, for each worktree, I:
- Opened it in Cursor
- Pasted the GitHub issue description
- Let the AI agent implement the feature
Step 2 Async Exception Rendering
For the asynchronous feature, the AI implemented:
- A dedicated route loader
- An
IAExceptionController - A context storage system
- A service for deferred AI analysis
- Conditional behavior when async mode is enabled
Now the workflow is:
- Exception renders instantly.
- Symfony UX loads AI analysis asynchronously.
- The page updates dynamically once the AI response arrives.
This significantly improves perceived performance.
Step 3 Icon Improvement
In the second worktree, the agent:
- Replaced the Bootstrap danger icon
- Introduced a cleaner AI-themed SVG
- Maintained layout compatibility
- Preserved Bootstrap styling
This was completely independent from the async feature.
No overlapping code.
Switching Between Features
Because these are worktrees, switching context is easy.
In my local Darkwood app:
- The bundle is normally loaded via Composer.
- I temporarily linked the bundle to the corresponding worktree.
- Cleared cache.
- Triggered a controlled exception.
Then I could test each feature independently.
Switching from Feature A to Feature B required only:
- Switching the symbolic link
- Clearing cache
- Refreshing
No merge. No rebase. No conflicts.
What We Achieved
We now have:
- Two independent pull requests
- Two isolated AI agents
- No file conflicts
- Clean separation of concerns
These changes were released in:
👉 v1.0.2 https://github.com/darkwood-com/ia-exception-bundle/releases/tag/v1.0.2
This release introduces:
- UI improvements for AI exception rendering
- Asynchronous AI analysis loading
- Improved architectural separation for future enhancements
When Does This Break?
Parallel development works best when issues are:
- Clearly separated
- Targeting different layers
- Not modifying the same files
If two issues modify:
- The same service
- The same Twig template
- The same controller
You will face merge conflicts later.
Parallel AI development requires proper task decomposition.
Production Considerations
If you push multiple branches:
- You may face port conflicts locally.
- Preview environments may require configuration.
- Async features may require context persistence.
These are manageable but must be considered.
Why This Is Powerful
The real value is not the AI model.
It’s:
- Isolation
- Orchestration
- Context control
Git worktrees allow us to scale AI coding sessions without chaos.
Conclusion
Parallel AI development is not about running more models.
It’s about isolating context properly.
With:
- Git worktrees
- Cursor agents
- Symfony UX
- Clean issue decomposition
You can safely evolve complex systems without stepping on your own changes.
References
-
Repository IA Exception Bundle https://github.com/darkwood-com/ia-exception-bundle
-
Release v1.0.2 https://github.com/darkwood-com/ia-exception-bundle/releases/tag/v1.0.2
-
Git Worktrees for Parallel AI Coding Agents Upsun https://devcenter.upsun.com/posts/git-worktrees-for-parallel-ai-coding-agents/
-
Git Worktrees: The Power Behind Cursor’s Parallel Agents DEV.to https://dev.to/arifszn/git-worktrees-the-power-behind-cursors-parallel-agents-19j1
-
Cursor Documentation Worktrees Configuration https://cursor.com/fr/docs/configuration/worktrees