Loading video...

Video Failed to Load

Go Home

Cursor now natively supports git worktrees. You can run multiple agents in parallel, each with their own isolated copy of the codebase. This is great for comparing models or running the same model multiple times and picking the best result.

157,784 views • 1 year ago •via X (Twitter)

47 Comments

arun singh's profile picture
arun singh1 year ago

I think use cases are greatly exaggerated. It may be good for experimentation but for anything production you would not be validating multiple outputs. Worst you will find one model did something right and the other did something else right, you cant pick parts.

Lee Robinson's profile picture
Lee Robinson1 year ago

It's worked pretty well for us internally. I often find myself either choosing from the best run of a few agents, or pulling in one piece the others missed and merging them locally.

arun singh's profile picture
arun singh1 year ago

Ohhh man if merging was that easy, i hardly see code like that where you can just merge piece quickly. Great if its working for you.

Anthony Isaacson's profile picture
Anthony Isaacson1 year ago

this feature was kinda confusing I expected it to let me make a plan, then use multiple agents to execute parts of it repeating work with different models is more of a “test drive” vs daily driver scenario

Duncan's profile picture
Duncan1 year ago

been using it, works really well

Jeffrey Emanuel's profile picture
Jeffrey Emanuel1 year ago

I really think worktrees are a bad pattern and not worth the trouble. There are other, much better ways at getting multiple agents to work well together at the same time that don’t come with the overhead and reconciliation burden of worktrees.

Lee Robinson's profile picture
Lee Robinson1 year ago

If you prefer the alternative, which is running multiple agents in isolation in the cloud (virtual machines), that is a single dropdown away 😄

Jeffrey Emanuel's profile picture
Jeffrey Emanuel1 year ago

I prefer using my new tool, which also works with cursor, which handles the problem via agent direct communication and a system of file reservations:

Tom Bielecki's profile picture
Tom Bielecki1 year ago

@leerob This is an interesting comms/coordination paradigm between agents doing different tasks. But I wonder why we haven’t seen pair programming with different LLMs where they critique/review each other’s code at every step.

Jeffrey Emanuel's profile picture
Jeffrey Emanuel1 year ago

@leerob Yeah I agree that would be a useful workflow. I do mimic they with my agent mail system, it’s just not an explicit pairing up and it’s not in real time. I just periodically tell some of the agents to switch hats and start reviewing recent code from other agents.

Shrey Gupta's profile picture
Shrey Gupta1 year ago

i just tried this how can i open the worktree in the ide

Lee Robinson's profile picture
Lee Robinson1 year ago

For each run, you can click "apply changes"! You can also open terminals for each worktree if you want.

Shrey Gupta's profile picture
Shrey Gupta1 year ago

gotcha! cool the terminal helps so i can open cursor in another window but feel like there should be a simpler way if i'm already doing setup commands for new worktrees

COURT's profile picture
COURT1 year ago

Lee do you have something like Cursor.learn explaining worktrees? I use Git regularly but have never used worktrees. I find your style of teaching my favorite! ❤️

Lee Robinson's profile picture
Lee Robinson1 year ago

I'd like to make this!

Six's profile picture
Six1 year ago

this is great, especially as the models continue to progress and even specialize. To build on this, I'd love to have each permutation viewable in the browser so I can compare the results from a user's perspective. Thanks for continuing to make cursor an awesome tool!

Lee Robinson's profile picture
Lee Robinson1 year ago

This is doable, especially if you're using something like Next or Vite which have incrementing port numbers. You can open a terminal for each worktree and each has a unique port.

Six's profile picture
Six1 year ago

Ah, that makes sense, I'll have to give that a shot. Thanks Lee for the response, and for your great work on Cursor w/ the community.

Atlyr's profile picture
Atlyr1 year ago

Can I plan and give mutually exclusive work streams to different agents in parallel?

agusti's profile picture
agusti1 year ago

this is a fine idea but the execution feels … not there yet there should be a worktree tool the regular agent can call to reconcile and act as orchestrator/merger back otherwise you end up with 4 just slightly different implementations i literally told it to use the cli to

jason 💬's profile picture
jason 💬1 year ago

model cage matches just got way more organized, no more messy terminal brawls to pick the winner

justmakexmas's profile picture
justmakexmas1 year ago

this was what finally got me on ultra :<

Brian Rogers's profile picture
Brian Rogers1 year ago

Comparing between them is something I hope you enhance. + being able to dive into a specific worktree via the IDE view so that I can poke around!

mustafa başar's profile picture
mustafa başar1 year ago

Does it require extra payment?

CodingCoop's profile picture
CodingCoop1 year ago

Agreed. Just cannot wait until the file nav and git nav in agent UI supports work trees too! 😍

murad's profile picture
murad1 year ago

Clearly, git worktrees make experimenting with multiple agents way more manageable.

Rajesh Sharma's profile picture
Rajesh Sharma1 year ago

this is a good one how to leverage this for backend projects which use docker or docker compose... where running multiple containers on the same system may run into conflicts... i also hear about remote machine support too... any guidance

Arindam Majumder 𝕏's profile picture
Arindam Majumder 𝕏1 year ago

This is a Great Addition After using it on Claude code, I was thinking it would be cool to have it on IDEs as well And Cursor team might have listened that 👀

Kruxigt's profile picture
Kruxigt1 year ago

This is 5 months after AlchemyLab got worktrees natively by the way.

Rohit's profile picture
Rohit1 year ago

exactly what we wanted - you guys are killing it

arzafran's profile picture
arzafran1 year ago

what's the best resource on how to build agents you came through, things are changing so quick and drastically everything seems to be outdated the day it's off the press.

rohan's profile picture
rohan1 year ago

man i shouldve launched my tool i made for this like 3 months ago 💔

BEN SYNE's profile picture
BEN SYNE1 year ago

bless 🔥

zjy365's profile picture
zjy3651 year ago

Parallel testing made easy, saves so much time.

Hootan's profile picture
Hootan1 year ago

Does this help with working on a few work items in parallel?

@moudx👨🏻‍💻's profile picture
@moudx👨🏻‍💻1 year ago

Well this is great!

Dhyey Mavani's profile picture
Dhyey Mavani1 year ago

This is such a massive unlock. Gonna try tomorrow

Justin's profile picture
Justin1 year ago

next-level workflow

BenIt Pro Max Ultra's profile picture
BenIt Pro Max Ultra1 year ago

Cursor = SWE-AGI-1 basically, it's awesome!

pivot tables's profile picture
pivot tables1 year ago

Tried this and hated it. There’s no practical way to leverage this. It’s just performative so try hards can say “yeah I run 3-5 agents on all tasks and then pick the best one” It would be good for building MVP web apps, but anything in production is just silly

Andric's profile picture
Andric1 year ago

The workflow to verify the agent’s work in the worktree isn’t so clear however. Cursor adds a worktree in a special folder automatically but there doesn’t seem to be an easy way to switch to it as a branch to verify work in the browser on localhost.

Carlos Macias's profile picture
Carlos Macias1 year ago

I see this tool and just think about my account credit getting demolished 😅

David Kim 🌒's profile picture
David Kim 🌒1 year ago

Can I open new terminals to test for a native mobile app?

Casey Whalen's profile picture
Casey Whalen1 year ago

I love the concept of seeing what different models come up with.

Stefan Marsc's profile picture
Stefan Marsc1 year ago

each one with custom native browser?

Stefan Marsc's profile picture
Stefan Marsc1 year ago

Open Terminal means then I have to start app manually for each “agent” tree and then how to handle that the browser opens that agents preview when switching between them without like manually changing url each time to adjust port?

Andrey's profile picture
Andrey1 year ago

top notch feature

Related Videos

Claude Code has 3 models. Stop making Sonnet do Haiku’s job. Sonnet 5.5 builds. Haiku 5.5 scouts. Opus 5.5 reviews. Put them in parallel Git worktrees and let each model do what it’s best at. The setup: → Sonnet 5.5: Build features across isolated worktrees, writing code and running tests without touching your main branch. → Haiku 5.5: Explore the repo, index the AST, find dependencies, and scout for implementation paths while Sonnet codes. → Opus 5.5: Review architecture before implementation, investigate repeated test failures, and verify diffs before merging. Launch separate sessions: claude --worktree feat-auth claude -w feat-scout --model haiku Each session gets its own working directory and Git branch. Your agents can edit files and run tests in parallel without overwriting each other’s work. The full setup goes further: .worktreeinclude shares local configs across worktrees. Auto-cleanup keeps finished sessions tidy. Supervisor checkpoints catch contract drift and repeated test failures. A cwt alias makes launching new worktrees one command. Opus reviews the final diff before anything reaches main. The goal is simple: stop wasting expensive model calls on repo exploration, stop serializing work that can run in parallel, and stop merging code without a proper review. Paste the setup prompt into Claude Code. Ask it to show every config diff first, then approve the changes before anything gets edited. Build with Sonnet. Scout with Haiku. Review with Opus. Ship in parallel.

Arindam Majumder 𝕏

14,192 views • 28 days ago