Open History to see the last commit
1# Remote access
2
3Connect a phone, browser, or another desktop app to T3 Code running on a different
4machine. That machine must stay running and reachable while you work.
5
6## T3 Connect
7
8T3 Connect makes an environment available to your other devices without setting
9up router forwarding. In the desktop app on the host, open **Settings →
10Sharing & access**, sign in, and enable **T3 Connect** for that environment.
11
12For a command-line host, run:
13
14```bash
15t3 up
16```
17
18It asks how your other devices reach the machine: T3 Connect, the local network,
19or both. Choose T3 Connect and follow the sign-in instructions. It then runs
20T3 Code as a [background service](./background-service.md).
21`t3 connect` is the same as `t3 up --connect`. Run `t3 up` again to change your
22choice, and `t3 status` to see it.
23
24Instead of the background service, you can keep the desktop app running with
25its local environment enabled. Closing the desktop app's last window stops its
26local server. Saving your sign-in alone does not start a server or make the
27machine reachable.
28
29On your other device, sign in to the same T3 Connect account and choose the
30environment. On the app.t3.codes home page with no computer added yet, signing
31in adds compatible computers linked to your account. Over SSH, the CLI prints a
32browser link and a short code. Open the link on any device, confirm the code
33matches, and approve. The CLI continues on its own, so you do not need to forward
34an OAuth callback port.
35
36T3 Connect renews access credentials when needed without disconnecting a healthy
37connection. Pull request diffs and provider settings keep working after the
38previous credential expires. A failed renewal affects that request; it does not
39disconnect an otherwise healthy conversation.
40
41### Approve new devices
42
43By default, any device signed in to your T3 Connect account can open a linked
44machine. To require approval instead, turn on **Require approval for new
45devices** with the T3 Connect settings in **Settings → Sharing & access** on the
46host, or when you first set up T3 Connect. Then someone who takes over your T3
47Connect account cannot reach the machine from a new device without your
48approval. Review the devices that are already approved, described below.
49
50A new device waits and shows a code such as `K7QM-2XFD`. Approve it from a
51device that is already connected, using the prompt or **Settings → Sharing &
52access**. Check that the code matches the one on the waiting device. On a
53headless host, run `t3 auth connect-device list` and then
54`t3 auth connect-device approve K7QM-2XFD`. A request expires after 10 minutes,
55and the device asks again when it retries. Deny keeps that device out until its
56request expires.
57
58Each device is approved once. Revoke it from **T3 Connect devices** in the same
59settings page, or with `t3 auth connect-device revoke <code>`. With approval on,
60it has to ask again. With approval off, it can connect again on its own, so
61revoking in the app offers to turn approval on first. Devices that connected through T3 Connect while approval was off stay
62approved and appear in that list for you to review. A device that has not
63connected since you updated T3 Code asks for approval like a new one. Older apps
64cannot show the code, so update them before you turn approval on.
65
66### Scripts and agents
67
68`t3 up` asks nothing when you name a choice: `--connect`, `--lan`, or their
69`--no-` forms. Choices you do not name keep their settings, and `--yes` takes
70the defaults. Without a terminal:
71
72- T3 Connect sign-in prints a URL and a code. Approve it on any device.
73- A needed restart runs without asking, and stops running agent turns.
74- With nothing set up and no choice named, `t3 up` stops and names the flags.
75
76`t3 status --json` prints the settings. `t3 up --help` lists every flag with
77examples.
78
79### More machines with T3 Chat
80
81Each T3 Connect account can link up to 3 machines. Phones and browsers do not
82count. A paid T3 Chat plan raises the limit to 10 machines with Pro, or 100 with
83Premier.
84
85To link T3 Chat, open your account menu on the web or desktop app, go to
86**T3 Chat**, and select **Link T3 Chat**. Sign in to T3 Chat in the window that
87opens and approve. The new limit applies the next time you add a machine. If you
88cancel or downgrade T3 Chat, machines you already linked stay linked, but you
89cannot add more until you are under the limit again.
90
91## Pair over a LAN or private network
92
93Use direct pairing when the other device can reach the host's network address.
94
95On a desktop host, open **Settings → Sharing & access**, enable **Network access**,
96then create a pairing link using an address the other device can reach. Changing
97network access restarts the desktop app. You can turn it off in the same place.
98
99For a command-line host, choose the local network in `t3 up`, or run:
100
101```bash
102t3 up --lan
103```
104
105For a server in a terminal, run `t3 serve --lan`. Either way, T3 Code then
106accepts connections from your local network and tailnet, so a pairing code is
107all that keeps other devices on them out.
108
109If a server is already running, generate a fresh link without restarting it:
110
111```bash
112t3 pair
113```
114
115Scan the QR code on your phone or paste the pairing URL into **Add environment**
116in the receiving app. Connection settings are under **Settings → Environments**
117on web and desktop and **Settings → Environments** on mobile. A loopback address
118such as `127.0.0.1` reaches only the device opening the link.
119
120On a computer with the desktop app, you can open the printed `t3code://pair`
121app link instead. The desktop app asks you to confirm the server address, then
122adds it.
123
124If your HTTPS endpoint uses a certificate from your own certificate authority,
125install that CA on Android as a **CA certificate** in its security settings; the
126Android app then trusts it.
127
128Pairing authorizes that device for future connections. Use a fresh one-time link
129for each new device; you do not need the original token to reconnect. A device
130stays signed in while you keep using it, until you revoke it in **Settings →
131Sharing & access** on the host. One unused for 30 days, or paired with a host
132older than this release, has to pair again. Links
133created in Settings can only be copied from the client that created them while
134its Sharing & access page stays open. If you leave or reload that page, create
135another link to share.
136
137### Reach one machine several ways
138
139A machine can have more than one route: LAN, Tailscale, another VPN, a public
140URL, SSH, or T3 Connect. Tailscale shares its `100.64.0.0/10` address range with
141other VPNs such as Cloudflare WARP, so an address in that range shows as VPN
142unless the machine confirms it is on Tailscale. To add a route, choose **Add
143route** in the machine's route list, or next to it in the T3 Connect list.
144A pairing link for a saved machine is refused when it comes from an address
145that machine does not have yet; add that address with **Add route** instead.
146Pairing again over an address the machine already has still works. A new route
147is placed by speed, in that order, and you can reorder routes at any time.
148
149While connected through T3 Connect or a paired address, T3 Code also learns the
150machine's current LAN and Tailscale addresses and adds them as routes, so
151pairing once through T3 Connect is enough to use the LAN at home. When the
152machine's LAN address changes, for example after it joins another Wi-Fi network,
153the learned route follows it. The machine must allow network access for its LAN
154address to be learned: **Network access** in the desktop app, or the
155[local network](./background-service.md#local-network-access) choice in `t3 up`.
156You can reorder a learned route, but not remove it; it
157goes away with the route it was learned through, or when the machine stops
158reporting that address.
159
160T3 Code connects over the first route that answers. Away from home, a LAN
161address that does not answer is checked briefly and skipped. It is only tried
162again, after the other routes, if none of them connect. While connected over a
163later route, T3 Code checks the earlier ones when your network changes, when you
164return to the app, and every minute, and moves back as soon as one works. A
165route whose machine refused this device's sign-in is marked **Sign-in
166refused**; pair that address again with **Add route** to use it.
167
168On web and desktop, select the route count under the machine's name in
169**Settings → Environments** to see its routes. Drag a route to change the order,
170or remove it. On mobile, open the machine under **Settings → Environments** and
171choose **Edit**. Signing out of T3 Connect removes only that route; a machine
172you can still reach another way stays saved.
173
174Open **Permissions** next to **Routes** in web or desktop, or **Your permissions**
175in the mobile route details, to see what your current connection can do on that
176environment. For a remote environment, this is in its route details. Permissions
177shown there apply only to the route marked **In use**; other routes are not
178checked. Direct pairing and T3 Connect have separate sessions and may grant
179different permissions.
180
181### Balance new threads across machines
182
183Auto balance is off by default. On web and desktop, enable it in
184**Settings → Environments → Load balancing** to automatically choose a machine for
185new threads in projects grouped across connected environments. The section
186appears once two or more machines are switched on.
187Each machine starts at **Normal**. Choose **Prefer** to favor it when it has CPU and
188memory available, **Less often** to reduce its share, or **Manual only** to exclude
189it from automatic selection. These are preferences, not fixed traffic percentages.
190Preferences are saved separately in each client.
191
192The composer checks eligible machines when choosing a draft's environment, then keeps
193that choice stable. Choose **Auto balance** again to check current resources, or choose
194a specific machine to override it. Choosing a branch or worktree also keeps the draft
195on that machine. Existing threads stay where they started. If resource checks are
196unavailable or all eligible machines are full, choose a machine manually to continue.
197Mobile keeps its manual environment selection.
198
199### Tailscale HTTPS
200
201Join both devices to the same tailnet. In the desktop app, enable **Tailscale
202HTTPS** in **Settings → Sharing & access**. Turn it off there to remove that route.
203
204Your tailnet needs MagicDNS and HTTPS certificates enabled; see
205[Tailscale's HTTPS setup](https://tailscale.com/docs/how-to/set-up-https-certificates).
206On Linux, T3 Code also needs permission to manage Tailscale; see
207[operator permission](https://tailscale.com/docs/reference/troubleshooting/linux/linux-operator-permission)
208for non-root users. If any of these is missing, T3 Code still starts but can't
209add the HTTPS route.
210
211To start a command-line server with Tailscale HTTPS:
212
213```bash
214t3 serve --tailscale-serve
215```
216
217For an already-running server:
218
219```bash
220t3 pair --tailscale
221```
222
223The pairing link uses an address such as `https://machine.tailnet.ts.net/`.
224The mapping created by `pair --tailscale` persists across restarts. Remove its
225default-port mapping with:
226
227```bash
228tailscale serve --https=443 --set-path=/ off
229```
230
231If that port is already in use, choose another with
232`--tailscale-serve-port`. See `t3 pair --help` for other pairing options.
233
234### Hosted web app
235
236[app.t3.codes](https://app.t3.codes) needs an HTTPS endpoint. It connects directly
237to your server; a hosted pairing link does not make an unreachable backend
238reachable or convert HTTP to HTTPS.
239
240For a plain HTTP LAN endpoint, use the direct pairing URL in a browser that can
241open it, or pair from the desktop app. On mobile, an IP address entered without a
242scheme uses HTTP, so include `https://` when your server uses HTTPS.
243
244## Desktop-managed SSH
245
246In the desktop app, open **Settings → Environments → Add environment**, choose
247**SSH**, and enter a host or SSH alias such as `user@example.com`. T3 Code starts
248or reuses a server there and opens the port forward for you. Projects, provider
249credentials, and agent work stay on the remote machine.
250
251The remote host must be Linux or an Apple Silicon Mac with `curl` or `wget`,
252`tar`, `sha256sum` or `shasum`, and [provider setup](./install.md#providers).
253The first launch downloads T3 Code's server to `~/.t3/runtime` on the host, so
254it takes longer than later ones.
255Provider CLIs must be on the `PATH` of a non-interactive login shell there;
256check with:
257
258```bash
259ssh user@example.com 'sh -lc "command -v claude codex"'
260```
261
262T3 Code cannot answer a second sign-in prompt such as a Duo code. On macOS and
263Linux it can reuse a connection you signed in to in a terminal instead: turn on
264connection sharing for the host in `~/.ssh/config`, run `ssh <alias>`, then
265connect. When that connection closes, sign in again in a terminal and retry.
266
267```sshconfig
268Host <alias>
269 ControlMaster auto
270 ControlPath ~/.ssh/cm-%C
271 ControlPersist 8h
272```
273
274If SSH reconnecting fails after an app update, retry the launch once. Removing
275the connection stops a server that T3 Code launched; a server that was already
276running is left alone.
277
278Each desktop app keeps one session on the host for its SSH connection and reuses
279it when it reconnects. Revoke sessions you no longer use in **Settings →
280Sharing & access** on the host, or on a headless host with `t3 auth session list` and
281`t3 auth session revoke <id>`. A desktop that can still sign in over SSH pairs
282again on its next connect.
283
284For Antigravity's Google callback on a remote host, see
285[remote sign-in](./providers-antigravity.md#sign-in-from-a-remote-device).
286
287## Browser on a remote environment
288
289Browser tabs belong to the environment, so you and your agents see the same
290tabs from any device. The desktop app shows its own environment's tabs
291directly. Every other device, and the desktop app for other environments,
292streams them from the host. Agents keep using them while no device is
293connected, and `localhost` addresses reach servers on the host.
294
295A tab you open yourself in the desktop app for another environment loads on
296your computer instead, so the element picker, screenshots, and annotations work
297as they do locally. Its `localhost` addresses still reach servers on the host,
298over the connection the app already has, whichever way you connected. If the
299host cannot be reached, the tab shows a connection error; a `localhost`,
300`127.0.0.1`, or `[::1]` address never opens a server on your own computer.
301Other names that point at your computer, such as `/etc/hosts` entries, still
302do. These tabs ignore your system proxy settings, so they can't reach a host
303you connect to only through a proxy or over HTTPS with a privately issued
304certificate. The web app keeps streaming.
305
306The desktop app can also forward a port on the host to your computer, so any
307app there, such as your own browser, `curl`, or a database client, reaches it
308at `localhost`. Use the forward button on a server in the thread's **Servers**
309list, or **Forwarded ports** in the command palette, where you can also type
310any port number and stop forwards. A forward keeps the host's port number
311unless that port is taken on your computer, in which case it uses a free one
312and shows it. Forwards end when you stop them or quit the app. ⌘-click
313(Ctrl-click on Windows and Linux) on a remote server forwards it and opens it
314in your browser.
315
316A forwarded port behaves like a server running on your computer: anything on
317your computer can reach it, including web pages open in your browser, so a
318forwarded service is exposed the same way a local dev server is. Forwards
319listen only on your computer's loopback, never on your network. On Linux they
320accept only apps running as your user; on macOS and Windows, other users signed
321in to the same computer can reach them too.
322
323On iPhone, iPad, and Android, a tab showing one of the host's `localhost` pages
324has **Open on this device** in its menu. So does a long press on a `localhost`
325link in a chat. It opens the page in the phone's own browser view, at the same
326`localhost` address, so it scrolls and responds to touch natively. Like the
327desktop app, it never opens a server on the phone itself. The streamed tab
328stays where it was, and agents keep using it. Each host keeps its own cookies
329and site data on the phone. On iPhone and iPad the page runs under a stand-in
330address while the address bar shows `localhost`, so browser features that need
331a secure page, such as the clipboard or service workers, aren't available there.
332
333All of this rides the host's preview tunnel. Turn off **Settings → Sharing &
334access → Preview tunnel** on the host to stop other devices from loading its
335`localhost` pages themselves: port forwarding and **Open on this device** go
336away, and open tunnels close. Tabs keep working by streaming from the host, so
337anyone who can use the host's browser tabs can still view its `localhost` pages
338there. An administrator can also turn it off with a
339[managed policy](./managed-policy.md#other-capabilities).
340
341The first tab downloads a headless Chrome, about 120 MB, into the T3 home. It
342is the same browser [HTML renders](html-renders.md) use, so a host downloads it
343only once. Some Linux hosts need [setup](#browser-host-setup) before it can
344start.
345
346Agent tabs have separate storage and share a Chromium process. Take control before
347typing into an agent's tab, then release control when you want the agent to
348continue. Read-only connections can watch without changing the page.
349
350While you have control, the tab works with your device: text the page copies or
351cuts goes to your clipboard, a file picker on the page opens your device's
352picker, and a finished download is offered for you to save. Popups such as
353sign-in windows open as their own tabs. Downloads stay on the host until the
354tab closes. Audio does not play on your device.
355
356On a phone, tap the floating preview's corner dot to show its controls, then
357**Pop into separate window** to keep watching in picture-in-picture over other
358apps.
359
360### Local servers
361
362The browser lists ports held by processes your terminals and agents started.
363T3 Code reads which process holds each port and never connects to it, so a
364listed port opens as `http://localhost:<port>` and might not be a web page. For
365an HTTPS server or a specific path, set the **Preview URL** on the project
366script that starts it; T3 Code checks that address and opens it as written.
367
368To stop listing ports, set `T3CODE_PORT_DISCOVERY=0` in the environment that
369starts the T3 Code server, such as
370[`service.env`](./background-service.md#configure-the-service-environment) for
371the background service, and restart it. Script preview URLs still appear.
372
373### Browser host setup
374
375macOS, Windows, and Linux desktops run the browser as is. Some Linux hosts need
376one-time setup: Ubuntu 23.10 and later block the sandbox the browser runs in,
377and minimal images and containers lack libraries it loads. When that happens,
378the server says so at startup, and browser tabs and HTML previews show the
379command to run on the host:
380
381```sh
382sudo t3 browser setup
383```
384
385The server shows the exact line for how you started it, and keeps your `PATH`
386when you started it with `npx` and Node is installed only for your user. Where `t3` is not on your `PATH`, such as with only the
387desktop app installed, it names the full path of the app's own `t3` instead. It allows Chrome's sandbox with an AppArmor profile and installs
388any missing libraries and system fonts with apt; pages that load without text
389can mean the host has no fonts. It is safe to run again, and each run reloads
390the AppArmor profile: run it again if the browser reports a blocked sandbox on a
391host restored from an image or snapshot, where the profile can be on disk
392without being loaded. Without `sudo`, it only reports what it would change.
393
394The browser runs in Chrome's sandbox by default. Chrome cannot start that sandbox
395as root. If your T3 server runs as root, run it as a nonroot user to keep
396sandboxing enabled. `t3 browser setup` does not fix this root restriction.
397
398If you need to run as root, or cannot enable the sandbox on your host, set
399`T3CODE_SERVER_BROWSER_SANDBOX=0` in the **T3 server's environment** and restart
400the server. This disables Chrome's sandbox. For a manual launch:
401
402```sh
403T3CODE_SERVER_BROWSER_SANDBOX=0 t3 serve
404```
405
406For a systemd service, add `Environment=T3CODE_SERVER_BROWSER_SANDBOX=0` under
407`[Service]` in its configuration, run `sudo systemctl daemon-reload`, then restart
408your T3 service. Setting the variable in an agent's terminal does not change the
409environment of an already running T3 server.
410
411## Connect an outside agent
412
413Claude Code, Codex, ChatGPT and other agents T3 Code did not start can drive
414threads on an environment through its MCP server. See
415[outside agents](./outside-agents.md) for setup.
416
417## Link another environment
418
419Link two machines, such as your laptop and a VPS, and agents on one can work on
420the other: launch, message, wait on and stop its threads, answer their
421questions, and manage its queues, projects and scheduled tasks.
422
423Linked environments is a beta. Turn it on for both machines in **Settings →
424Labs**; on mobile, **Settings → Labs** lists each connected machine. On a
425headless server, open its address in a browser and pair to reach its **Settings
426→ Labs**, or add `"linkedEnvironmentsEnabled": true` to `settings.json` in its
427`userdata` directory, such as `~/.t3/userdata/settings.json`; a running server
428picks it up. While it is
429off on either machine, agents start nothing over a link between them. A task
430already running on the other machine still finishes, and if that machine has it
431off, its result arrives once it is back on.
432
433On the machine you will work from, open **Settings → Environments → Linked environments**,
434choose **Link**, and pick the other machine or enter its address. The list
435holds the machines this app knows and those on your T3 Connect account. If this
436app has an address for that machine and is connected to it with a session that
437manages access there, it makes the pairing code itself; otherwise paste one
438from that machine's **Settings → Sharing & access**. An address you type always
439needs a pasted code. From a terminal, use
440`t3 environment link <address> --pairing-code <code> --access <mode>`.
441
442To link many machines at once, choose **Link several…** (it appears once this
443app has two other machines saved). Tick the machines, pick one access level for
444all of them, and confirm once. A machine can be ticked when this app is
445connected to it with a session that manages access there and has an address
446another machine can reach; the list says why when it cannot. Each machine
447reports its own result, and the ones that failed stay ticked so you can try
448only those again. Machines already linked are left as they are.
449
450For machines no app is connected to, put one `<address> <pairing-code>` per
451line in a file (make each code with `t3 pair` on that machine) and run
452`t3 environment link --from <file> --access <mode>`, or `--from -` to read
453standard input. It prints a result per line, leaves machines already linked as
454they are, and exits non-zero if any line failed, so the same file can be run
455again with fresh codes for the failures.
456
457You can also ask an agent to link a machine by name, such as "delegate this to
458my vps". It shows a card in the thread where you pick the machine the same way
459and the access, then approve. An address the agent gives that this app does
460not know for one of your machines also needs a pasted code. Paste one only for
461an address you trust: the code is sent there.
462
463- The access you pick is the most agents from this machine may do there. An
464 agent also never gets more there than its own mode here.
465- Threads a link starts are marked **From** and this machine's name there.
466- A full-access link works there like that machine's own agents. Below full
467 access, the link's agents can change only threads it started, not that
468 machine's own threads, projects or settings, and they skip its project setup
469 scripts.
470- The link shows up in that machine's **Settings → Sharing & access** like any
471 outside agent. Revoke it there to end it. **Forget** on this machine only
472 removes it here.
473- A link stays valid while agents use it. One unused for 30 days expires, as
474 does one to a machine on an older T3 Code after 30 days; link again with a
475 new pairing code.
476
477On web and desktop, **Settings → Environments** opens as a map of your machines:
478this app, each environment with one line per route (the one in use is
479highlighted), and the machines an environment links to. Select a machine to
480manage it, or switch to **List** for the same controls as rows. To link from
481the map, drag the plus on an environment onto another machine, or press it and
482pick one. If this app is connected to both machines, knows an address the first
483can reach the other at, and its session on the other one manages access there,
484it needs no pairing code.
485
486A machine this app is not connected to, shown only because another environment
487links to it, can still be linked without a code when that link has full access:
488drop the plus on it and the environment holding the link gets the pairing code
489from it. Your session on that environment must manage access there. The result
490is a separate link with the access you pick, listed and revocable on the linked
491machine like any other. Links still do not chain.
492
493A link goes one way. To let the other machine's agents work back, tick **Also
494link … back** when you create the link, or select a one-way link and use
495**Link back…**. It is offered when this app is connected to both machines and
496may manage access on each. Two machines linked to each other at the same access
497are drawn as one line with an arrowhead at each end; they are still two links,
498and each is forgotten on its own.
499
500To link one environment to several machines at once, Shift-click the machines
501(or Shift-drag a box around them, or press Space on a focused machine), then
502drag the environment's plus onto any of them, or use **Link several…** above
503the map. Dropping the plus on a stack offers the stack's machines. The dialog
504ticks the machines it can link without a pairing code and says why for the
505rest. When this app is connected to none of them, each needs a pairing code,
506so the map says so and offers to link one at a time instead.
507
508Large setups fold: machines known only through links that share the same
509linking environments and access levels become one stack, and once this app
510knows more than 12 environments, the ones that are not connected and have no
511links fold by state. Select a stack to list and filter every machine in it.
512Opening a stack on the map draws its first 24 below its card: the rest of the
513map stays where it is and the map grows taller, so pan or press the fit button
514to see all of it. **Find a machine** above the map searches by name, and Enter
515goes to the first match. The **?** button above the map lists these gestures.
516
517The map draws the links of the machines this app is connected to; a machine it
518is not connected to may hold links the map cannot show. A link reaches one
519machine and does not carry on through that machine's own links.
520
521An agent can also hand a task to a linked machine with `delegate_task`: it runs
522there as an ordinary thread, in the project with the same repository (or the
523one `target.projectId` names), and this thread wakes with its result when it
524ends, as for any delegated task. It keeps following the task across restarts.
525If the other machine revokes the link, or the link is removed here, the task
526fails with that reason.
527
528### Read a linked machine's threads
529
530You can read a thread on a linked machine without connecting this app to it. Open
531a task that was delegated there from the thread's agents, or a thread link that
532points there, and the thread opens read-only, streamed through the machine you
533are connected to over its link. It follows the thread live. On web and desktop
534it opens as a tab in the right panel, beside the thread you are in, or in the
535main view with ⌘/Ctrl-click, like
536[subagents and side chats](thread-sidebar.md#open-a-thread-beside-the-one-you-are-in).
537On mobile it opens in the inspector on layouts that have one, where Maximize
538fills the screen, and as its own screen elsewhere. It shows the same timeline as
539any other thread on web and desktop, and a shorter read-only list on mobile.
540
541- The view is marked **Read-only** with both machines' names. To reply, approve
542 or stop the thread, choose **Connect to interact**. When the link has full
543 access, this app pairs with that machine in one step and opens the thread
544 there; you need permission to manage access on the machine you are connected
545 to. Otherwise the add-environment form opens for that machine and asks for a
546 pairing code you create on it.
547- This app connects to that machine directly, so it must be able to reach one of
548 the addresses the link uses. If it cannot, the view says so and stays
549 read-only. The new connection appears in that machine's **Settings → Sharing &
550 access**, named after this device and the machine it came through, and is
551 revoked there like any other.
552- Files, images and published visuals stay on that machine and do not load
553 here. A command's output shows as of when you open its row.
554- If this app is already connected to that machine, the thread opens there as
555 usual instead.
556- You need permission to read threads on the machine you are connected to, and
557 Linked environments must be on there. Both machines need a version of T3 Code
558 that has this view.
559
560## Manage or revoke access
561
562On the host, **Settings → Sharing & access** lets authorized administrators create
563pairing links and revoke client sessions. Revoking an unused link prevents new
564pairings; revoke a device's session to remove its existing access. Command-line
565management is available through `t3 auth --help`.
566
567When the app connects to more than one environment, choose one at the top of the
568page. A desktop app with **Local environment** off can manage a background
569service on the same machine this way, including its T3 Connect link.
570
571A session with an open connection stays listed after its access credential
572expires.
573
574To choose a token's permissions, pass `--scope` once for each scope you want:
575
576```sh
577t3 pair --scope orchestration:read --scope relay:read
578```
579
580The selected scopes replace the default permissions. The same option works with
581`t3 auth pairing create` and `t3 auth session issue`; each command's
582`--help` lists the available scopes. Without `--scope`, pairing tokens and issued
583bearer sessions get the standard client permissions, including managing access.
584Setting up or replacing a T3 Connect link requires the separate `relay:configure` permission.
585A terminal or a full-access agent on the host can reach those as well, so a
586client that should not manage access also needs to go without `terminal:operate`
587and `orchestration:operate`.
588
589To change an existing client's permissions, create a fresh pairing link with the
590scopes it needs. In a browser opened directly on the environment, open that link
591to replace the browser's current grant. For mobile or a saved remote environment
592in web or desktop, use **Add Environment** with the fresh link or code; pairing
593the same environment replaces its saved grant. Reconnecting alone does not change
594permissions.
595
596Grouping checkouts does not combine their permissions. Shared project settings
597require `orchestration:operate` on every member environment; actions on one
598checkout use that checkout's permissions.
599
600`source-control:write` covers direct Git and pull request changes made from the
601client: pushing, switching or creating branches, cloning, and removing
602worktrees. It does not restrict what a task does. Starting a task in a new
603worktree still creates that branch and worktree with `orchestration:operate`,
604and the agent it runs can use Git however the environment allows.
605
606Settings changes, provider management, environment maintenance, access
607management, and T3 Connect preferences can each be granted separately. Setting
608up or replacing a T3 Connect link requires the administrative
609`relay:configure` permission. `relay:write` covers preferences and unlinking.
610New pairings without `--scope` include the standard client permissions. Existing clients keep the
611permissions they paired with and can stay connected after an update, but newly
612separated features may require pairing again with the permissions they need.
613Older clients may show controls that the server denies. Create a fresh pairing
614link to change a client's permissions.
615
616`filesystem:read` allows browsing host files, opening workspace files, and viewing
617local changes. Add `filesystem:write` to allow editing files or saving plans to
618the workspace. These scopes control direct file access from the client.
619
620Some permissions also give a client indirect access. With `terminal:operate`,
621a client can run commands that read or change any files the server’s OS account
622can access, even when the pairing link omits file permissions. With
623`relay:configure`, a client can replace the trusted issuer of pairing
624credentials. Grant these permissions only to clients you trust with those
625capabilities.
626
627To remove an environment from T3 Connect, open your account menu's **T3 Connect**
628page, or **Settings → T3 Connect** on mobile, and choose **Deregister**. This
629revokes its cloud access and frees its host space even when the environment is
630offline or has been wiped. When T3 Connect rejects a host's link, the host
631shows that it was removed from T3 Connect. To link it again, turn on
632**T3 Connect** in **Settings → Sharing & access** on web or desktop, or turn on
633**Live Activity Updates** in **Settings → Notifications** on mobile; if it is
634already on, turn it off and on again. Either needs a client paired with
635`relay:read`, `relay:write`, and `relay:configure`. The desktop app's own session
636and the startup pairing link include all three; a pairing link created in
637**Settings → Sharing & access** needs `relay:configure` selected. You can also
638run `t3 connect link` on the host and then restart T3 Code there. A
639command-line host that released its tunnel when it last stopped may link itself
640again on its next start; run `t3 connect unlink` on that host to keep it off.
641Removing an environment from a device's connection settings only forgets it on
642that device and doesn't change your T3 Connect account. A device keeps a saved
643environment after it's deregistered until you remove it from that device.
644
645When idle tunnel cleanup is enabled, T3 Connect removes a linked environment's
646tunnel after it stays offline for several minutes. The environment stays linked
647and keeps the same address. When the host starts again or wakes, T3 Connect
648creates a replacement tunnel on its own. You do not need to pair again. Cleanup
649usually runs five to ten minutes after the tunnel goes down.
650
651T3 Connect also removes the tunnel of an environment running an older version of
652T3 Code once it has been offline for seven days. That environment shows a message
653asking you to update. Start T3 Code on that computer and update it to the latest
654version; it reconnects at the same address without pairing again.
655
656On a command-line host, `t3 connect unlink` disables exposure while retaining
657your login; `t3 connect logout` also clears that login. Background-service
658[removal](./background-service.md#manage-the-service) is separate.
659
660Treat pairing URLs and authorization codes as passwords. Do not include them in
661screenshots, logs, or bug reports.
662
663## T3 Connect troubleshooting
664
665When a T3 Connect connection fails, see
666[T3 Connect troubleshooting](./t3-connect-troubleshooting.md). It explains each
667error, where the problem is, and how to fix it.
668
669## Using the Desktop App as a Remote Only
670
671If a computer should only drive work running elsewhere, turn off its local environment. In the
672desktop app, open **Settings → Environments** and switch off **Local
673environment**. T3 Code restarts without a local server: no local agents or terminals run, WSL
674backends stay off, and other devices can no longer connect to this computer. Your projects,
675history, and saved connections are kept, and you keep working through pairing, T3 Connect, or SSH.
676If a [background service](./background-service.md) on this computer uses the same T3 home, the
677app still treats it as this computer: **Open in** and file reveal for its projects run here,
678whichever connection you reach it through.
679
680Switch **Local environment** back on in the same place to restart with your previous local
681settings.