<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Zenobia Panvelwala</title>
    <description>The latest articles on DEV Community by Zenobia Panvelwala (@zenobia_panvelwala).</description>
    <link>https://dev.to/zenobia_panvelwala</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4023064%2F37469f08-bb8e-47d3-aaaf-611ae49ad32c.jpg</url>
      <title>DEV Community: Zenobia Panvelwala</title>
      <link>https://dev.to/zenobia_panvelwala</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/zenobia_panvelwala"/>
    <language>en</language>
    <item>
      <title>Git Worktrees, With and Without Claude Code</title>
      <dc:creator>Zenobia Panvelwala</dc:creator>
      <pubDate>Thu, 09 Jul 2026 17:30:31 +0000</pubDate>
      <link>https://dev.to/zenobia_panvelwala/git-worktrees-with-and-without-claude-code-500g</link>
      <guid>https://dev.to/zenobia_panvelwala/git-worktrees-with-and-without-claude-code-500g</guid>
      <description>&lt;p&gt;I was working on one of my projects and wanted to build two versions of the same feature. I could have cloned the repository twice, but I had recently heard about &lt;code&gt;git worktree&lt;/code&gt; and decided to give it a try.&lt;/p&gt;

&lt;p&gt;With worktrees, you don't need to switch between branches when you have work to do simultaneously. Each worktree is a separate directory with its own cleanly checked-out branch, while all of them share the same underlying &lt;code&gt;.git&lt;/code&gt; history. For example, if you're in the middle of refactoring a complex module and a bug comes up, you don't have to stash or abandon your in-progress work — you can quickly create a worktree, fix the bug there, and clean it up when you're done. For full details, see the official Git documentation: &lt;a href="https://git-scm.com/docs/git-worktree" rel="noopener noreferrer"&gt;https://git-scm.com/docs/git-worktree&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Below are the problems I ran into (plus a few that other developers commonly hit), covered as a comparison of two methods: doing it manually, and doing it with Claude Code.&lt;/p&gt;

&lt;p&gt;My test project is a Next.js application with TypeScript and Tailwind CSS.&lt;/p&gt;

&lt;h2&gt;
  
  
  Round One: The Manual Way
&lt;/h2&gt;

&lt;p&gt;To create a worktree off the main repository, I ran:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git worktree add ../example-app-feature-1 &lt;span class="nt"&gt;-b&lt;/span&gt; feature/feature-1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates a new directory next to the main repo, checked out on a brand-new branch called &lt;code&gt;feature/feature-1&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Gotchas...
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;You can't check out the same branch in two worktrees.&lt;/strong&gt; Git refuses, because two working trees tracking the same branch would corrupt each other's state. That's why the command above uses &lt;code&gt;-b&lt;/code&gt; to create a new branch.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Put the worktree outside your repository.&lt;/strong&gt; A sibling directory (&lt;code&gt;../example-app-feature-1&lt;/code&gt;) is the common convention. It isn't a hard requirement — the path can be anywhere — but never create a worktree &lt;em&gt;inside&lt;/em&gt; your main repo, or its files will show up as untracked noise in &lt;code&gt;git status&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A fresh worktree is a clean checkout.&lt;/strong&gt; Untracked and gitignored files don't come along: no &lt;code&gt;node_modules&lt;/code&gt;, no &lt;code&gt;.env&lt;/code&gt;. Each worktree needs its own dependency install, which costs time and disk space, and your environment files have to be brought over manually.&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Workarounds
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;A. A shell script to create worktrees&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/usr/bin/env bash&lt;/span&gt;
&lt;span class="c"&gt;# new-worktree.sh — create a worktree and make it runnable&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt;

&lt;span class="nv"&gt;NAME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;
&lt;span class="nv"&gt;MAIN_DIR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;git rev-parse &lt;span class="nt"&gt;--show-toplevel&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt; &lt;span class="c"&gt;# root of the main repo&lt;/span&gt;

git worktree add &lt;span class="s2"&gt;"../&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;basename&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$MAIN_DIR&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;-&lt;/span&gt;&lt;span class="nv"&gt;$NAME&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="nt"&gt;-b&lt;/span&gt; &lt;span class="s2"&gt;"feature/&lt;/span&gt;&lt;span class="nv"&gt;$NAME&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="nb"&gt;cd&lt;/span&gt; &lt;span class="s2"&gt;"../&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;basename&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$MAIN_DIR&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;-&lt;/span&gt;&lt;span class="nv"&gt;$NAME&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;

&lt;span class="c"&gt;# Copy env/config files that git ignores&lt;/span&gt;
&lt;span class="nb"&gt;cp&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$MAIN_DIR&lt;/span&gt;&lt;span class="s2"&gt;/.env"&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt; 2&amp;gt;/dev/null &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nb"&gt;true
cp&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$MAIN_DIR&lt;/span&gt;&lt;span class="s2"&gt;/.env.local"&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt; 2&amp;gt;/dev/null &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nb"&gt;true

&lt;/span&gt;npm &lt;span class="nb"&gt;install
echo&lt;/span&gt; &lt;span class="s2"&gt;"Worktree ready: &lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;pwd&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two caveats: &lt;code&gt;npm install&lt;/code&gt; still spends minutes duplicating gigabytes of dependencies per worktree, and copied environment files drift — if you rotate a secret in the main repo, every existing worktree silently keeps the stale copy.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;B. Symlinks&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Instead of copying environment files, you can link back to the ones in the main repository:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ln&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$MAIN_DIR&lt;/span&gt;&lt;span class="s2"&gt;/.env"&lt;/span&gt; .env
&lt;span class="nb"&gt;ln&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$MAIN_DIR&lt;/span&gt;&lt;span class="s2"&gt;/.env.local"&lt;/span&gt; .env.local
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now there's a single source of truth, so nothing drifts. But this has caveats too: some dotenv loaders and Docker bind mounts don't follow symlinks well, and symlinking cuts both ways — if you &lt;em&gt;want&lt;/em&gt; per-worktree config, like a different &lt;code&gt;PORT&lt;/code&gt; or database name per tree, a symlink is exactly wrong. In that case, symlink (or copy) the shared &lt;code&gt;.env&lt;/code&gt; and create a real, per-worktree &lt;code&gt;.env.local&lt;/code&gt; containing just the values that differ, such as the port.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;C. pnpm&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Symlinks solve config; pnpm solves dependencies. pnpm keeps every package in a single global store and hard-links it into each project's &lt;code&gt;node_modules&lt;/code&gt;, so an install in a second worktree mostly just creates links instead of re-downloading. In practice, that turns a multi-minute, multi-gigabyte install into seconds and megabytes. In short: with npm, three worktrees cost you three full &lt;code&gt;node_modules&lt;/code&gt;; with pnpm, they share one store.&lt;/p&gt;

&lt;p&gt;I found pnpm the most suitable option — it avoided duplicate dependency installs, and a per-worktree &lt;code&gt;.env.local&lt;/code&gt; let me run multiple dev servers simultaneously without port collisions.&lt;/p&gt;

&lt;p&gt;After finishing the feature and pushing the branch, cleanup takes two steps (in this order — git won't delete a branch that's still checked out in a worktree):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git worktree remove ../example-app-feature-1
git branch &lt;span class="nt"&gt;-d&lt;/span&gt; feature/feature-1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you ever delete a worktree directory manually with &lt;code&gt;rm -rf&lt;/code&gt; instead, git will still think it exists; run &lt;code&gt;git worktree prune&lt;/code&gt; to clear the stale registration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Round Two: The Claude Code Way
&lt;/h2&gt;

&lt;p&gt;Same task, same repo, starting clean:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;claude &lt;span class="nt"&gt;--worktree&lt;/span&gt; feature-1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note that &lt;code&gt;--worktree&lt;/code&gt; (or &lt;code&gt;-w&lt;/code&gt;) takes a &lt;em&gt;name&lt;/em&gt;, not a path. Claude Code creates the worktree itself under &lt;code&gt;.claude/worktrees/&lt;/code&gt; inside your repo, checks out a new branch based on your remote's default branch (&lt;code&gt;origin/HEAD&lt;/code&gt;), and starts the session inside it — the create/branch/cd dance from Round One becomes one command.&lt;/p&gt;

&lt;p&gt;A worktree is still a fresh checkout, though, so your untracked configuration and secret files don't come along automatically here either. The remedy is a &lt;code&gt;.worktreeinclude&lt;/code&gt; file in your project root:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight conf"&gt;&lt;code&gt;&lt;span class="c"&gt;# .worktreeinclude — uses .gitignore pattern syntax
&lt;/span&gt;
.&lt;span class="n"&gt;env&lt;/span&gt;
&lt;span class="n"&gt;config&lt;/span&gt;/&lt;span class="n"&gt;secrets&lt;/span&gt;.&lt;span class="n"&gt;json&lt;/span&gt;

&lt;span class="c"&gt;# add other config files as needed
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This tells Claude Code which gitignored files to copy into each new worktree it creates. Two things worth knowing: it only copies files that are &lt;em&gt;both&lt;/em&gt; listed here &lt;em&gt;and&lt;/em&gt; gitignored (tracked files come along with the checkout anyway), and the file itself should be &lt;strong&gt;committed&lt;/strong&gt; to the repo — it's the manifest, not the secrets — so it travels to every clone and teammate automatically. Pair it with adding &lt;code&gt;.claude/worktrees/&lt;/code&gt; to your &lt;code&gt;.gitignore&lt;/code&gt; so Claude's worktrees don't show up as untracked noise in your main checkout.&lt;/p&gt;

&lt;p&gt;When you exit the session, Claude cleans up after itself — with a sensible condition: if the worktree has no commits or uncommitted changes, it's removed automatically; if you did make changes, Claude asks whether to keep or remove it, so you can't lose work by accident.&lt;/p&gt;

&lt;h3&gt;
  
  
  Gotchas...
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;.worktreeinclude&lt;/code&gt; copies; it doesn't symlink, and it doesn't install.&lt;/strong&gt; Because it copies environment and secret files, the drift problem from Round One applies: rotate an API key in your main &lt;code&gt;.env&lt;/code&gt; and every existing worktree keeps the stale copy. It also does nothing about &lt;code&gt;node_modules&lt;/code&gt;, so you still pair it with pnpm or a hook that runs your install command on worktree creation. &lt;strong&gt;NOTE:&lt;/strong&gt; Claude Code's hooks (configured in &lt;code&gt;.claude/settings.json&lt;/code&gt;) can run &lt;code&gt;pnpm install&lt;/code&gt; automatically when a session starts. There's also a &lt;code&gt;WorktreeCreate&lt;/code&gt; hook, but it replaces the default worktree creation entirely — including &lt;code&gt;.worktreeinclude&lt;/code&gt; — so you'd have to rebuild that logic yourself. For now, a simple hook or just running &lt;code&gt;pnpm install&lt;/code&gt; first is the pragmatic choice; custom hooks deserve their own article.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Worktrees isolate code, not infrastructure.&lt;/strong&gt; Ports still collide, and a shared local database is still shared — an agent running migrations in one worktree can break the app running in another. The fix for port collisions is the same as before: a per-worktree &lt;code&gt;.env.local&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Review bandwidth becomes the real bottleneck.&lt;/strong&gt; Spinning up multiple Claude agents on multiple features in parallel is easy; reviewing several branches of AI-written diffs is not. Merge conflicts between two branches you only half-remember reviewing are the worst kind to resolve. Parallelize across &lt;em&gt;independent&lt;/em&gt; tasks, and expect two or three simultaneous sessions to be your practical ceiling.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check in your &lt;code&gt;CLAUDE.md&lt;/code&gt;.&lt;/strong&gt; Each new worktree starts a cold session that doesn't inherit what another session learned. A committed &lt;code&gt;CLAUDE.md&lt;/code&gt; travels with every worktree automatically and is the main way to keep parallel sessions consistent.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Round Three: Reusable Commands
&lt;/h2&gt;

&lt;p&gt;To make the parallel workflow repeatable, turn it into custom slash commands. Create a file named &lt;code&gt;.claude/commands/parallel-worktrees.md&lt;/code&gt; with the following contents:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Set&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;up&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;parallel&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;git&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;worktrees&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;for&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;multiple&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;features"&lt;/span&gt;
&lt;span class="na"&gt;argument-hint&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;feature-1&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;feature-2&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt; &lt;span class="s"&gt;...&lt;/span&gt;
&lt;span class="nn"&gt;---&lt;/span&gt;

I want to develop these features in parallel using git worktrees: $ARGUMENTS

First, analyze the features and flag any that are likely to touch the
same files — warn me about merge-conflict risk before proceeding.

Then set up the environment. Do NOT implement any features; setup only.
&lt;span class="p"&gt;
1.&lt;/span&gt; Ensure we branch from up-to-date main:
   &lt;span class="sb"&gt;`git fetch origin &amp;amp;&amp;amp; git checkout main &amp;amp;&amp;amp; git pull`&lt;/span&gt;
&lt;span class="p"&gt;2.&lt;/span&gt; For each feature, check that no branch or directory with that name
   already exists, then create:
   &lt;span class="sb"&gt;`git worktree add ../example-app-[feature-name] -b feature/[feature-name]`&lt;/span&gt;
&lt;span class="p"&gt;3.&lt;/span&gt; In each worktree:
&lt;span class="p"&gt;   -&lt;/span&gt; Symlink the shared env file: &lt;span class="sb"&gt;`ln -s [main-repo-path]/.env .env`&lt;/span&gt;
&lt;span class="p"&gt;   -&lt;/span&gt; Create a &lt;span class="sb"&gt;`.env.local`&lt;/span&gt; containing a unique &lt;span class="sb"&gt;`PORT`&lt;/span&gt; (3001, 3002, ...)
     so dev servers never collide
&lt;span class="p"&gt;   -&lt;/span&gt; Run &lt;span class="sb"&gt;`pnpm install`&lt;/span&gt; (shared store, no duplicated downloads)
&lt;span class="p"&gt;4.&lt;/span&gt; Run &lt;span class="sb"&gt;`git worktree list`&lt;/span&gt; and show me the output to confirm.
&lt;span class="p"&gt;5.&lt;/span&gt; Print a summary table: worktree path, branch, port — and the exact
   commands to launch a Claude session in each
   (&lt;span class="sb"&gt;`cd ../example-app-[feature-name] &amp;amp;&amp;amp; claude`&lt;/span&gt;).
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run it with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/parallel-worktrees feature-1 feature-2 feature-3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Feel free to adapt this template to your project's needs.&lt;/p&gt;

&lt;p&gt;Then, to integrate the finished work, create a second command at &lt;code&gt;.claude/commands/integrate-parallel-work.md&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Integrate parallel worktree feature branches and clean up&lt;/span&gt;
&lt;span class="na"&gt;argument-hint&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;feature-1&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;feature-2&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt; &lt;span class="s"&gt;...&lt;/span&gt;
&lt;span class="nn"&gt;---&lt;/span&gt;

I have features developed in parallel worktrees to integrate: $ARGUMENTS

Safety first — before merging anything:
&lt;span class="p"&gt;1.&lt;/span&gt; For each feature, verify branch feature/[feature-name] exists and run
   &lt;span class="sb"&gt;`git status`&lt;/span&gt; in its worktree (../example-app-[feature-name]).
   If any worktree has uncommitted or untracked changes, STOP and show
   me — do not proceed until I decide what to do with them.
&lt;span class="p"&gt;2.&lt;/span&gt; Update main: &lt;span class="sb"&gt;`git fetch origin &amp;amp;&amp;amp; git checkout main &amp;amp;&amp;amp; git pull`&lt;/span&gt;

Integration:
&lt;span class="p"&gt;3.&lt;/span&gt; Create integration branch from main:
   &lt;span class="sb"&gt;`git checkout -b integration/parallel-features`&lt;/span&gt;
&lt;span class="p"&gt;4.&lt;/span&gt; Merge each feature/[feature-name] one at a time. After each merge:
&lt;span class="p"&gt;   -&lt;/span&gt; If there are conflicts, resolve them, then PAUSE and show me the
     conflicted files and your resolution as a diff before continuing.
&lt;span class="p"&gt;5.&lt;/span&gt; Run the full verification suite: &lt;span class="sb"&gt;`pnpm install &amp;amp;&amp;amp; pnpm build &amp;amp;&amp;amp; pnpm test`&lt;/span&gt;
   (and lint). If anything fails, stop and show me the failure — do not
   attempt fixes on the integration branch without asking.

Finish (only after I explicitly confirm):
&lt;span class="p"&gt;6.&lt;/span&gt; Merge integration/parallel-features into main and push.
&lt;span class="p"&gt;7.&lt;/span&gt; Clean up, in this order:
&lt;span class="p"&gt;   -&lt;/span&gt; &lt;span class="sb"&gt;`git worktree remove ../example-app-[feature-name]`&lt;/span&gt; for each feature
&lt;span class="p"&gt;   -&lt;/span&gt; &lt;span class="sb"&gt;`git branch -d feature/[feature-name]`&lt;/span&gt; for each (use -d, never -D)
&lt;span class="p"&gt;   -&lt;/span&gt; &lt;span class="sb"&gt;`git branch -d integration/parallel-features`&lt;/span&gt;
&lt;span class="p"&gt;   -&lt;/span&gt; &lt;span class="sb"&gt;`git worktree prune`&lt;/span&gt;
&lt;span class="p"&gt;8.&lt;/span&gt; Show me final &lt;span class="sb"&gt;`git worktree list`&lt;/span&gt; and &lt;span class="sb"&gt;`git branch`&lt;/span&gt; output to confirm
   everything is clean.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If your repo lives on GitHub (or similar) with a PR-based flow, replace the local merge in steps 6–7 with "push the integration branch and open a PR" — merging to main locally is fine for solo projects, but not for team or production setups.&lt;/p&gt;

&lt;p&gt;Run it with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/integrate-parallel-work feature-1 feature-2 feature-3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Final Word
&lt;/h2&gt;

&lt;p&gt;Which method to use depends on the size of the project and whether it's a solo effort or production team work. Manual worktrees give you full control over base refs, locations, and long-lived trees; Claude Code's managed worktrees remove the ceremony for quick parallel tasks. Either way, sharing a standardized command template with teammates helps avoid human error, streamlines the parallel workflow, and lets developers skip the gotchas and focus on the actual task at hand.&lt;/p&gt;

</description>
      <category>git</category>
      <category>claude</category>
      <category>ai</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
