正在加载视频...

视频加载失败

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 次观看 • 1 年前 •via X (Twitter)

47 条评论

arun singh 的头像
arun singh1 年前

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 的头像
Lee Robinson1 年前

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 的头像
arun singh1 年前

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 的头像
Anthony Isaacson1 年前

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 的头像
Duncan1 年前

been using it, works really well

Jeffrey Emanuel 的头像
Jeffrey Emanuel1 年前

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 的头像
Lee Robinson1 年前

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 的头像
Jeffrey Emanuel1 年前

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 的头像
Tom Bielecki1 年前

@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 的头像
Jeffrey Emanuel1 年前

@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 的头像
Shrey Gupta1 年前

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

Lee Robinson 的头像
Lee Robinson1 年前

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

Shrey Gupta 的头像
Shrey Gupta1 年前

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 的头像
COURT1 年前

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 的头像
Lee Robinson1 年前

I'd like to make this!

Six 的头像
Six1 年前

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 的头像
Lee Robinson1 年前

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 的头像
Six1 年前

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 的头像
Atlyr1 年前

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

agusti 的头像
agusti1 年前

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 💬 的头像
jason 💬1 年前

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

justmakexmas 的头像
justmakexmas1 年前

this was what finally got me on ultra :<

Brian Rogers 的头像
Brian Rogers1 年前

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 的头像
mustafa başar1 年前

Does it require extra payment?

CodingCoop 的头像
CodingCoop1 年前

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

murad 的头像
murad1 年前

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

Rajesh Sharma 的头像
Rajesh Sharma1 年前

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 𝕏 的头像
Arindam Majumder 𝕏1 年前

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 的头像
Kruxigt1 年前

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

Rohit 的头像
Rohit1 年前

exactly what we wanted - you guys are killing it

arzafran 的头像
arzafran1 年前

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 的头像
rohan1 年前

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

BEN SYNE 的头像
BEN SYNE1 年前

bless 🔥

zjy365 的头像
zjy3651 年前

Parallel testing made easy, saves so much time.

Hootan 的头像
Hootan1 年前

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

@moudx👨🏻‍💻 的头像
@moudx👨🏻‍💻1 年前

Well this is great!

Dhyey Mavani 的头像
Dhyey Mavani1 年前

This is such a massive unlock. Gonna try tomorrow

Justin 的头像
Justin1 年前

next-level workflow

BenIt Pro Max Ultra 的头像
BenIt Pro Max Ultra1 年前

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

pivot tables 的头像
pivot tables1 年前

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 的头像
Andric1 年前

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 的头像
Carlos Macias1 年前

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

David Kim 🌒 的头像
David Kim 🌒1 年前

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

Casey Whalen 的头像
Casey Whalen1 年前

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

Stefan Marsc 的头像
Stefan Marsc1 年前

each one with custom native browser?

Stefan Marsc 的头像
Stefan Marsc1 年前

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 的头像
Andrey1 年前

top notch feature

相关视频

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,267 次观看 • 1 个月前