tmux Reconnect Checklist

Laptop or phone is a keyboard. The Mini is the computer that stays awake. Tailscale makes a private network. SSH (Terminal.app or Termius) gets you in. tmux is why the agents survive when you disconnect.

← Tech  ·  AI Agents  ·  Productivity  ·  SSH + VPS  ·  Agent machine  ·  Grok on mobile

What this is

A field checklist for hopping from a MacBook or a phone onto an always-on Mac Mini on the same Tailscale tailnet, then reattaching the tmux session where Grok Build / Codex / Claude Code are already running. Same Mini, same user, same session. The phone just uses Termius instead of Terminal.app.

Names, emails, Tailscale IPs, and MagicDNS hostnames stay on your machines. This page uses placeholders: USER, mini, 100.x.x.x.

Longer “why a remote box” writeup: /agentmachine (tmux + Tailscale + Termius) and /ssh (VPS version of the same idea). Phone thin-client: /grok-mobile.

One-sentence TL;DR

Connect Tailscale → SSH (Terminal.app or Termius) into the Mini as its macOS user → tmux attach. Detach with Ctrl-b d. Never quit the agent to “leave.” The phone dropping SSH when the app backgrounds is normal.

Once on the Mini (so reconnect works later)

  1. Stay awake. System Settings → Energy (or Battery → Options): prevent automatic sleeping when the display is off. A sleeping Mini is a timeout, not a tmux bug.
  2. Remote Login on. System Settings → General → Sharing → Remote Login. That’s SSH. Off = “Connection refused.”
  3. Tailscale on, and left on. Same tailnet as the laptop. Note the Mini’s MagicDNS name or 100.x address in a private note — not on a public page.
  4. tmux installed. On the Mini: brew install tmux then tmux new -s agents. Start the coding agent inside that session.

Reconnect checklist (laptop → Mini)

1. Tailscale

On the laptop: Tailscale menu → Connected. Use the account that is on the same tailnet as the Mini. The Mini must also be on, awake, and Tailscale-connected.

2. SSH

In Terminal on the laptop:

ssh USER@100.x.x.x

Or, if MagicDNS works on your tailnet:

ssh USER@mini

USER is the macOS account on the Mini (the one that owns the home folder and the tmux session) — not your Tailscale login email.

If you still use a password, it is that Mac user’s login password on the Mini. You should only see the host-fingerprint question the first time. Prefer an SSH key so you are not typing a login password every hop:

ssh-copy-id USER@100.x.x.x

3. Get back into tmux

If you land in a normal shell:

tmux ls
tmux attach

If several sessions:

tmux attach -t SESSIONNAME

If you land straight in an agent UI, you are already in that session. Use tmux keys to switch windows — don’t open a second agent in a new SSH window unless you mean to.

4. Move around without killing agents

Prefix is Ctrl-b (hold Control, tap b, then the next key):

Keys What it does
Ctrl-b d Detach. Agents keep running on the Mini.
Ctrl-b n / Ctrl-b p Next / previous window
Ctrl-b w Pick a window from a list
Ctrl-b c New window (another shell in the same session)
Ctrl-b , Rename this window
Ctrl-b % / Ctrl-b " Split pane left/right or top/bottom
Ctrl-b o Jump to the other pane

Closing the Terminal app on the laptop is fine after a detach. Typing exit inside the agent, or killing the tmux window, is how you actually stop the work.

Reconnect from the phone (Termius)

Same Mini, same Tailscale tailnet, same macOS user. The phone is another thin client. Broader Grok-on-phone SOP: /grok-mobile. This section is the reconnect hop.

Apps

  • Tailscale — Connected, same tailnet as the Mini (not a different personal account).
  • Termius — SSH client. Works on Android and iPhone. (Blink on iOS is fine too; the host fields are the same.)

New Host in Termius

Field What to put
Address The Mini’s Tailscale 100.x.x.x (from the Tailscale app on a machine that already works). MagicDNS names often fail to resolve inside Termius — if the pretty hostname does nothing, keep using the 100.x IP.
Port 22
Username The Mini’s macOS account (USER) — same as laptop SSH. Not your Tailscale login email.
Password / key That Mac account’s login password, or the SSH key you already copied. Prefer a key in Termius so you are not typing a password on a phone keyboard.

Connect. Accept the host fingerprint once. Do not paste the real address or username onto a public page.

Then tmux — same as the laptop

If you get a shell:

tmux attach

If you land in an agent UI, you are already in. Switch windows with Ctrl-b n / Ctrl-b p / Ctrl-b w. Termius has a Ctrl key on its extra keyboard row — tap Ctrl, then b, then the letter. Don’t hunt for a hardware Control key.

The phone will drop. That’s the point of tmux.

Phone SSH dies when Termius backgrounds, the screen locks, or the OS kills the app. Normal. Reopen Termius, connect again, tmux attach. The agents on the Mini keep running. Do not start a second agent “because the first one vanished” — it didn’t.

Optional: in Termius, turn on keep-alive / prevent sleep for that host if you want fewer drops while you are staring at a log. It still will drop. Detach is not required on the phone the way it is on a laptop you are about to close — the crash is the detach — but Ctrl-b d is still the clean leave if you have time.

If it fails

Symptom Usually
Timeout / no route to host Tailscale off on laptop, phone, or Mini — or Mini asleep
Termius can’t resolve the hostname MagicDNS often fails in the SSH app. Use the Mini’s 100.x.x.x from the Tailscale app
Phone connect dies after a minute App backgrounded. Reopen Termius and attach. Agents are still on the Mini
Permission denied Wrong password, wrong user, or key not on that account
Connection refused Remote Login off on the Mini
SSH works but no agents tmux ls and attach the session that has them — you are in a bare shell
no sessions tmux never started, or it was killed. tmux new -s agents and start the agent again

Optional shortcut on the laptop

Put this in ~/.ssh/config (your values, not these placeholders):

Host mini
  HostName 100.x.x.x
  User USER

Then the whole reconnect is:

ssh mini
tmux attach

Confirm Tailscale is connected first. SSH config does not turn Tailscale on for you.

Named sessions (so attach is obvious)

One session named after the desk beats five untitled ones:

tmux new -s agents
tmux rename-session -t 0 agents   # if it already exists unnamed
tmux attach -t agents

Windows inside that session (Ctrl-b c, then Ctrl-b ,) for “build”, “review”, “logs” — same pattern as /grok-mobile.

What we keep vs skip

  • Keep: Mini awake + Tailscale + Remote Login; agent inside tmux; detach not quit; Host mini alias; named session; Termius on the phone with the 100.x address if MagicDNS fails.
  • Verify: which macOS user owns the session (SSH user must match); Mini energy settings after an OS update.
  • Skip: publishing Tailscale emails, 100.x IPs, or real usernames; running the agent in a raw SSH window; treating laptop sleep or a backgrounded Termius as “the Mini is down”; starting a second agent after a phone drop.

Related on this site

Comments

Approved comments appear below. Log in once with GFAVIP — it applies across the whole site. GFAVIP login

View comments archive