Video yükleniyor...
Video Yüklenemedi
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 görüntüleme • 1 yıl önce •via X (Twitter)
47 Yorum

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.

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.

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.

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

been using it, works really well

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.

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

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:

@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.

@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.

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

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

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

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! ❤️

I'd like to make this!

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!

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.

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.

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

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

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

this was what finally got me on ultra :<

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!

Does it require extra payment?

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

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

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

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 👀

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

exactly what we wanted - you guys are killing it

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.

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

bless 🔥

Parallel testing made easy, saves so much time.

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

Well this is great!

This is such a massive unlock. Gonna try tomorrow

next-level workflow

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

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

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.

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

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

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

each one with custom native browser?

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?

top notch feature



