<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Git-Worktrees on RockB</title><link>https://baeseokjae.github.io/tags/git-worktrees/</link><description>Recent content in Git-Worktrees on RockB</description><image><title>RockB</title><url>https://baeseokjae.github.io/images/og-default.png</url><link>https://baeseokjae.github.io/images/og-default.png</link></image><generator>Hugo</generator><language>en-us</language><lastBuildDate>Tue, 28 Apr 2026 09:02:41 +0000</lastBuildDate><atom:link href="https://baeseokjae.github.io/tags/git-worktrees/index.xml" rel="self" type="application/rss+xml"/><item><title>Cursor Worktrees Guide 2026: Parallel Agents Without File Conflicts</title><link>https://baeseokjae.github.io/posts/cursor-worktrees-parallel-agents-2026/</link><pubDate>Tue, 28 Apr 2026 09:02:41 +0000</pubDate><guid>https://baeseokjae.github.io/posts/cursor-worktrees-parallel-agents-2026/</guid><description>Learn how to run multiple Cursor AI agents in parallel using Git worktrees — no file conflicts, faster feature delivery, and smarter model comparison.</description><content:encoded><![CDATA[<p>Cursor worktrees let you run multiple AI agents simultaneously — each in its own isolated Git checkout — so they never overwrite each other&rsquo;s files. You type <code>/worktree</code> in Cursor&rsquo;s chat, the agent spawns a separate branch and directory, and you review or discard the result independently from your main codebase.</p>
<h2 id="what-are-git-worktrees-and-why-do-they-matter-for-ai-agents">What Are Git Worktrees and Why Do They Matter for AI Agents?</h2>
<p>Git worktrees are a native Git feature that allows a single repository to have multiple working directories checked out simultaneously, each on its own branch. Instead of cloning the repo three times to run three separate experiments, you add three worktrees to the same <code>.git</code> database — they share history and objects, but each has independent file state. In the context of AI coding agents, this capability transforms single-threaded tool use into genuine parallel execution. Cursor 3 (released April 2, 2026 under the codename &ldquo;Glass&rdquo;) integrated worktrees directly into its Agents Window, giving developers a first-class UI for managing several agents at once. Before this, running two Cursor agents on the same project meant accepting file conflicts or constantly switching chat contexts. With worktrees, an authentication agent and a notifications agent can each modify their respective files at the same time, with zero risk of clobbering each other&rsquo;s work. The takeaway: worktrees are the infrastructure layer that makes multi-agent AI development safe and practical at scale.</p>
<h3 id="how-git-worktrees-differ-from-branches">How Git Worktrees Differ from Branches</h3>
<p>A regular branch switch (<code>git checkout feature-x</code>) replaces your entire working directory. A worktree addition (<code>git worktree add ../project-feature-x feature-x</code>) creates a <em>second</em> directory alongside your main one. Both are live checkouts; both track their own staged/unstaged changes. You can have your main checkout on <code>main</code> and a worktree on <code>feature/auth</code> simultaneously — open in separate editor windows, edited by separate agents, without any merge conflict until you deliberately apply changes.</p>
<h2 id="how-cursor-implements-worktrees-the-core-commands">How Cursor Implements Worktrees: The Core Commands</h2>
<p>Cursor&rsquo;s worktree implementation wraps Git&rsquo;s native worktree mechanics behind three slash commands designed specifically for AI agent workflows. The commands are <code>/worktree</code>, <code>/best-of-n</code>, <code>/apply-worktree</code>, and <code>/delete-worktree</code>. The <code>/worktree</code> command spawns one isolated run: it creates a new branch, copies your working directory state into a dedicated worktree path (stored under <code>~/.cursor/worktrees</code> when using the Cursor CLI with the global <code>--worktree</code> flag), then runs the agent&rsquo;s task entirely within that sandbox. Your main checkout is untouched. If the agent installs packages, rewrites a service, or breaks the test suite — none of that bleeds back until you choose to apply. This single-command isolation is the fastest path to &ldquo;let the agent try something risky without me having to undo it manually.&rdquo; Cursor&rsquo;s documentation explicitly describes this as the right pattern for experimental edits, large refactors, and anything that touches build or install scripts.</p>
<h3 id="best-of-n--model-comparison-in-parallel-worktrees"><code>/best-of-n</code> — Model Comparison in Parallel Worktrees</h3>
<p>The <code>/best-of-n</code> command extends the single-worktree pattern into multi-model comparison. You send the same prompt to N different models (e.g., Claude Sonnet 4.6, GPT-4o, Gemini 1.5 Pro) simultaneously; Cursor spins up one worktree per model and runs each agent in isolation. When all agents finish, you review the diffs side by side and pick the strongest result. This command converts what used to be a manual, time-consuming A/B test — run agent A, note output, reset, run agent B — into a parallel operation that completes in roughly the same wall-clock time as a single agent run. For critical rewrites or algorithmic problems where the correct solution is non-obvious, <code>/best-of-n</code> provides empirical evidence rather than model reputation heuristics.</p>
<h3 id="apply-worktree-and-delete-worktree"><code>/apply-worktree</code> and <code>/delete-worktree</code></h3>
<p>Once you select a result, <code>/apply-worktree</code> merges the chosen worktree&rsquo;s changes back into your main checkout. Cursor handles the diff application so you don&rsquo;t need to manually cherry-pick commits. If you decide none of the results are worth keeping — or if the agent failed partway through — <code>/delete-worktree</code> cleans up the directory and branch. This cleanup path is what makes worktree-based experimentation low-risk: the cost of a failed agent run is a single command, not manual <code>git stash</code> archaeology.</p>
<h2 id="the-agents-window-cursor-3s-multi-agent-interface">The Agents Window: Cursor 3&rsquo;s Multi-Agent Interface</h2>
<p>Cursor 3 (Glass) shipped April 2, 2026, and its headline feature is the Agents Window — a dedicated sidebar for managing multiple AI agents simultaneously. Before Glass, Cursor&rsquo;s chat was fundamentally single-threaded: one conversation, one agent, sequential progress. The Agents Window surfaces all running worktree agents in one place, showing their status (planning, executing, waiting for review), the branch they&rsquo;re working on, and a quick-diff preview. Developers can launch a new parallel agent without interrupting agents already in flight. This represents a structural shift: Cursor is evolving from a smart editor into an orchestration layer, where the editor itself becomes secondary to managing a fleet of AI workers. Industry observers from The New Stack noted this trajectory in April 2026, describing the emerging stack as &ldquo;Cursor for orchestration, Claude Code or Codex for execution.&rdquo; The Agents Window is the first concrete UI artifact of that vision — a control plane for AI agent deployment running locally.</p>
<h3 id="what-the-agents-window-shows">What the Agents Window Shows</h3>
<p>Each agent card in the Agents Window displays:</p>
<table>
  <thead>
      <tr>
          <th>Field</th>
          <th>Description</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Branch</td>
          <td>The worktree branch the agent is operating on</td>
      </tr>
      <tr>
          <td>Status</td>
          <td>Planning / Executing / Awaiting review / Done</td>
      </tr>
      <tr>
          <td>Task summary</td>
          <td>The original prompt truncated to ~80 chars</td>
      </tr>
      <tr>
          <td>Changed files</td>
          <td>Count of files modified so far</td>
      </tr>
      <tr>
          <td>Quick actions</td>
          <td>Apply, Delete, Open in editor</td>
      </tr>
  </tbody>
</table>
<p>The &ldquo;Awaiting review&rdquo; status is particularly useful for human-in-the-loop workflows: the agent pauses after generating a plan (Plan Mode) and waits for your approval before executing destructive changes.</p>
<h2 id="the-plan-mode--agent-mode--worktrees-pattern">The Plan Mode + Agent Mode + Worktrees Pattern</h2>
<p>The most reliable parallel agent workflow combines three Cursor features: Plan Mode, Agent Mode, and worktrees. The sequence looks like this: you describe the task in Cursor&rsquo;s chat and invoke <code>/worktree</code>; the agent enters Plan Mode first, generating a step-by-step proposal without writing any code; you review the plan and approve or redirect; the agent then enters Agent Mode within the worktree and executes the approved plan. This three-stage gate — isolate, plan, execute — prevents the most common failure modes of autonomous agents: irreversible file changes made before you understood the approach, and conflicts caused by two agents simultaneously modifying shared utilities. Engincan Veske documented this pattern with a concrete example: an authentication agent and a notifications agent each receive their feature brief, each generates a plan in their own worktree, and each waits for independent approval before writing a single line of code. The result is two completed feature branches ready for review in roughly the same time a sequential workflow would deliver one.</p>
<h3 id="when-to-use-plan-mode-vs-letting-the-agent-run">When to Use Plan Mode vs. Letting the Agent Run</h3>
<p>Not every task warrants the Plan Mode overhead. A quick fix — renaming a variable, updating a dependency version, adding a docstring — benefits more from direct Agent Mode execution without the planning step. Plan Mode pays off when:</p>
<ul>
<li>The task involves more than 5 files</li>
<li>The agent will run install scripts or migrations</li>
<li>Two or more parallel agents share adjacent code (services that import the same module)</li>
<li>The change is difficult to reverse (schema changes, API contract modifications)</li>
</ul>
<p>For simple fixes, skip Plan Mode and let the agent run directly in a worktree. The worktree still gives you the safety net; Plan Mode adds review latency that isn&rsquo;t worth it for low-risk tasks.</p>
<h2 id="practical-workflow-running-authentication-and-notifications-agents-in-parallel">Practical Workflow: Running Authentication and Notifications Agents in Parallel</h2>
<p>Here is a concrete end-to-end walkthrough using the authentication + notifications example from Cursor&rsquo;s community documentation. Start with a clean <code>main</code> branch. Open two Cursor chat panels (or use the Agents Window). In the first panel, type:</p>



<div class="goat svg-container ">
  
    <svg
      xmlns="http://www.w3.org/2000/svg"
      font-family="Menlo,Lucida Console,monospace"
      
        viewBox="0 0 1224 41"
      >
      <g transform='translate(8,16)'>
<text text-anchor='middle' x='0' y='4' fill='currentColor' style='font-size:1em'>/</text>
<text text-anchor='middle' x='0' y='20' fill='currentColor' style='font-size:1em'>I</text>
<text text-anchor='middle' x='8' y='4' fill='currentColor' style='font-size:1em'>w</text>
<text text-anchor='middle' x='8' y='20' fill='currentColor' style='font-size:1em'>m</text>
<text text-anchor='middle' x='16' y='4' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='16' y='20' fill='currentColor' style='font-size:1em'>p</text>
<text text-anchor='middle' x='24' y='4' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='24' y='20' fill='currentColor' style='font-size:1em'>l</text>
<text text-anchor='middle' x='32' y='4' fill='currentColor' style='font-size:1em'>k</text>
<text text-anchor='middle' x='32' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='40' y='4' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='40' y='20' fill='currentColor' style='font-size:1em'>m</text>
<text text-anchor='middle' x='48' y='4' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='48' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='56' y='4' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='56' y='20' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='64' y='4' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='64' y='20' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='80' y='4' fill='currentColor' style='font-size:1em'>f</text>
<text text-anchor='middle' x='80' y='20' fill='currentColor' style='font-size:1em'>J</text>
<text text-anchor='middle' x='88' y='4' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='88' y='20' fill='currentColor' style='font-size:1em'>W</text>
<text text-anchor='middle' x='96' y='4' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='96' y='20' fill='currentColor' style='font-size:1em'>T</text>
<text text-anchor='middle' x='104' y='4' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='112' y='4' fill='currentColor' style='font-size:1em'>u</text>
<text text-anchor='middle' x='112' y='20' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='120' y='4' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='120' y='20' fill='currentColor' style='font-size:1em'>u</text>
<text text-anchor='middle' x='128' y='4' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='128' y='20' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='136' y='4' fill='currentColor' style='font-size:1em'>/</text>
<text text-anchor='middle' x='136' y='20' fill='currentColor' style='font-size:1em'>h</text>
<text text-anchor='middle' x='144' y='4' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='144' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='152' y='4' fill='currentColor' style='font-size:1em'>u</text>
<text text-anchor='middle' x='152' y='20' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='160' y='4' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='160' y='20' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='168' y='4' fill='currentColor' style='font-size:1em'>h</text>
<text text-anchor='middle' x='168' y='20' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='176' y='20' fill='currentColor' style='font-size:1em'>c</text>
<text text-anchor='middle' x='184' y='20' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='192' y='20' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='200' y='20' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='208' y='20' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='216' y='20' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='232' y='20' fill='currentColor' style='font-size:1em'>m</text>
<text text-anchor='middle' x='240' y='20' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='248' y='20' fill='currentColor' style='font-size:1em'>d</text>
<text text-anchor='middle' x='256' y='20' fill='currentColor' style='font-size:1em'>d</text>
<text text-anchor='middle' x='264' y='20' fill='currentColor' style='font-size:1em'>l</text>
<text text-anchor='middle' x='272' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='280' y='20' fill='currentColor' style='font-size:1em'>w</text>
<text text-anchor='middle' x='288' y='20' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='296' y='20' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='304' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='320' y='20' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='328' y='20' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='344' y='20' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='352' y='20' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='360' y='20' fill='currentColor' style='font-size:1em'>c</text>
<text text-anchor='middle' x='368' y='20' fill='currentColor' style='font-size:1em'>/</text>
<text text-anchor='middle' x='376' y='20' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='384' y='20' fill='currentColor' style='font-size:1em'>u</text>
<text text-anchor='middle' x='392' y='20' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='400' y='20' fill='currentColor' style='font-size:1em'>h</text>
<text text-anchor='middle' x='408' y='20' fill='currentColor' style='font-size:1em'>/</text>
<text text-anchor='middle' x='416' y='20' fill='currentColor' style='font-size:1em'>.</text>
<text text-anchor='middle' x='432' y='20' fill='currentColor' style='font-size:1em'>U</text>
<text text-anchor='middle' x='440' y='20' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='448' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='464' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='472' y='20' fill='currentColor' style='font-size:1em'>x</text>
<text text-anchor='middle' x='480' y='20' fill='currentColor' style='font-size:1em'>p</text>
<text text-anchor='middle' x='488' y='20' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='496' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='504' y='20' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='512' y='20' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='520' y='20' fill='currentColor' style='font-size:1em'>-</text>
<text text-anchor='middle' x='528' y='20' fill='currentColor' style='font-size:1em'>j</text>
<text text-anchor='middle' x='536' y='20' fill='currentColor' style='font-size:1em'>w</text>
<text text-anchor='middle' x='544' y='20' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='552' y='20' fill='currentColor' style='font-size:1em'>,</text>
<text text-anchor='middle' x='568' y='20' fill='currentColor' style='font-size:1em'>v</text>
<text text-anchor='middle' x='576' y='20' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='584' y='20' fill='currentColor' style='font-size:1em'>l</text>
<text text-anchor='middle' x='592' y='20' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='600' y='20' fill='currentColor' style='font-size:1em'>d</text>
<text text-anchor='middle' x='608' y='20' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='616' y='20' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='624' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='640' y='20' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='648' y='20' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='656' y='20' fill='currentColor' style='font-size:1em'>k</text>
<text text-anchor='middle' x='664' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='672' y='20' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='680' y='20' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='696' y='20' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='704' y='20' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='720' y='20' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='728' y='20' fill='currentColor' style='font-size:1em'>l</text>
<text text-anchor='middle' x='736' y='20' fill='currentColor' style='font-size:1em'>l</text>
<text text-anchor='middle' x='752' y='20' fill='currentColor' style='font-size:1em'>/</text>
<text text-anchor='middle' x='760' y='20' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='768' y='20' fill='currentColor' style='font-size:1em'>p</text>
<text text-anchor='middle' x='776' y='20' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='784' y='20' fill='currentColor' style='font-size:1em'>/</text>
<text text-anchor='middle' x='792' y='20' fill='currentColor' style='font-size:1em'>*</text>
<text text-anchor='middle' x='808' y='20' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='816' y='20' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='824' y='20' fill='currentColor' style='font-size:1em'>u</text>
<text text-anchor='middle' x='832' y='20' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='840' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='848' y='20' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='856' y='20' fill='currentColor' style='font-size:1em'>,</text>
<text text-anchor='middle' x='872' y='20' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='880' y='20' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='888' y='20' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='896' y='20' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='904' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='920' y='20' fill='currentColor' style='font-size:1em'>u</text>
<text text-anchor='middle' x='928' y='20' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='936' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='944' y='20' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='960' y='20' fill='currentColor' style='font-size:1em'>c</text>
<text text-anchor='middle' x='968' y='20' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='976' y='20' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='984' y='20' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='992' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='1000' y='20' fill='currentColor' style='font-size:1em'>x</text>
<text text-anchor='middle' x='1008' y='20' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='1024' y='20' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='1032' y='20' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='1048' y='20' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='1056' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='1064' y='20' fill='currentColor' style='font-size:1em'>q</text>
<text text-anchor='middle' x='1072' y='20' fill='currentColor' style='font-size:1em'>.</text>
<text text-anchor='middle' x='1080' y='20' fill='currentColor' style='font-size:1em'>u</text>
<text text-anchor='middle' x='1088' y='20' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='1096' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='1104' y='20' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='1112' y='20' fill='currentColor' style='font-size:1em'>.</text>
<text text-anchor='middle' x='1128' y='20' fill='currentColor' style='font-size:1em'>P</text>
<text text-anchor='middle' x='1136' y='20' fill='currentColor' style='font-size:1em'>l</text>
<text text-anchor='middle' x='1144' y='20' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='1152' y='20' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='1168' y='20' fill='currentColor' style='font-size:1em'>f</text>
<text text-anchor='middle' x='1176' y='20' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='1184' y='20' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='1192' y='20' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='1200' y='20' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='1208' y='20' fill='currentColor' style='font-size:1em'>.</text>
</g>

    </svg>
  
</div>
<p>In the second panel:</p>



<div class="goat svg-container ">
  
    <svg
      xmlns="http://www.w3.org/2000/svg"
      font-family="Menlo,Lucida Console,monospace"
      
        viewBox="0 0 1448 41"
      >
      <g transform='translate(8,16)'>
<text text-anchor='middle' x='0' y='4' fill='currentColor' style='font-size:1em'>/</text>
<text text-anchor='middle' x='0' y='20' fill='currentColor' style='font-size:1em'>I</text>
<text text-anchor='middle' x='8' y='4' fill='currentColor' style='font-size:1em'>w</text>
<text text-anchor='middle' x='8' y='20' fill='currentColor' style='font-size:1em'>m</text>
<text text-anchor='middle' x='16' y='4' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='16' y='20' fill='currentColor' style='font-size:1em'>p</text>
<text text-anchor='middle' x='24' y='4' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='24' y='20' fill='currentColor' style='font-size:1em'>l</text>
<text text-anchor='middle' x='32' y='4' fill='currentColor' style='font-size:1em'>k</text>
<text text-anchor='middle' x='32' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='40' y='4' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='40' y='20' fill='currentColor' style='font-size:1em'>m</text>
<text text-anchor='middle' x='48' y='4' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='48' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='56' y='4' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='56' y='20' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='64' y='4' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='64' y='20' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='80' y='4' fill='currentColor' style='font-size:1em'>f</text>
<text text-anchor='middle' x='80' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='88' y='4' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='88' y='20' fill='currentColor' style='font-size:1em'>m</text>
<text text-anchor='middle' x='96' y='4' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='96' y='20' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='104' y='4' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='104' y='20' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='112' y='4' fill='currentColor' style='font-size:1em'>u</text>
<text text-anchor='middle' x='112' y='20' fill='currentColor' style='font-size:1em'>l</text>
<text text-anchor='middle' x='120' y='4' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='128' y='4' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='128' y='20' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='136' y='4' fill='currentColor' style='font-size:1em'>/</text>
<text text-anchor='middle' x='136' y='20' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='144' y='4' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='144' y='20' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='152' y='4' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='152' y='20' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='160' y='4' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='160' y='20' fill='currentColor' style='font-size:1em'>f</text>
<text text-anchor='middle' x='168' y='4' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='168' y='20' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='176' y='4' fill='currentColor' style='font-size:1em'>f</text>
<text text-anchor='middle' x='176' y='20' fill='currentColor' style='font-size:1em'>c</text>
<text text-anchor='middle' x='184' y='4' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='184' y='20' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='192' y='4' fill='currentColor' style='font-size:1em'>c</text>
<text text-anchor='middle' x='192' y='20' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='200' y='4' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='200' y='20' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='208' y='4' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='208' y='20' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='216' y='4' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='216' y='20' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='224' y='4' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='232' y='4' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='232' y='20' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='240' y='4' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='240' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='248' y='20' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='256' y='20' fill='currentColor' style='font-size:1em'>v</text>
<text text-anchor='middle' x='264' y='20' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='272' y='20' fill='currentColor' style='font-size:1em'>c</text>
<text text-anchor='middle' x='280' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='296' y='20' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='304' y='20' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='320' y='20' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='328' y='20' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='336' y='20' fill='currentColor' style='font-size:1em'>c</text>
<text text-anchor='middle' x='344' y='20' fill='currentColor' style='font-size:1em'>/</text>
<text text-anchor='middle' x='352' y='20' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='360' y='20' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='368' y='20' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='376' y='20' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='384' y='20' fill='currentColor' style='font-size:1em'>f</text>
<text text-anchor='middle' x='392' y='20' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='400' y='20' fill='currentColor' style='font-size:1em'>c</text>
<text text-anchor='middle' x='408' y='20' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='416' y='20' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='424' y='20' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='432' y='20' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='440' y='20' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='448' y='20' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='456' y='20' fill='currentColor' style='font-size:1em'>/</text>
<text text-anchor='middle' x='464' y='20' fill='currentColor' style='font-size:1em'>.</text>
<text text-anchor='middle' x='480' y='20' fill='currentColor' style='font-size:1em'>U</text>
<text text-anchor='middle' x='488' y='20' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='496' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='512' y='20' fill='currentColor' style='font-size:1em'>N</text>
<text text-anchor='middle' x='520' y='20' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='528' y='20' fill='currentColor' style='font-size:1em'>d</text>
<text text-anchor='middle' x='536' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='544' y='20' fill='currentColor' style='font-size:1em'>m</text>
<text text-anchor='middle' x='552' y='20' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='560' y='20' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='568' y='20' fill='currentColor' style='font-size:1em'>l</text>
<text text-anchor='middle' x='576' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='584' y='20' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='592' y='20' fill='currentColor' style='font-size:1em'>,</text>
<text text-anchor='middle' x='608' y='20' fill='currentColor' style='font-size:1em'>q</text>
<text text-anchor='middle' x='616' y='20' fill='currentColor' style='font-size:1em'>u</text>
<text text-anchor='middle' x='624' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='632' y='20' fill='currentColor' style='font-size:1em'>u</text>
<text text-anchor='middle' x='640' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='656' y='20' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='664' y='20' fill='currentColor' style='font-size:1em'>u</text>
<text text-anchor='middle' x='672' y='20' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='680' y='20' fill='currentColor' style='font-size:1em'>b</text>
<text text-anchor='middle' x='688' y='20' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='696' y='20' fill='currentColor' style='font-size:1em'>u</text>
<text text-anchor='middle' x='704' y='20' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='712' y='20' fill='currentColor' style='font-size:1em'>d</text>
<text text-anchor='middle' x='728' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='736' y='20' fill='currentColor' style='font-size:1em'>m</text>
<text text-anchor='middle' x='744' y='20' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='752' y='20' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='760' y='20' fill='currentColor' style='font-size:1em'>l</text>
<text text-anchor='middle' x='768' y='20' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='784' y='20' fill='currentColor' style='font-size:1em'>v</text>
<text text-anchor='middle' x='792' y='20' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='800' y='20' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='816' y='20' fill='currentColor' style='font-size:1em'>B</text>
<text text-anchor='middle' x='824' y='20' fill='currentColor' style='font-size:1em'>u</text>
<text text-anchor='middle' x='832' y='20' fill='currentColor' style='font-size:1em'>l</text>
<text text-anchor='middle' x='840' y='20' fill='currentColor' style='font-size:1em'>l</text>
<text text-anchor='middle' x='848' y='20' fill='currentColor' style='font-size:1em'>,</text>
<text text-anchor='middle' x='864' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='872' y='20' fill='currentColor' style='font-size:1em'>x</text>
<text text-anchor='middle' x='880' y='20' fill='currentColor' style='font-size:1em'>p</text>
<text text-anchor='middle' x='888' y='20' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='896' y='20' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='904' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='920' y='20' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='928' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='936' y='20' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='944' y='20' fill='currentColor' style='font-size:1em'>d</text>
<text text-anchor='middle' x='952' y='20' fill='currentColor' style='font-size:1em'>W</text>
<text text-anchor='middle' x='960' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='968' y='20' fill='currentColor' style='font-size:1em'>l</text>
<text text-anchor='middle' x='976' y='20' fill='currentColor' style='font-size:1em'>c</text>
<text text-anchor='middle' x='984' y='20' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='992' y='20' fill='currentColor' style='font-size:1em'>m</text>
<text text-anchor='middle' x='1000' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='1008' y='20' fill='currentColor' style='font-size:1em'>E</text>
<text text-anchor='middle' x='1016' y='20' fill='currentColor' style='font-size:1em'>m</text>
<text text-anchor='middle' x='1024' y='20' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='1032' y='20' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='1040' y='20' fill='currentColor' style='font-size:1em'>l</text>
<text text-anchor='middle' x='1048' y='20' fill='currentColor' style='font-size:1em'>(</text>
<text text-anchor='middle' x='1056' y='20' fill='currentColor' style='font-size:1em'>)</text>
<text text-anchor='middle' x='1072' y='20' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='1080' y='20' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='1088' y='20' fill='currentColor' style='font-size:1em'>d</text>
<text text-anchor='middle' x='1104' y='20' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='1112' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='1120' y='20' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='1128' y='20' fill='currentColor' style='font-size:1em'>d</text>
<text text-anchor='middle' x='1136' y='20' fill='currentColor' style='font-size:1em'>P</text>
<text text-anchor='middle' x='1144' y='20' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='1152' y='20' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='1160' y='20' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='1168' y='20' fill='currentColor' style='font-size:1em'>w</text>
<text text-anchor='middle' x='1176' y='20' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='1184' y='20' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='1192' y='20' fill='currentColor' style='font-size:1em'>d</text>
<text text-anchor='middle' x='1200' y='20' fill='currentColor' style='font-size:1em'>R</text>
<text text-anchor='middle' x='1208' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='1216' y='20' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='1224' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='1232' y='20' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='1240' y='20' fill='currentColor' style='font-size:1em'>(</text>
<text text-anchor='middle' x='1248' y='20' fill='currentColor' style='font-size:1em'>)</text>
<text text-anchor='middle' x='1264' y='20' fill='currentColor' style='font-size:1em'>f</text>
<text text-anchor='middle' x='1272' y='20' fill='currentColor' style='font-size:1em'>u</text>
<text text-anchor='middle' x='1280' y='20' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='1288' y='20' fill='currentColor' style='font-size:1em'>c</text>
<text text-anchor='middle' x='1296' y='20' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='1304' y='20' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='1312' y='20' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='1320' y='20' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='1328' y='20' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='1336' y='20' fill='currentColor' style='font-size:1em'>.</text>
<text text-anchor='middle' x='1352' y='20' fill='currentColor' style='font-size:1em'>P</text>
<text text-anchor='middle' x='1360' y='20' fill='currentColor' style='font-size:1em'>l</text>
<text text-anchor='middle' x='1368' y='20' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='1376' y='20' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='1392' y='20' fill='currentColor' style='font-size:1em'>f</text>
<text text-anchor='middle' x='1400' y='20' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='1408' y='20' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='1416' y='20' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='1424' y='20' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='1432' y='20' fill='currentColor' style='font-size:1em'>.</text>
</g>

    </svg>
  
</div>
<p>Cursor creates two worktrees: <code>~/.cursor/worktrees/feature-auth</code> and <code>~/.cursor/worktrees/feature-notifications</code>. Both agents enter Plan Mode. You review <code>feature/auth</code>&rsquo;s plan (confirm the middleware signature, approve), then review <code>feature/notifications</code>&rsquo;s plan (confirm the queue configuration, approve). Both agents execute in parallel. Fifteen minutes later, you have two independent feature branches, each with passing tests, ready for your review. You run <code>/apply-worktree feature/auth</code>, review the diff, merge. Then <code>/apply-worktree feature/notifications</code>, review, merge. Total wall-clock time: roughly the duration of the longer agent run, not the sum of both.</p>
<h2 id="using-best-of-n-for-model-comparison">Using <code>/best-of-n</code> for Model Comparison</h2>
<p>The <code>/best-of-n</code> command is most valuable when you face a decision point where the implementation strategy matters: algorithm selection, API design, query optimization. Example usage for a performance-critical route:</p>



<div class="goat svg-container ">
  
    <svg
      xmlns="http://www.w3.org/2000/svg"
      font-family="Menlo,Lucida Console,monospace"
      
        viewBox="0 0 1120 41"
      >
      <g transform='translate(8,16)'>
<text text-anchor='middle' x='0' y='4' fill='currentColor' style='font-size:1em'>/</text>
<text text-anchor='middle' x='0' y='20' fill='currentColor' style='font-size:1em'>R</text>
<text text-anchor='middle' x='8' y='4' fill='currentColor' style='font-size:1em'>b</text>
<text text-anchor='middle' x='8' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='16' y='4' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='16' y='20' fill='currentColor' style='font-size:1em'>f</text>
<text text-anchor='middle' x='24' y='4' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='24' y='20' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='32' y='4' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='32' y='20' fill='currentColor' style='font-size:1em'>c</text>
<text text-anchor='middle' x='40' y='4' fill='currentColor' style='font-size:1em'>-</text>
<text text-anchor='middle' x='40' y='20' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='48' y='4' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='48' y='20' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='56' y='4' fill='currentColor' style='font-size:1em'>f</text>
<text text-anchor='middle' x='56' y='20' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='64' y='4' fill='currentColor' style='font-size:1em'>-</text>
<text text-anchor='middle' x='72' y='4' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='72' y='20' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='80' y='20' fill='currentColor' style='font-size:1em'>h</text>
<text text-anchor='middle' x='88' y='4' fill='currentColor' style='font-size:1em'>3</text>
<text text-anchor='middle' x='88' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='104' y='20' fill='currentColor' style='font-size:1em'>/</text>
<text text-anchor='middle' x='112' y='20' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='120' y='20' fill='currentColor' style='font-size:1em'>p</text>
<text text-anchor='middle' x='128' y='20' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='136' y='20' fill='currentColor' style='font-size:1em'>/</text>
<text text-anchor='middle' x='144' y='20' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='152' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='160' y='20' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='168' y='20' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='176' y='20' fill='currentColor' style='font-size:1em'>c</text>
<text text-anchor='middle' x='184' y='20' fill='currentColor' style='font-size:1em'>h</text>
<text text-anchor='middle' x='200' y='20' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='208' y='20' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='216' y='20' fill='currentColor' style='font-size:1em'>u</text>
<text text-anchor='middle' x='224' y='20' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='232' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='248' y='20' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='256' y='20' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='272' y='20' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='280' y='20' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='288' y='20' fill='currentColor' style='font-size:1em'>c</text>
<text text-anchor='middle' x='296' y='20' fill='currentColor' style='font-size:1em'>/</text>
<text text-anchor='middle' x='304' y='20' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='312' y='20' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='320' y='20' fill='currentColor' style='font-size:1em'>u</text>
<text text-anchor='middle' x='328' y='20' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='336' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='344' y='20' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='352' y='20' fill='currentColor' style='font-size:1em'>/</text>
<text text-anchor='middle' x='360' y='20' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='368' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='376' y='20' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='384' y='20' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='392' y='20' fill='currentColor' style='font-size:1em'>c</text>
<text text-anchor='middle' x='400' y='20' fill='currentColor' style='font-size:1em'>h</text>
<text text-anchor='middle' x='408' y='20' fill='currentColor' style='font-size:1em'>.</text>
<text text-anchor='middle' x='416' y='20' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='424' y='20' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='440' y='20' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='448' y='20' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='464' y='20' fill='currentColor' style='font-size:1em'>h</text>
<text text-anchor='middle' x='472' y='20' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='480' y='20' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='488' y='20' fill='currentColor' style='font-size:1em'>d</text>
<text text-anchor='middle' x='496' y='20' fill='currentColor' style='font-size:1em'>l</text>
<text text-anchor='middle' x='504' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='520' y='20' fill='currentColor' style='font-size:1em'>1</text>
<text text-anchor='middle' x='528' y='20' fill='currentColor' style='font-size:1em'>0</text>
<text text-anchor='middle' x='536' y='20' fill='currentColor' style='font-size:1em'>,</text>
<text text-anchor='middle' x='544' y='20' fill='currentColor' style='font-size:1em'>0</text>
<text text-anchor='middle' x='552' y='20' fill='currentColor' style='font-size:1em'>0</text>
<text text-anchor='middle' x='560' y='20' fill='currentColor' style='font-size:1em'>0</text>
<text text-anchor='middle' x='576' y='20' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='584' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='592' y='20' fill='currentColor' style='font-size:1em'>q</text>
<text text-anchor='middle' x='600' y='20' fill='currentColor' style='font-size:1em'>/</text>
<text text-anchor='middle' x='608' y='20' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='616' y='20' fill='currentColor' style='font-size:1em'>.</text>
<text text-anchor='middle' x='632' y='20' fill='currentColor' style='font-size:1em'>C</text>
<text text-anchor='middle' x='640' y='20' fill='currentColor' style='font-size:1em'>u</text>
<text text-anchor='middle' x='648' y='20' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='656' y='20' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='664' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='672' y='20' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='680' y='20' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='688' y='20' fill='currentColor' style='font-size:1em'>l</text>
<text text-anchor='middle' x='696' y='20' fill='currentColor' style='font-size:1em'>y</text>
<text text-anchor='middle' x='712' y='20' fill='currentColor' style='font-size:1em'>u</text>
<text text-anchor='middle' x='720' y='20' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='728' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='736' y='20' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='752' y='20' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='760' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='768' y='20' fill='currentColor' style='font-size:1em'>q</text>
<text text-anchor='middle' x='776' y='20' fill='currentColor' style='font-size:1em'>u</text>
<text text-anchor='middle' x='784' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='792' y='20' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='800' y='20' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='808' y='20' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='816' y='20' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='824' y='20' fill='currentColor' style='font-size:1em'>l</text>
<text text-anchor='middle' x='840' y='20' fill='currentColor' style='font-size:1em'>D</text>
<text text-anchor='middle' x='848' y='20' fill='currentColor' style='font-size:1em'>B</text>
<text text-anchor='middle' x='864' y='20' fill='currentColor' style='font-size:1em'>q</text>
<text text-anchor='middle' x='872' y='20' fill='currentColor' style='font-size:1em'>u</text>
<text text-anchor='middle' x='880' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='888' y='20' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='896' y='20' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='904' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='912' y='20' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='920' y='20' fill='currentColor' style='font-size:1em'>.</text>
<text text-anchor='middle' x='936' y='20' fill='currentColor' style='font-size:1em'>O</text>
<text text-anchor='middle' x='944' y='20' fill='currentColor' style='font-size:1em'>p</text>
<text text-anchor='middle' x='952' y='20' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='960' y='20' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='968' y='20' fill='currentColor' style='font-size:1em'>m</text>
<text text-anchor='middle' x='976' y='20' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='984' y='20' fill='currentColor' style='font-size:1em'>z</text>
<text text-anchor='middle' x='992' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='1008' y='20' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='1016' y='20' fill='currentColor' style='font-size:1em'>g</text>
<text text-anchor='middle' x='1024' y='20' fill='currentColor' style='font-size:1em'>g</text>
<text text-anchor='middle' x='1032' y='20' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='1040' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='1048' y='20' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='1056' y='20' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='1064' y='20' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='1072' y='20' fill='currentColor' style='font-size:1em'>v</text>
<text text-anchor='middle' x='1080' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='1088' y='20' fill='currentColor' style='font-size:1em'>l</text>
<text text-anchor='middle' x='1096' y='20' fill='currentColor' style='font-size:1em'>y</text>
<text text-anchor='middle' x='1104' y='20' fill='currentColor' style='font-size:1em'>.</text>
</g>

    </svg>
  
</div>
<p>Cursor spawns three worktrees, assigns each to a different model, and runs all three concurrently. You might get:</p>
<ul>
<li><strong>Model A</strong>: Database connection pooling + query batching</li>
<li><strong>Model B</strong>: Redis caching layer in front of DB</li>
<li><strong>Model C</strong>: Elasticsearch migration with Redis cache</li>
</ul>
<p>Each diff is reviewable independently. You benchmark or inspect the approaches, then run <code>/apply-worktree</code> on the winner. The cost is the same API tokens you&rsquo;d spend on three sequential attempts — but the wall-clock time collapses to one attempt&rsquo;s worth.</p>
<h3 id="choosing-n-for-best-of-n">Choosing N for <code>/best-of-n</code></h3>
<table>
  <thead>
      <tr>
          <th>Task Complexity</th>
          <th>Recommended N</th>
          <th>Reason</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Simple refactor</td>
          <td>2</td>
          <td>Low variance across models; 2 is enough signal</td>
      </tr>
      <tr>
          <td>Algorithmic problem</td>
          <td>3–4</td>
          <td>Models diverge meaningfully; more samples needed</td>
      </tr>
      <tr>
          <td>Architecture decision</td>
          <td>3</td>
          <td>Review overhead grows with N; 3 balances signal/cost</td>
      </tr>
      <tr>
          <td>Boilerplate generation</td>
          <td>1</td>
          <td>No comparison value; just run the fast model</td>
      </tr>
  </tbody>
</table>
<h2 id="risk-management-when-worktrees-protect-you">Risk Management: When Worktrees Protect You</h2>
<p>Worktrees are not just a productivity feature — they are a risk management tool. The scenarios where they provide the clearest safety benefit:</p>
<p><strong>Large refactors</strong>: An agent tasked with extracting a monolith service into microservices will touch dozens of files. If it goes wrong, recovery without a worktree means <code>git reset --hard</code> and lost context. With a worktree, you simply <code>/delete-worktree</code> and the main codebase is unaffected.</p>
<p><strong>Dependency upgrades</strong>: Package upgrades often cascade — a major version bump triggers breaking changes across multiple consumers. Running the upgrade agent in a worktree lets you inspect the full blast radius before any change lands in <code>main</code>.</p>
<p><strong>Database migrations</strong>: Any agent generating Prisma migrations or raw SQL should run in a worktree. Migrations are frequently irreversible; reviewing the generated SQL before running it is non-negotiable.</p>
<p><strong>Third-party API integrations</strong>: Agents that generate API client code and test against real endpoints can create unintended side effects (test data in production, rate limit exhaustion). Isolating these runs in worktrees makes it easier to identify and attribute side effects.</p>
<h2 id="team-adoption-patterns">Team Adoption Patterns</h2>
<p>Scaling parallel agent workflows across a development team requires light conventions to prevent chaos. The most common patterns observed in 2026 practice:</p>
<p><strong>Naming convention</strong>: Prefix all agent worktree branches with <code>agent/</code> — e.g., <code>agent/feature/auth</code>, <code>agent/fix/login-bug</code>. This makes agent-spawned branches immediately distinguishable from human-authored ones in Git history and PR queues.</p>
<p><strong>Review gates</strong>: Require all worktree-sourced branches to pass CI before <code>/apply-worktree</code> is allowed. Cursor&rsquo;s integration with GitHub Actions means you can enforce this with a branch protection rule targeting the <code>agent/*</code> prefix.</p>
<p><strong>Agent ownership</strong>: Assign one human reviewer per running agent. In a team of four, you can safely run four parallel agents — one per person watching the Agents Window. Beyond that, review becomes the bottleneck, not agent capacity.</p>
<p><strong>Shared utilities freeze</strong>: When multiple agents are running simultaneously, put a soft freeze on shared utilities (<code>src/utils/</code>, <code>src/types/</code>). Agents should not modify shared modules in parallel; route those changes through a single sequential agent after the parallel feature work is reviewed and merged.</p>
<h2 id="integration-with-cicd-and-code-review">Integration with CI/CD and Code Review</h2>
<p>Worktree-generated branches are standard Git branches that integrate seamlessly with existing CI/CD pipelines, requiring zero changes to your tooling. When an agent completes its task inside a Cursor worktree, the result lives on a real branch — push it to remote and GitHub Actions, CircleCI, or Jenkins fires exactly as it would for a human-authored branch. A 2026 best practice observed across teams using Cursor 3 is to prefix all agent branches with <code>agent/</code> (e.g., <code>agent/feature/auth</code>), then set a branch protection rule requiring CI to pass before <code>/apply-worktree</code> is permitted. This single convention turns worktrees from a local developer tool into a CI-enforced quality gate: no agent-generated code lands in <code>main</code> without passing tests and type checks. Code review tools like GitHub Pull Requests, Linear, and Reviewpad treat agent branches identically to human branches — reviewers see clean diffs, comment inline, and approve or reject without knowing or caring whether an AI or a human wrote the code. The recommended handoff pattern:</p>
<ol>
<li>Agent completes in worktree</li>
<li>Cursor pushes the worktree branch to remote (<code>git push origin agent/feature/auth</code>)</li>
<li>CI runs automatically on the pushed branch (tests, linting, type-checking)</li>
<li>If CI passes, open a PR from the agent branch into <code>main</code></li>
<li>Human reviewer approves and merges</li>
<li>Run <code>/delete-worktree</code> to clean up the local worktree</li>
</ol>
<p>This pattern keeps the agent-authored code path identical to the human-authored code path for all downstream tooling. Code review tools, PR templates, and deployment pipelines require no modification.</p>
<h2 id="common-pitfalls-and-how-to-avoid-them">Common Pitfalls and How to Avoid Them</h2>
<p><strong>Forgetting to clean up worktrees</strong>: Each active worktree holds a full checkout of the repo. On large codebases, ten forgotten worktrees can consume several gigabytes. Run <code>git worktree list</code> periodically and use <code>/delete-worktree</code> (or <code>git worktree remove</code>) to prune stale ones.</p>
<p><strong>Agents modifying the same shared file</strong>: Even with worktrees, if two agents both edit <code>src/config/constants.ts</code>, you will face a merge conflict when applying the second agent&rsquo;s changes. The solution is pre-assignment: review the agents&rsquo; plans before approving execution and flag any overlap in the touched file lists.</p>
<p><strong>Missing context across worktrees</strong>: An agent in a worktree doesn&rsquo;t automatically know what another agent is doing in a different worktree. If <code>feature/auth</code> and <code>feature/notifications</code> both need to register new Express routes, coordinate via the plans — have each agent&rsquo;s plan explicitly declare the route it will register to catch conflicts before execution.</p>
<p><strong>Using worktrees for trivial tasks</strong>: Spawning a worktree for a one-line fix adds overhead — branch creation, directory copy, apply step — that outweighs the benefit. Reserve worktrees for tasks that take more than a few minutes or touch more than two files.</p>
<h2 id="cursor-worktrees-vs-claude-code-multi-agent-approaches">Cursor Worktrees vs. Claude Code Multi-Agent Approaches</h2>
<p>Both Cursor and Claude Code have moved toward multi-agent orchestration in 2026, but their models differ.</p>
<table>
  <thead>
      <tr>
          <th>Dimension</th>
          <th>Cursor Worktrees</th>
          <th>Claude Code Multi-Agent</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Isolation unit</td>
          <td>Git worktree (file-level)</td>
          <td>Subagent + worktree (via Agent tool)</td>
      </tr>
      <tr>
          <td>UI</td>
          <td>Agents Window (visual, in-editor)</td>
          <td>CLI-based, spawned via <code>Agent()</code></td>
      </tr>
      <tr>
          <td>Model choice</td>
          <td>Multi-model via <code>/best-of-n</code></td>
          <td>Single model per session (configurable)</td>
      </tr>
      <tr>
          <td>Human review step</td>
          <td>Explicit via Agents Window</td>
          <td>Delegated to parent agent or human</td>
      </tr>
      <tr>
          <td>Best for</td>
          <td>Feature-parallel development</td>
          <td>Complex, hierarchical task decomposition</td>
      </tr>
  </tbody>
</table>
<p>Cursor&rsquo;s approach optimizes for developer visibility: you see every agent&rsquo;s status in a sidebar. Claude Code&rsquo;s approach optimizes for composability: agents can spawn sub-agents recursively, enabling deeper task decomposition. The practical choice comes down to whether you need visual oversight (Cursor) or programmatic control (Claude Code). Many teams in 2026 use both: Cursor for day-to-day feature parallelism, Claude Code for automated pipeline tasks where human oversight is less frequent.</p>
<h2 id="faq">FAQ</h2>
<p>The following questions address the most common points of confusion when adopting Cursor worktrees for parallel AI agent development. Each answer is self-contained and reflects Cursor 3 (Glass) behavior as of April 2026. The core principle to keep in mind: every <code>/worktree</code> invocation creates a real, independent Git branch in a separate directory — it is not a virtual sandbox or a snapshot. Changes are real, branches are real, and the Git history is real. This means all standard Git operations (push, diff, log, merge) work exactly as expected on worktree branches. Cursor&rsquo;s slash commands (<code>/apply-worktree</code>, <code>/delete-worktree</code>) are convenience wrappers around <code>git worktree add/remove</code> and standard merge operations — understanding the underlying Git primitives helps you debug edge cases that the UI doesn&rsquo;t expose. Whether you are new to worktrees or migrating a team from sequential single-agent workflows, these answers cover the setup, operation, and cleanup questions that come up most often in practice.</p>
<h3 id="what-is-the-worktree-command-in-cursor">What is the <code>/worktree</code> command in Cursor?</h3>
<p>The <code>/worktree</code> command in Cursor creates an isolated Git worktree — a separate directory checkout of your repository on a new branch — and runs the AI agent&rsquo;s task entirely within that sandbox. Your main working directory is untouched until you run <code>/apply-worktree</code> to bring the changes back. It is the primary mechanism for running experimental or risky agent tasks without fear of permanently altering your codebase.</p>
<h3 id="can-i-run-multiple-agents-at-the-same-time-in-cursor">Can I run multiple agents at the same time in Cursor?</h3>
<p>Yes. With Cursor 3 (Glass), you can run multiple agents simultaneously using the Agents Window. Each agent operates in its own Git worktree — an isolated directory on a separate branch — so they cannot conflict with each other&rsquo;s file changes. You manage all running agents from the Agents Window sidebar and apply or discard their results independently.</p>
<h3 id="what-does-best-of-n-do-in-cursor">What does <code>/best-of-n</code> do in Cursor?</h3>
<p>The <code>/best-of-n</code> command sends the same task to N different AI models simultaneously, each running in its own isolated worktree. When all agents finish, you compare the results side by side and use <code>/apply-worktree</code> to merge the best outcome into your main checkout. It is designed for scenarios where the optimal implementation approach is unclear and you want empirical comparison rather than picking a model by reputation.</p>
<h3 id="do-cursor-worktrees-work-with-existing-cicd-pipelines">Do Cursor worktrees work with existing CI/CD pipelines?</h3>
<p>Yes. Worktree-generated branches are standard Git branches and trigger existing CI/CD pipelines when pushed to remote. The recommended pattern is: agent finishes in worktree → push branch to remote → CI runs → if passed, open PR → human reviews → merges to main → delete worktree. No changes to your CI configuration are required.</p>
<h3 id="how-do-i-clean-up-cursor-worktrees">How do I clean up Cursor worktrees?</h3>
<p>Run <code>/delete-worktree &lt;branch-name&gt;</code> inside Cursor to remove a worktree and its associated branch. Alternatively, use <code>git worktree remove &lt;path&gt;</code> and <code>git branch -d &lt;branch&gt;</code> from the terminal. Run <code>git worktree list</code> to see all active worktrees. It is good practice to clean up after each merged or rejected agent run to avoid disk accumulation on large repositories.</p>
]]></content:encoded></item></channel></rss>