# Puddle

> Pair your other devices with this Mac by QR code or link, choose what each may do, and open their sessions and files from here.

Your **puddle** is this Mac plus the devices you have paired with it: your other Macs running Flow, and Flow on your iPhone. The Puddle page is where you pair a device (by QR code or link), decide what each paired device may do here, and see who is watching your sessions right now. Once devices are paired, their sessions show up in your sidebar and you can open them in local panes, browse their files, or mount a folder of theirs in Finder.

> **Note:** Puddles is an experiment (BETA). Turn it on in Settings › Experiments (`features.remote`). While it is off, the Puddle page, its Tools row and its actions are hidden, nothing listens for other devices, and the `puddle.*` settings are left out of Settings.

This page covers the Puddle page and what you do with paired devices in the app. For how devices connect, the `flow-remote` command line, what syncs and the security model, see [Sync and devices overview](https://flow.worldbreakstudios.com/docs/sync/overview.md), [Pair devices with flow-remote](https://flow.worldbreakstudios.com/docs/sync/flow-remote.md), [Security and trust](https://flow.worldbreakstudios.com/docs/sync/security.md) and [Flow for iPhone](https://flow.worldbreakstudios.com/docs/sync/mobile.md).

## Open the Puddle page

1. Open Settings (`⌘,`), go to **Experiments** and switch on **Puddles**.
2. Open the page in any of these ways:
   - press `⌃⌥⌘2` (**Go to Puddle**, rebindable as `keyboard.go_to_puddle`);
   - click **Puddle** in the sidebar's Tools band;
   - run **Invite a device to your puddle…** from the command palette (`⇧⌘P`; it has no default shortcut, bind one as `keyboard.puddle_invite`), which opens the page and starts an invite;
   - run `flow-cli page puddle`.

While Puddles is on, Flow runs the Puddle service (the `flow-remote` daemon) in the background. It adopts a service that is already running, restarts it when you change the network or port, and stops it when you turn Puddles off, if Flow started it. The service keeps running after you quit Flow, so your other devices can still reach this Mac.

## What the page shows

The page is one column of four cards:

| Card | What it holds |
|---|---|
| **This device** | This Mac's device name and short id, a status pill, the **Network** select, **Copy address**, **Pane size**, and **Viewing now** (which paired device is watching which of your sessions). While the service is not running it shows **Start** |
| **Invite a device** | **Show invite**: a QR code and a link for your other device, then the joining device's name, id and code with **Approve** and **Deny** |
| **Join a puddle** | A field for the link or pairing token another device shows, and **Join** |
| **Members** | One row per paired device: its name, short id, when it was last seen and when it was paired, **Remove**, its two permission switches and its spaces-bar chip |

## Pair a device

Pairing connects two devices directly. You start an invite on one, join from the other, and approve once both screens show the same code.

### Invite from this Mac

1. On the Puddle page, under **Invite a device**, click **Show invite**. (The Puddle service must be running; if This device shows **Start**, click it first.)
2. Flow shows a QR code, the invite link with **Copy link**, and an **Expires in** countdown. An invite is good for one use and expires after 5 minutes; **Cancel** ends it early.
3. On the other device, scan the QR code or open the link (see the next section).
4. When that device connects, the card shows the name it gave, its id and a six-digit code. Check that your other device shows the **same code**, then click **Approve**. If the codes differ, click **Deny**. You have 60 seconds to answer; no answer is a refusal.

> **Warning:** The name on the request is chosen by the joining device, so anyone can call themselves "My iPhone". The code is the only proof it is your device. Approve only when both screens show the same six digits.

The link and its QR code are a secret for as long as the invite lasts. **Copy link** puts it on the clipboard marked as transient, so clipboard history never records it, and Flow takes it back off the clipboard when the invite ends if nothing else has been copied since.

### Join from the other device

1. On the device that is joining, open the Puddle page.
2. Under **Join a puddle**, paste the link or the bare pairing token (it starts with `fr1.`), then click **Join** or press `↩` in the field.
3. The card shows **Connecting…**, then a code. Check it against the code on the inviting device, where the person there approves.
4. When the pairing is approved the card says **Joined** with the other device's name.

Opening a `flow://puddle/join` link on a Mac opens the Puddle page with the Join field **filled in**. Flow never joins on its own: you still click **Join**. If Puddles is off, Flow says so and asks you to turn it on and open the link again.

### Pairing is for people only

Approve, Deny and Join run only from a click on the page or `↩` in its own field. None of them is a palette action or a `flow-cli` command, so no agent or script can pair this Mac. `flow-cli` also refuses to start an invite, because the QR code on screen is the secret; only you start one, from the palette or the page.

## Choose what each device may do

Pairing alone lets a device **list** your terminal sessions and nothing more. Each **Members** row has two switches, both off for a new pairing:

| Switch | Lets that device | Notes |
|---|---|---|
| **Can open my sessions** | Watch and type into any of your terminal sessions here | Full shell access. There is no watch-only mode: a device that can watch can type |
| **Can create sessions** | Ask this Mac to start new sessions, in a folder it names or in a new worktree of a repo here | Needs **Persist sessions** (Settings › General) on this Mac |

Only terminal tabs running as [persistent sessions](https://flow.worldbreakstudios.com/docs/workspace/persistent-sessions.md) are shared; mirror groups, remote-host groups, web tabs and other tab kinds never are. Only a click on a switch changes it. Pairing the same device again keeps the switches as they were. Browsing your files, mounting your folders in Finder, and running palette actions or pull request operations from that device all need **both** switches on.

**Viewing now** on the This device card lists who is watching which session. A new viewer also raises a `puddle.viewing` notification ("DEVICE is viewing GROUP · TAB"); see [Notifications](#notifications).

## Network and port

The **Network** select on the This device card sets where the Puddle service listens (`puddle.bind`):

| Choice | Value | Meaning |
|---|---|---|
| Automatic | `auto` | Your tailnet when Tailscale is up, otherwise this Mac only. The default |
| Tailscale | `tailscale` | Your Tailscale network |
| Local network | `lan` | Every network interface of this Mac |
| Tailcat | `tailcat` | Across networks through tailcat relays, direct when it can. Never picked by Automatic |

While the service can only be reached from this Mac, the card says so: start Tailscale, or pick Local network or Tailcat, before you invite another device. **Copy address** copies the address other devices dial; under Tailcat there is nothing to copy, because that address is a secret. Changing the network or the port restarts the service.

## Use a paired device's sessions

Once a paired device has turned on **Can open my sessions** for this Mac, its sessions appear here as if they were local.

### Device spaces

After your own label chips, the main window's spaces bar shows one chip per paired device ("All DEVICE", with a green dot while it is online and sharing) and one chip per label of that device that has a group on show ("LABEL · DEVICE"). Click a chip, or step to it with **Previous label** `⇧⌘←` and **Next label** `⇧⌘→`, and the sidebar (and the Dashboard) lists that device's sessions in its own order. While the device is offline, or has not shared its sessions with this Mac, the list says so in one muted line.

A device chip's right-click menu offers **Hide**, **Change icon…**, **Open in New Window** (the device's sessions in a window of their own) and **Open Puddle page**. To bring a hidden chip back, use the device's **Members** row: **Show in spaces bar**, and **Show labels** for hidden label chips.

### Mirror groups

Clicking one of the device's sessions opens a **mirror group** named "DEVICE · GROUP": one local pane per remote tab, each attached live to the session on the other device. You see and type into the same terminal the device shows. Closing a mirror pane only detaches from the session; it keeps running there.

- A mirror group's header shows the device's branch, diff counts and folder. The pull request pill is read from GitHub by this Mac; until that read lands, the pill only displays what the device reported.
- You can give a mirror group your own labels and add it to session groups, like any group. A mirror pane can also be dropped into a local group, but a local shell can never go into a mirror group.
- A remote tab that a pane here already shows gets no second pane. If every tab of that group is already shown somewhere, the group showing them comes forward instead.
- If the device drops off, a running pane reconnects by itself. Panes that cannot run (Puddles off, the device not answering yet, the device unpaired) show one line saying why, and start again in place when the cause clears, without creating a second session.
- `⇧⌘T` reopens a closed mirror group. If the device closed the session meanwhile, the pane says so; where the device allows creating sessions, Flow starts a new one there in the same folder instead.

**Shared pane size** sets how a session shown on two devices is sized: to the screen of the device you typed in last ("Device used last", the default), or to fit the smallest screen. It is set on the Mac that owns the session (**Pane size** on its This device card) and applies to sessions started after the change.

### Start a session on another device

With **Can create sessions** granted on the other device:

- The device space's **New session on DEVICE** row opens a new mirror group whose session runs there.
- The new-tab button and splits inside a mirror group start new sessions in that remote group.
- The New session picker (`⇧⌘N`) lists the other device's favorite and recent folders beside yours, and can create the session there, including on a new worktree branch made on that device.

## Close session everywhere

Closing a mirror group normally closes it **here only**: the session keeps running on its device. To close it on the device too, the device must be live over sync (see [Sync and devices overview](https://flow.worldbreakstudios.com/docs/sync/overview.md)).

| How | What happens |
|---|---|
| Close the group (`⇧⌘W`) with **Close on the other device too** set to **Ask each time** (default) | A confirm asks "Also close on DEVICE?" with **Close everywhere** and **Just here**, and "Don't ask again". `↩` is **Just here**; **Close everywhere** is a click only |
| **Close on the other device too** set to **Always** or **Never** | Closing always closes on the device too, or never does |
| Palette action **Close session everywhere** (unbound, `keyboard.close_group_everywhere`) | Skips the question: the close confirm closes the session on the device too |
| `flow-cli group G close --everywhere` | Closes here and on the device at once, with no confirm |
| Right-click an unopened row in a device space › **Close on DEVICE** | Closes that session on the device behind a confirm (a click only) |

Closing everywhere closes the whole remote group when the mirror group shows all of its sessions; otherwise it closes only the sessions this mirror group shows, so tabs still in use there survive. If the device is not reachable, or sync is off on this Mac, the session closes here only and Flow tells you.

## Files on a paired device

These need the other device to grant this Mac both **Can open my sessions** and **Can create sessions**. Every path is a path on that device; nothing is read from or written to this Mac's disk.

### The Files tab in a mirror group

A mirror group's new-tab Launcher works on the device: **Files** opens a Files tab on the session's folder there, a typed path is looked up on the device, and **Run** lists the `run` entries of the `.flowspace.json` there. The Files tab lists and expands folders and previews text and images (files over 2 MiB are never downloaded), but has no git status, diff, revert, Markdown preview or go to definition.

### Finder mounts

You can mount a folder of a paired device on this Mac and work on its files in Finder or any app, readable and writable as if local. Nothing needs installing: no FUSE, no kernel extension, no admin password.

- In a mirror group, open the folder button's menu in the header and choose **Open in Finder**, or use **Open in Finder** on a row or file in that group's Files tab.
- Or from a terminal:

```sh
flow-cli puddle-mount DEVICE /absolute/path/on/device --open
flow-cli read puddle-mounts
flow-cli puddle-unmount DEVICE /absolute/path/on/device
```

`DEVICE` is a device id, name or id prefix. Mounts appear under `~/.flow/remote-mounts/`, one folder per device and then one per mounted folder, named after the folder so that is what Finder's title bar shows.

A mount ends when you eject it in Finder or run `flow-cli puddle-unmount`, when you quit Flow or turn Puddles off, and when the device is unpaired or stops granting this Mac access. `puddle-unmount` never forces a volume that is in use: close the files, Finder windows and terminals open in it, then run it again. If the device stops answering, the mount stays and its files answer with an input/output error until the device is back.

## What paired devices can do on this Mac

A device you have granted **both** switches (typically Flow on your iPhone) can also act on this Mac's sessions:

- **Run palette actions** for a session, the same rows `⇧⌘P` would offer, except quitting Flow, the command palette itself, Go to Puddle and the invite, installing the command-line tools or the `gh` / `git` shell aliases, and installing an update or relaunching into one.
- **Read and write a session's pull request**: view it, comment, reply to review threads, review and change its status, acting as this Mac's signed-in GitHub user. It refuses what the desktop would (for example approving your own pull request) and waits while you are writing to the same pull request here.
Each action that ran posts a `puddle.remote_action` notice ("DEVICE ran TITLE"). Everything is refused while Flow is locked or Puddles is off. Separately, a device that syncs with this Mac can close, rename or pin your sessions; those run here without a dialog and are recorded the same way (see [How Flow syncs data](https://flow.worldbreakstudios.com/docs/sync/sink.md)).

## Notifications

The Puddle adds these notification kinds; change how each is delivered in Settings › Notifications (`notifications.KIND`, one of `toast`, `system`, `silent` or `off`).

| Kind | Default | When |
|---|---|---|
| `puddle.pairing` | toast | A device asks to join while the Puddle page is not open. The Tools row shows a badge meanwhile |
| `puddle.viewing` | silent (history only) | A paired device starts watching one of your sessions. The same device and session within 10 minutes is not new |
| `puddle.created` | toast | A paired device starts a session on this Mac |
| `puddle.remote_action` | silent (history only) | A paired device closes, renames or pins one of your sessions, or runs an action |
| `puddle.attention` | toast | An agent here needs you while you are working on another of your Macs |

```sh
flow-cli settings set notifications.puddle.viewing toast
```

## Remove a device

On the device's **Members** row, click **Remove** and confirm. That device can no longer reach this Mac; pair again to bring it back. Removing is one-sided: the other device still lists this Mac until you remove it there too, but can do nothing with it. Its spaces-bar chips, device windows and Finder mounts go with it.

## Settings

| Key | Type | Default | Effect |
|---|---|---|---|
| `features.remote` | bool | `false` | Turns Puddles on (Settings › Experiments › Puddles) |
| `puddle.bind` | string | `auto` | Where the service listens: `auto`, `tailscale`, `lan` or `tailcat` (the page's Network select) |
| `puddle.port` | number | `47633` | The TCP port the service listens on (1024 to 65535) |
| `puddle.pane_size` | string | `latest` | Shared pane size: `latest` (device used last) or `smallest` (fit the smallest screen). Applies to sessions started after a change |
| `puddle.sync` | bool | `true` | Sync sessions with your devices: other devices see your sessions live, and their closes, renames and pins apply here. Off, they see a listing refreshed every 15 seconds |
| `puddle.close_remote` | string | `ask` | Close on the other device too: `ask`, `always` or `never` |

Network, port, pane size and the spaces-bar chips have no row of their own in Settings: searching for them opens the Puddle page. Any key can also be set from a terminal, for example `flow-cli settings set puddle.bind lan`.

## Limits

- **Open is full access.** A device with **Can open my sessions** can type into every shareable terminal session; there is no read-only grant. With both switches on it can also reach every file your user account can, and its file access is not logged.
- **Pairs, not a mesh.** Each pairing is between two devices. Pairing A with B and B with C does not connect A and C.
- **A service you started by hand keeps running.** Turning Puddles off stops only the service Flow started; one started from a terminal keeps serving until you stop it.
- **Mirror groups are the device's.** A local shell can never join a mirror group, a mirror pane is never a local group's primary, and the Factory does not take mirror groups.
- **Listings are capped** at 64 groups and 512 sessions per device; the rest are not shown.
- **`flow-remote` is not on your `PATH`.** It ships inside Flow.app and Flow runs it for you; "Install command-line tools" does not link it. See [Pair devices with flow-remote](https://flow.worldbreakstudios.com/docs/sync/flow-remote.md).
