LongCut logo

Stop Using Claude Code on One Branch (Do This Instead)

By Leon van Zyl

Summary

Topics Covered

  • Parallel Claude Instances Unlock Experimentation
  • Compare Skills, Images, and Models Side-by-Side
  • Merge Winners Without Losing Progress

Full Transcript

<b>Let me know if this sounds like you.</b>

<b>You'll ask Tor to make a</b> <b>change and if you don't like it,</b> <b>you ask Tor to back out everything and</b> <b>then try a different</b> <b>approach. And sometimes you</b>

<b>approach. And sometimes you</b> <b>actually lose a lot of valuable work</b> <b>along the way. This is slow,</b> <b>frustrating and quite honestly,</b> <b>you're leaving a lot of Claude Code's</b> <b>power on the table. Instead,</b>

<b>what if I told you you could</b> <b>create multiple versions of your project.</b>

<b>You can then point a</b> <b>Claude Code instance to each one</b> <b>and let these agents run in parallel. And</b>

<b>they were completely</b> <b>independent. And by the end of</b>

<b>independent. And by the end of</b> <b>the process, you can compare the</b> <b>different results and simply pick your</b> <b>favorite. This is exactly</b>

<b>favorite. This is exactly</b> <b>what Git work trees with Claude Code</b> <b>allow you to do. And I know the moment I</b> <b>said Git, a lot of you</b> <b>tensed up. But don't worry, you don't</b>

<b>tensed up. But don't worry, you don't</b> <b>have to be an expert in Git to use Git</b> <b>work trees right away.</b>

<b>And by the end of this video, you'll be</b> <b>running multiple Claude</b> <b>Code instances in parallel like</b> <b>nothing. So to demonstrate how this</b>

<b>nothing. So to demonstrate how this</b> <b>works, I'm going to ask Claude Code to</b> <b>create a landing page</b> <b>for a fitness tracker app. Now I haven't</b> <b>provided any MCP servers or</b> <b>skills or nothing special.</b>

<b>I'm simply asking Claude to create a very</b> <b>simple fitness tracker app.</b>

<b>And that's it. And the app</b> <b>is called Claude Fit. And it can come up</b> <b>with its own copy, you stock images,</b> <b>whatever it wants. So</b>

<b>in this instance, we're simply relying on</b> <b>the training data on</b> <b>Claude to produce this output.</b>

<b>Alright, so while Claude is cooking,</b> <b>let's actually try and</b> <b>explain what's happening here.</b>

<b>Alright, so by default, we have our main</b> <b>branch in our project. And</b>

<b>then we have a Claude Code</b> <b>session that's connected to this main</b> <b>project folder. Now what if</b>

<b>project folder. Now what if</b> <b>we wanted to create different</b> <b>variants of a solution to kind of see</b> <b>which one would work best for our</b> <b>business requirements.</b>

<b>business requirements.</b> <b>As a simple example, let's say we wanted</b> <b>to redesign the</b> <b>application, the UI, but we don't</b> <b>really know which type of design we want</b> <b>to go with. We want to see the</b> <b>application or we want</b> <b>to see the design in action, and maybe</b> <b>even compare them side by side before</b> <b>making a choice. Now that</b>

<b>is impossible with a solution like this,</b> <b>because we can only have one</b> <b>project active at any point</b> <b>in time. So yes, we could ask Claude to</b>

<b>in time. So yes, we could ask Claude to</b> <b>change the UI on main, but in order for</b> <b>us to try a different</b> <b>look and feel, we'll have to back out</b> <b>these changes, and then</b> <b>get Claude to change the UI</b> <b>to a different style, review the changes,</b> <b>back it out, etc. Of</b> <b>course, we could simply create</b> <b>different branches. So we could have a</b>

<b>different branches. So we could have a</b> <b>main branch, or we could</b> <b>create a second branch for,</b> <b>so this one could be, I don't know,</b> <b>purple, we could create a different</b> <b>branch with a color like</b> <b>red, I don't know, so we could try</b> <b>different styles. But the</b>

<b>different styles. But the</b> <b>problem is, you can only have</b> <b>one active branch at any point in time.</b>

<b>So you kind of have to</b> <b>tell Claude, all right,</b> <b>you should no longer point to main, you</b> <b>now need to point to</b> <b>purple, or now need to point to</b> <b>red. So Claude can only work on a single</b>

<b>red. So Claude can only work on a single</b> <b>branch at any point in</b> <b>time, and we will not be able to</b> <b>compare these side by side. We have to</b> <b>manually switch between them,</b> <b>and that's really not ideal.</b>

<b>Where work trees is very different. So</b>

<b>yes, we'll have a Claude</b> <b>instance that's pointing at our</b> <b>main project. But what we can also do is</b>

<b>main project. But what we can also do is</b> <b>create work trees. So</b>

<b>let's call this work tree one.</b>

<b>And this is actually a replica of our</b> <b>project folder. So this</b>

<b>project folder. So this</b> <b>really is a copy of the project</b> <b>folder on our file system. But there's a</b> <b>lot more to it than simply</b> <b>copying and pasting the folder.</b>

<b>This main branch is aware of all of the</b> <b>work trees that it's</b> <b>linked to. So we could have work</b>

<b>linked to. So we could have work</b> <b>tree one, we could have work tree two,</b> <b>and maybe even a third variant. And our</b>

<b>main branch is linked</b> <b>to all three of these. Now because each</b> <b>of these work trees are</b> <b>independent project folders,</b> <b>each of these can have their very own</b> <b>Claude code instance running.</b>

<b>So each of these Claude code</b> <b>instances can be working on a work tree</b> <b>without affecting any of</b> <b>the other work trees. In our</b>

<b>example, to be able to really visualize</b> <b>this, we're going to ask Claude to</b> <b>implement a different UI</b> <b>pattern for each of the different work</b> <b>trees. But in reality, you can do a lot</b>

<b>trees. But in reality, you can do a lot</b> <b>more with work trees</b> <b>than simply comparing different variants.</b>

<b>Let's say that you want</b> <b>Claude to work on a massive</b> <b>feature in one work tree. And maybe</b>

<b>Claude can work on a bug in another work</b> <b>tree. So once Claude</b>

<b>tree. So once Claude</b> <b>has implemented the bug fix in this work</b> <b>tree, we can simply merge</b> <b>these changes back into main.</b>

<b>And this work tree is unaffected. And</b>

<b>this agent continues working. Anyway,</b>

<b>let's dive into it. I</b>

<b>think it will make a lot of sense once we</b> <b>start playing with this. So</b>

<b>at the moment, we've got a</b> <b>super vanilla design for our fitness</b> <b>tracker app. This looks like the kind of</b>

<b>tracker app. This looks like the kind of</b> <b>AI slot that we've all</b> <b>come to love. Like it's not bad, but it</b> <b>definitely looks very generic. And like</b>

<b>everything else that</b> <b>these AI agents seem to produce. So let's</b>

<b>say we wanted to try out different</b> <b>techniques to see if</b> <b>we can get an even better design. So what</b>

<b>we're going to do is create</b> <b>separate work trees for work</b> <b>tree one, we're going to assign a skill.</b>

<b>So we'll assign a front end</b> <b>design skill to Claude code to</b> <b>see how it improves this design for work</b> <b>tree two, we'll create a</b> <b>design system instead. So we will</b> <b>not rely on the skill will provide a</b> <b>reference image to see if we can match</b> <b>that reference design.</b>

<b>And of course, we can get as creative and</b> <b>experimental as we</b> <b>want. But for work tree</b>

<b>want. But for work tree</b> <b>three, I think we should get really</b> <b>creative. Let's not use Claude for this</b>

<b>creative. Let's not use Claude for this</b> <b>one. And let's use Gemini</b>

<b>one. And let's use Gemini</b> <b>3.1 Pro, which was just released today.</b>

<b>So that way we can compare</b> <b>different designs, different</b> <b>techniques, and even different models.</b>

<b>I'm telling you now get</b> <b>work trees is an absolute must,</b> <b>especially to do side by side comparisons</b> <b>between all these different</b> <b>models. So with that said,</b>

<b>models. So with that said,</b> <b>I'm just going to clear our conversation.</b>

<b>And at the moment, you will</b> <b>notice I only have one sub</b> <b>folder. And this is for this fitness</b>

<b>folder. And this is for this fitness</b> <b>tracker app. And this is our main</b>

<b>tracker app. And this is our main</b> <b>project. In Claude code,</b>

<b>project. In Claude code,</b> <b>I'm going to say the following, please</b> <b>create three get work trees</b> <b>one skills to design system,</b> <b>and three Gemini 3.1 Pro. Let's run this.</b>

<b>If you're a developer, you</b> <b>can definitely just run the get</b> <b>commands. But I really wanted to show the</b>

<b>commands. But I really wanted to show the</b> <b>easiest way to get this</b> <b>going. Now watch this, Claude just</b>

<b>going. Now watch this, Claude just</b> <b>created three new folders, and they are</b> <b>at the same level as the</b> <b>main project. And if I zoom in</b>

<b>main project. And if I zoom in</b> <b>a bit, you can see the names. So we've</b>

<b>got fitness tracker skills, fitness</b> <b>tracker Gemini, and fitness</b> <b>tracker design system. These are full</b> <b>replicas of the original</b> <b>project. And you can see this in the</b>

<b>project. And you can see this in the</b> <b>file system as well. So this really means</b> <b>you can treat each of these</b> <b>folders like a separate project,</b> <b>or you can open up your terminal in those</b> <b>folders and run Claude</b> <b>code. So let's start with the</b>

<b>code. So let's start with the</b> <b>first one with skills. Since this is a</b> <b>separate project folder,</b> <b>I'm actually going to CD into</b> <b>fitness tracker and skills, I'm actually</b> <b>just going to rename this</b> <b>one to skills. Cool. In this</b>

<b>folder, I'm going to run Claude code. But</b>

<b>now this Claude code instance</b> <b>is pointing to the skills work</b> <b>tree. In fact, before I run Claude code,</b>

<b>tree. In fact, before I run Claude code,</b> <b>let's install the front in</b> <b>design skill. So let's go</b>

<b>design skill. So let's go</b> <b>to skills.sh, then let's go to front end</b>

<b>to skills.sh, then let's go to front end</b> <b>design skill. Let's copy</b>

<b>design skill. Let's copy</b> <b>this command. Let's run it in</b>

<b>this command. Let's run it in</b> <b>the terminal in the skills folder, by the</b> <b>way, also like Claude code.</b>

<b>And that should be it. Cool.</b>

<b>Now let's start Claude. If we have a look</b> <b>at our skills, this agent</b> <b>has access to the front end</b> <b>design skill. Perfect. So let's say, Hey,</b>

<b>design skill. Perfect. So let's say, Hey,</b> <b>I need you to redesign</b> <b>this fitness tracker app using</b> <b>your front end design skill carefully,</b> <b>consider colors and font</b> <b>choices, and even stock images</b> <b>that fit the theme of a fitness tracker</b> <b>app. And let's send this. I</b>

<b>app. And let's send this. I</b>

<b>just want to make sure that</b> <b>it is going to use the skill, which it</b> <b>does. All right, cool. So this</b>

<b>does. All right, cool. So this</b>

<b>variant is currently running.</b>

<b>I'm going to open up another session.</b>

<b>This one I'll rename to</b> <b>design system, then it's also CD</b> <b>into the correct folder design system.</b>

<b>And we can just bring up</b> <b>Claude code. Now this Claude code</b>

<b>Claude code. Now this Claude code</b> <b>instance does not have any skills</b> <b>assigned to it, just the fine skills</b> <b>skill, which we will not use.</b>

<b>And instead, what we'll do is we'll go to</b> <b>a website like dribble, and let's look</b> <b>for fitness website.</b>

<b>And let's look for something that we</b> <b>like. So maybe we can go</b>

<b>like. So maybe we can go</b> <b>with something like this. Then</b>

<b>this is a really clean design. So I'm</b>

<b>actually going to copy this</b> <b>image, I'll paste it into the</b> <b>chat. And it's a actually in this design</b>

<b>chat. And it's a actually in this design</b> <b>system folder, I'm just</b> <b>going to create a new subfolder</b> <b>called docs. And in that I'll just create</b>

<b>called docs. And in that I'll just create</b> <b>another folder called</b> <b>design. And I'll put it into this</b>

<b>design. And I'll put it into this</b> <b>conversation. And it's a please create a</b>

<b>conversation. And it's a please create a</b> <b>complete design system based on the</b> <b>attached image. So I</b>

<b>attached image. So I</b> <b>need you to match the fonts, the color</b> <b>schemes, the layout, the</b> <b>design, the vibe, then create a</b> <b>complete design system and store it in</b> <b>the docs slash design</b> <b>folder. And then while these are</b>

<b>folder. And then while these are</b> <b>running, let's actually look at the</b> <b>Gemini 3.1 Pro example. So for that,</b> <b>we're not going to use</b> <b>Claude code. And instead, I'm going to</b>

<b>Claude code. And instead, I'm going to</b> <b>use Google's anti gravity IDE. So I'm</b>

<b>just going to open up that</b> <b>specific work tree folder. Awesome. And</b>

<b>then let's see how good</b> <b>Gemini 3.1 Pro is with UI designs.</b>

<b>Hey, I need you to redesign this fitness</b> <b>tracker app, as it's very</b> <b>bland and very AI sloppish.</b>

<b>I want you to do your best to correct the</b> <b>font and the colors and the</b> <b>style and the vibe to work</b> <b>with a fitness tracker app. Also lean</b>

<b>into your strength of creating</b> <b>animations and SVGs. And nice,</b>

<b>that seems to be cooking. So now we have</b> <b>three agents working in</b> <b>parallel on the same code base.</b>

<b>It's kind of like having multiple</b> <b>universes, where each has a very</b> <b>different take on the</b> <b>exact same project. And by the end of</b> <b>this, we'll select our favorite design</b> <b>and merge it back into</b> <b>our main project. Git knows exactly what</b> <b>work trees exist, and what the</b> <b>relationship between the main</b> <b>branch and those work trees are. In fact,</b>

<b>if I go to source control, we</b> <b>can see all of our work trees</b> <b>in here, along with the changes per work</b> <b>tree. And if you simply</b>

<b>tree. And if you simply</b> <b>copy it and paste it to folders</b> <b>yourself, you will be in big trouble.</b>

<b>Because Git knows exactly what's going</b> <b>on, we can simply tell</b> <b>Git that we prefer the changes in this</b> <b>work tree. So please merge the changes</b>

<b>work tree. So please merge the changes</b> <b>into our master branch,</b> <b>and we'll be able to deal with conflicts</b> <b>and everything else. It</b>

<b>just works. And here we go.</b>

<b>So the agents just completed their work.</b>

<b>So let's start with the</b> <b>skills agent. I'm just going to</b>

<b>skills agent. I'm just going to</b> <b>ask it, please can you run the dev server</b> <b>for me. And if I go to this</b>

<b>for me. And if I go to this</b> <b>background job, you can see</b> <b>that our app is running on port 3000. And</b>

<b>this is what code code with</b> <b>the design skill produced.</b>

<b>And I must say, I think this looks really</b> <b>cool. I do like the</b>

<b>cool. I do like the</b> <b>font, I do like the colors,</b> <b>everything is like bold and in your face.</b>

<b>It's just really, really</b> <b>cool looking. It even added</b>

<b>cool looking. It even added</b> <b>a bit of a stock image in the background.</b>

<b>So definitely not a bad</b> <b>start to a fitness tracker</b> <b>application. But the design system is</b>

<b>application. But the design system is</b> <b>still busy, as it took a bit longer</b> <b>because it first had to</b> <b>create the actual design system. So in</b>

<b>the folder, I could just show you in the</b> <b>docs folder, we have</b> <b>a proper design system that we can use</b> <b>going forward. So this is</b>

<b>going forward. So this is</b> <b>really useful. As we're working</b>

<b>really useful. As we're working</b> <b>on the app, we can just ask the agent to</b> <b>reference this design folder</b> <b>to ensure that the design and</b> <b>everything is consistent. But it seems</b> <b>like the agent is almost</b> <b>done. So it's not that bad. And</b>

<b>done. So it's not that bad. And</b>

<b>I can see that Gemini 3.1 Pro is done as</b> <b>well. It's actually</b>

<b>well. It's actually</b> <b>running the app on port 3003. So</b>

<b>let's actually have a look at that so</b> <b>long. And this is what</b>

<b>long. And this is what</b> <b>Gemini came up with. I really like</b> <b>this animation on the side. This looks</b>

<b>awesome with a little heartbeat and the</b> <b>animations. This is so,</b>

<b>animations. This is so,</b> <b>so cool. And look at these little</b>

<b>so cool. And look at these little</b> <b>animations when I hover over</b> <b>these texts. These cards look</b>

<b>these texts. These cards look</b> <b>really cool as well. I'm actually</b>

<b>impressed. This is really, really cool.</b>

<b>And now the design system</b> <b>agent is done as well. So let's have a</b> <b>look at this one. And just</b>

<b>as a reminder, we asked the</b> <b>agent to try and replicate this kind of</b> <b>design. So this look and feel. And I</b>

<b>design. So this look and feel. And I</b>

<b>think for the most part,</b> <b>it kind of achieved it. It looks like the</b> <b>same fonts. It's the same</b>

<b>same fonts. It's the same</b> <b>kind of color scheme. So not</b>

<b>bad at all. It did fail to upload a Euro</b> <b>image, but I mean, we can</b> <b>resolve that easily enough.</b>

<b>So yes, this is also not bad at all. It's</b>

<b>very, very hard to decide.</b>

<b>So which one would you go for?</b>

<b>I would be really curious to know. Just</b>

<b>let me know in the comments,</b> <b>which out of these four would</b> <b>you prefer? This was Claude Cote's</b>

<b>you prefer? This was Claude Cote's</b> <b>Vanilla design. This was with the front</b>

<b>Vanilla design. This was with the front</b> <b>end design skill. Then we</b>

<b>have this design from Gemini 3.1 Pro. And</b>

<b>finally, this was Claude Cote with a</b> <b>reference image and a</b> <b>design system. So for argument's sake,</b>

<b>design system. So for argument's sake,</b> <b>let's say that I actually</b> <b>preferred this version. So how</b>

<b>did we now tell our project that this is</b> <b>the design we want to go with? And it can</b> <b>actually just discard</b> <b>the rest of the results. Well, what we</b> <b>can do is just go back to</b> <b>our initial Claude instance.</b>

<b>So this one knows exactly what all the</b> <b>work trees were. So now we</b> <b>can tell it, thank you for that.</b>

<b>We managed to try out the different</b> <b>approaches and I prefer the work tree</b> <b>with the design system.</b>

<b>Please can you merge that into our main</b> <b>project and you can actually</b> <b>delete the other work trees.</b>

<b>What I do recommend you do at this point</b> <b>is to simply close out all those</b> <b>terminals referencing</b> <b>those work trees. So I'll remove this one</b> <b>as well, as well as the</b> <b>design system. All we really care</b>

<b>design system. All we really care</b> <b>about now is our main branch. Let's send</b>

<b>this. And what we'll notice in a second</b> <b>is that all of these</b> <b>new folders, these work tree folders,</b> <b>will be removed and the new</b> <b>design will be merged into</b> <b>our main project. All right, so let's</b> <b>remove some of these folders, but it's</b> <b>struggled to remove the</b> <b>design system folder. And I think that's</b> <b>because there are these</b> <b>untracked files in there. But we</b>

<b>can definitely ask Claude just to force</b> <b>remove that folder. That's</b>

<b>fine as well. The important thing</b> <b>is that we go into our main fitness</b> <b>tracker app, we can run dev and now our</b> <b>main app running on port</b> <b>3000 has that new design. How cool is</b> <b>that? Good work trees is just one of the</b>

<b>that? Good work trees is just one of the</b> <b>many advanced topics</b> <b>that we discuss in my community called</b> <b>Agenteclabs. This is a vibrant community</b>

<b>Agenteclabs. This is a vibrant community</b> <b>of people who like to</b> <b>build solutions using Claude code, NADN</b> <b>and many other AI</b> <b>solutions. We've got classrooms with</b>

<b>solutions. We've got classrooms with</b> <b>structured videos to help you take your</b> <b>Agente coding or vibe</b> <b>coding skills to the next level.</b>

<b>So consider joining it's only $7 a month</b> <b>for the first 1000</b> <b>members. I hope to see you there.</b>

<b>members. I hope to see you there.</b>

<b>Then YouTube things will enjoy this other</b> <b>video. So click on</b>

<b>video. So click on</b> <b>the card on the screen.</b>

<b>I'll see you in the next one. Bye bye.</b>

<b>I'll see you in the next one. Bye bye.</b>

Loading...

Loading video analysis...