# Sessions

> Your shell runs on the box. A network drop or a closed lid ends the connection but not the session; reconnect and you are where you left off, running processes included.

URL: https://prized.dev/docs/sessions

## Connect [#connect]

```bash
prized ssh
```

This lands in a persistent tmux session named `main`; run it again from anywhere and you attach to the same one. A suspended box wakes on connect. On Windows it runs the OpenSSH client that ships with Windows; mosh and dragging files in are [not on Windows yet](https://prized.dev/docs/cli#windows).

| Command                    | What it does                                                                                |
| -------------------------- | ------------------------------------------------------------------------------------------- |
| `prized ssh -s agents`     | Attach to, or create, a named session. Letters, digits, hyphens, and underscores; no dots.  |
| `prized ssh --ls`          | List sessions.                                                                              |
| `prized ssh --kill agents` | Close a session.                                                                            |
| `prized ssh --raw`         | A plain shell without tmux.                                                                 |
| `prized ssh -- make test`  | Run one command and get its exit code back.                                                 |
| `prized agents run codex`  | Start a coding agent in a detached session, no laptop attached. See [Agents](https://prized.dev/docs/agents). |

> Sessions survive disconnects and closed lids. What they survive on a pause depends on the box size, and a busy session holds off [auto-pause](https://prized.dev/docs/boxes#auto-pause); see [Pause and resume](https://prized.dev/docs/boxes#pause-and-resume).

## Mosh for flaky networks [#mosh-for-flaky-networks]

```bash
brew install mosh   # macOS; on Linux: sudo apt install mosh
prized mosh
```

The same tmux session over UDP: keystrokes echo instantly, and the connection survives IP changes and laptop sleep. The box needs no public port; the traffic uses the SSH tunnel.

## Drag files in [#drag-files-in]

Drag files or folders from Finder (or your file manager) onto a `prized ssh` or `prized mosh` window. They land in a fresh folder under `~/.prized/drops/`, and the paste becomes the box paths. Drop a folder into Claude Code or Codex this way and the agent can read it.

* **Limits:** up to 16 files or folders per drop, 512 MiB and 4,096 files total. Folder scanning stops at 8,192 entries or 64 levels deep; transfers time out after 5 minutes. Drops older than 7 days are cleaned out.
* **Folders skip** `.env` and `.env.*` secrets (but keep `.env.example` and `.env.sample`), `.git`, dependency/build/cache folders such as `node_modules`, `.venv` and `target`, and your `[sync].default_ignores` — the [patterns sync leaves behind](https://prized.dev/docs/sync#add-a-project) — so a rule you add there covers dragging a folder in too. They read the same way, with the folder you dropped standing in for the project root: a plain name or glob (`*.pem`, `datasets`) matches at any depth, one with a slash (`private/*.pem`, `src/**/*.map`) is anchored at the folder you dropped, and a trailing slash means directories only. A `!` un-ignore is the exception — it belongs to a project's `unignore` and is left to sync. Symlinks, hard-linked files and special files inside folders stay local. The status line reports file and skip counts; each excluded folder counts as one skip without scanning its contents.
* **Names:** spaces and shell punctuation become underscores in uploaded names, including names inside folders; leading dots and dashes are removed. Collisions get numbered suffixes.
* **Fail-safe:** only a bracketed paste containing nothing but existing local file or folder paths is rewritten. Empty or fully skipped folders, over-limit drops and failed uploads paste the original local paths; the tmux status line says why. Directly dropped symlinks and hard-linked files are not uploaded.
* **Terminal support:** Ghostty, Terminal.app and iTerm2 need bracketed paste enabled by the session. Plain SSH, editor Remote-SSH, explicit remote commands and Windows do not use this uploader. `--raw` still supports drops when the foreground app enables bracketed paste, but has no tmux status line.
* **Off** for one session with `--no-drop-upload`, or for good with `drop_upload = false` under `[ssh]` in the config.

## Copy out [#copy-out]

A copy made inside the session lands on your clipboard. Select text in Claude Code and press **c**, or copy in tmux copy mode, and the text is on your Mac or Linux desktop clipboard, in Apple Terminal too, which cannot do this by itself. The first use on a fresh box is usually Claude's sign-in link: select it, press **c**, paste it in a browser, paste the code back.

* **How:** an app's copy on the box is an escape sequence; tmux passes it on to `prized ssh`, which writes the text to your clipboard (pbcopy on macOS; wl-copy, xclip or xsel on Linux). A terminal that handles the sequence itself gets the same result.
* **One way only.** Nothing on the box can read your clipboard: read requests are dropped before they reach your terminal. Anything on the box can copy into it, though, so glance at what you paste into a shell.
* **Selecting with the mouse:** Claude Code takes over the mouse, so a plain drag highlights inside Claude rather than in the terminal. Hold **Fn** (Apple Terminal), **Option** (iTerm2) or **Shift** (most others) while dragging to select in the terminal, then Cmd-C.
* **Not over** `prized mosh`, which does not carry the sequence. `prized ssh --raw` works; on Windows the terminal handles the copy itself.
* **Off** for one session with `--no-clipboard`, or for good with `clipboard = false` under `[ssh]` in the config. Copies then stay on the box: the session's tmux stops forwarding them, and anything still sent is dropped before it reaches your terminal. That switch is shared by every session on the box, so a session that had copying on gets it back on its next connect.

## Editors and other tools [#editors-and-other-tools]

* **Your local editor on the synced folder.** Saves to `~/Prized/myproject` land on the box in under a second.
* **Anything that speaks SSH.** `prized setup` installs an SSH config stanza, so `ssh box-3fa9`, Cursor and VS Code Remote-SSH, scp, rsync, and git remotes all reach the box by hostname. The ChatGPT desktop app rides the same stanza ([Codex remote](https://prized.dev/docs/codex)); Claude Desktop rides it with a restricted device key Prized installs for you ([Claude Desktop remote](https://prized.dev/docs/claude-desktop)).
