Worktrees for agents and PM loops

Make worktrees actually usable in the AI era.

runtree keeps each branch isolated with its own port, logs, browser, and editor entrypoint. Run your branch, let an agent work on another, then share the right preview with a PM without changing CI.

No containers No preview-env dependency No CI redesign

Install

macOS and Linux, no daemon, no container dependency.

curl -fsSL https://raw.githubusercontent.com/EmilienDreyfus/runtree/main/install.sh | sh

What each worktree gets

  • One port per worktree
  • One log stream per instance
  • One browser and editor entrypoint per branch
01

Stabilize each worktree

List existing worktrees, assign ports once, and keep branch runtime state separate.

02

Run AI work in parallel

Keep your branch running while Codex, Cursor, or Claude Code works in another isolated worktree.

03

Share the right branch

Expose a live branch to PM or QA when feedback matters, without changing your CI flow.

Why this exists

Git worktrees are powerful. The local runtime around them is still primitive.

Ports collide

Each new branch means another manual port hunt and another fragile terminal tab.

Agents amplify the mess

The moment an AI agent owns one worktree, your editor, logs, and URLs need stronger isolation.

Preview environments are too heavy for every loop

You should not need a CI detour to let a PM validate one branch before the final integration pass.

Interactive CLI demo

Your branches need a real runtime layer.

$ runtree init --name newProject --run-command "npm run dev -- --port {port}"
initialized newProject at /repo/.runtree.yaml
Project newProject

One config captures the run command and port range.

Port range :8100-:8199

Every worktree gets a predictable local slot.

For dev teams that already feel the pressure

Faster feedback before CI even enters the loop.

For solo builders

Keep shipping while an agent explores a risky branch without stealing your main runtime.

For team leads

Show an architecture refactor locally, with logs and browser state isolated enough to be trusted.

For PM loops

Share a live branch when the product question is ready, without waiting for a full preview pipeline.

Start with local worktrees

Run branches side by side. Share one when PM feedback is needed.

runtree makes worktrees usable first: stable ports, logs, browser, and editor entrypoints. Sharing is optional until a branch is ready for review.

Install

macOS and Linux, no daemon, no container dependency.

curl -fsSL https://raw.githubusercontent.com/EmilienDreyfus/runtree/main/install.sh | sh