When does the need show up? (the exact moment)
The moment arrives when your project grows and a single AI, doing one thing at a time, isn't enough anymore. You want to move faster: while one session builds a feature, another fixes a bug and a third tries out a new idea — all at once. It also shows up when you're torn between two paths ("should I do it this way or that way?") and want to see both before deciding. Or when you want to try something risky without touching what already works. In every one of those cases, going one thing at a time on your single version is slow and fragile.
What is a "worktree"? (in plain terms)
In the GitHub guide you saw branches: parallel copies of your project. A worktree takes that one step further: it lets you have several of those branches open and live at the same time, each in its own folder, without one touching the other. While one AI works on "idea A", another can be on "idea B", and your main version stays untouched. It's not one at a time — it's all of them at once.
The superpower · one branch per idea, with Claude in VS Code
Claude Code has an official VS Code extension (it also works in Cursor and compatible editors). From there you open several AI sessions in parallel, each in its own worktree, and you see the changes it proposes with a visual diff (side by side) that you approve or reject. Best of all: creating an isolated worktree is a single command.
claude --worktree mi-idea-arriesgada
That creates an isolated copy of your project (at .claude/worktrees/mi-idea-arriesgada/) on a new branch, without touching your main version. You work the idea there; if it works out, you merge it in; if not, you delete it and nothing happened. You can open another session with claude --worktree otra-idea and have the two competing at the same time.
3 scenarios where this saves you
This is how we work · several sessions at once (the big accelerator)
This is the biggest benefit, and it's exactly how we build: instead of a single AI advancing single-file, we have several sessions working in parallel, each in its own worktree. Session 1 builds one part of the product, session 2 puts together something else, and a session 3 could be trying out a new idea — the three advancing AT THE SAME TIME, without stepping on each other. It's like having three employees instead of one, each at their own desk, out of each other's way.
The visual review · you approve or reject, you're in charge
Inside VS Code, when the AI wants to change a file, it shows you a side-by-side comparison: what was there vs. what it's proposing. You decide: accept, reject, or tell it what to change. Nothing gets modified behind your back. It's like having your employee show you every change before applying it, instead of touching everything and letting you find out afterward.
The golden routine · move in parallel without chaos
- One session = one branch/worktree: each work front in its own isolated copy. Never several on the main version.
- Push to YOUR branch, never to the main one: each session saves to its own; the main one only receives via merge.
- Audit with C-A-R before merging: no branch enters the main one without passing its audit/debug first.
- Review the diff in VS Code before accepting — you're in charge, not the AI.
- Merge only what turned out flawless: the finished, audited piece gets merged; the ideas that didn't pan out get deleted, guilt-free.
Ready-to-use prompt · set up your parallel workflow
Copy it and paste it to your coding agent so it guides you to work on several fronts at once, without you having to learn any commands:
I want to move faster on my project by working across SEVERAL sessions in parallel, each in its own isolated version (worktree), without them stepping on each other or breaking my main version. Guide me in simple language, assuming I don't know git. 1. Explain in one sentence what a worktree is (a live, isolated copy of my project). 2. I'm going to work on these fronts at once: [list your tasks, e.g.: "1) redesign the home page, 2) fix login, 3) try a new idea"]. Create a dedicated worktree for each one, branching from my stable version. 3. Tell me how to open VS Code in each worktree to see the diff and approve/reject the changes visually. 4. IMPORTANT RULE: each session must push to ITS OWN branch, NEVER to the main one (main). The main branch only receives things via merge. 5. When I finish a task in its worktree, before merging it: apply the C-A-R protocol to it (audit, debug, leave it flawless). Only then merge that branch into the main one, and resolve any conflict in plain language. 6. If an idea didn't pan out, help me discard its worktree without my main project ever noticing. Golden rule: I move in parallel, but only audited work enters the main branch, via merge — never half-done.