---
title: "Lanes & worktrees"
description: "How PaneScale isolates parallel agents with Git worktrees, how branches are named, and what Keep, Merge and Discard do when a lane is finished."
url: "https://panescale.com/docs/lanes"
updated: "2026-10-14"
---

# Lanes & worktrees

How PaneScale isolates parallel agents with Git worktrees, how branches are named, and what Keep, Merge and Discard do when a lane is finished.

Two agents editing the same files at the same time is a recipe for confusion. A **lane** solves that: it is a Git worktree with its own branch, created from your current commit, where one agent can work without seeing — or breaking — anyone else’s changes. Your own working copy stays exactly as it is.

## Where lanes come from

| Created by | When |
| --- | --- |
| **A pane** | You turn on **Isolated worktree** in the pane picker, or a [launch set](https://panescale.com/docs/code#launch-sets) asks for it |
| **A chat thread** | You start a **Thread with its own worktree** in [Chat](https://panescale.com/docs/chat#threads) |
| **The Overnight Autopilot** | Every task gets its own lane, plus one for the baseline measurement |
| **Point & Fix** | Every change runs in a lane that includes your uncommitted work |

Worktrees need a Git repository. In a folder without Git, the **Isolated worktree** switch is disabled.

## How a lane is created

PaneScale:

1. reads your current commit (`HEAD`),
2. creates a new branch from it,
3. adds a worktree for that branch in PaneScale’s data folder.

| Created by | Branch name |
| --- | --- |
| Panes and chat threads | `panescale/grid/<run>/<label>` |
| Overnight Autopilot | `panescale/autopilot/<label>-<run>` |

Worktrees live in short paths in the `w` folder of PaneScale’s data folder (on Windows `%APPDATA%\com.sherobi.panescale\w\`) to stay clear of Windows path-length limits. Your repository only gains the branch and the worktree registration — your working copy is not touched.

> **Uncommitted changes**
>
> A lane normally starts from your last commit. If an agent should see work you haven’t committed yet, commit it first. Point & Fix always copies your uncommitted work into its lane, and the autopilot can do the same with **Include uncommitted changes**.

## Working in a lane

A pane in a lane shows **Worktree** in its header and a branch icon in the sidebar. The agent’s working directory is the worktree, so everything it does — edits, commands, commits — happens on the lane’s branch. You can open the worktree folder in Explorer, run its dev server in a terminal pane, or open it as a project of its own to browse it in the [files panel](https://panescale.com/docs/side-panel#files).

## Closing a lane

When you close a pane that has an open lane — or choose **Finish worktree …** in its menu — PaneScale shows the lane plan with the number of changed files, lines added and removed, and the full diff:

| Choice | What happens |
| --- | --- |
| **Keep** | The changes are committed on the lane’s branch as `panescale: <label>`. Nothing is merged or pushed; the branch stays for later. |
| **Merge** | The changes come into your current branch — by **cherry-pick** (default), **fast-forward** or **apply only** (as uncommitted changes). You confirm the exact method in a [signed one-time approval](https://panescale.com/docs/approvals). |
| **Discard** | The worktree and the branch are removed, after one more confirmation. This can’t be undone. |
| **Later** | Nothing happens — the dialog closes, the pane keeps running and the lane stays open. |

Nothing is merged, pushed or deleted without your choice. If a merge conflicts with changes you made in the meantime, PaneScale stops and tells you instead of guessing.

## Dependencies in lanes

A fresh worktree has no `node_modules` or other build output. For the autopilot and Point & Fix, PaneScale links the `node_modules` folders of your main working copy — at the root and one level deeper — into the lane, so checks can run immediately without a fresh install. The links are directory junctions on Windows and symbolic links on macOS and Linux; nothing is copied.

## Cleaning up

Lanes you kept accumulate over time. **Settings → Storage** lists leftover worktrees with their size and whether they still belong to a run. Open lanes are never offered for deletion. Select the ones you no longer need and click **Remove selection**, or **Rescan**. The autopilot report has its own button to remove all worktrees of a night.
