---
title: Build an Always-on AI Workspace
description: >
  Set up a Mac mini you reconnect to from any device, with persistent tmux
  sessions and AI agents that keep running.
url: 'https://stroops.tech/playbooks/build-always-on-ai-workspace'
last_updated: '2026-06-30'
---
## What you'll have

A Mac mini at home that runs your editor sessions and AI agents around the clock. You reconnect from your laptop or phone, and nothing resets when you disconnect.

This is the executable version of the journal entry [My AI Workspace Never Sleeps](/journal/my-ai-workspace-never-sleeps).

## Before you start

- A Mac mini (or any mac/linux box) you can leave on
- Homebrew on it
- A second device (a laptop or phone)

## 1. Persistent sessions: tmux

On the Mac mini:

```bash
brew install tmux
```

Check that a session survives a disconnect:

```bash
tmux new -s work      # start a session
# press ctrl-b then d to detach
tmux ls               # it's still listed
```

## 2. Let yourself in: SSH

Turn on Remote Login on the Mac mini:

> System Settings → General → Sharing → Remote Login → on

Verify from another machine on the same network:

```bash
ssh you@macmini.local
```

## 3. Reach it from anywhere: the VPN

You need a private path to the box from outside your home network. Two ways.

**Tailscale, the easy one.** It's WireGuard underneath, with no ports to open or forward. On both machines:

```bash
brew install --cask tailscale
tailscale up          # sign in with the same account on both
tailscale status      # the Mac mini shows up here
```

**WireGuard by hand, what I run.** More control, but a bigger setup: a small VPS as the WireGuard server, keys and peer configs per device, and the routing to glue it together. That's its own write-up, so I'll keep it out of this one. If you want the short path, use Tailscale above.

Either way, confirm you can reach the box from *off* your home network:

```bash
ssh you@<tailscale-name-or-wg-ip>
```

## 4. Survive flaky connections: Mosh

SSH dies when the network blips. Mosh reconnects on its own, which matters from a phone.

```bash
brew install mosh
```

- Over a VPN (Tailscale or your own WireGuard), Mosh runs inside the tunnel, so there are no router ports to open.
- Only a box exposed directly on a public IP needs UDP `60000-61010` opened.

Verify:

```bash
mosh you@<name>
```

## 5. Stop typing the whole thing: aliases

On each device, in your shell rc:

```bash
alias mm="mosh you@<name>"
alias smm="ssh you@<name>"
```

## 6. Run your AI agents

This is the point of the box. Install the AI CLIs you use on the Mac mini (Claude Code, Cursor CLI, and the like), then start each one inside its own tmux window so it keeps going when you disconnect:

```bash
tmux new -s claude    # a window that outlives the disconnect
claude                # start your agent here
# ctrl-b then d to leave it running
```

Hand it a long task, detach, and close the laptop. The agent keeps working on the always-on box. You reconnect later and it's still there, often already done.

## 7. Getting back in: tmux attach, or Sloop for many agents (optional)

With nothing extra, you reattach to a session by name:

```bash
tmux attach -t work
```

That's fine for one or two sessions. Once you run several agents across several repos, finding the right session and spotting which one is waiting gets tedious. Sloop is the tool we build at Stroops for that: a single Go binary that launches your agents inside tmux and shows the whole fleet on one board. Source: [github.com/stroops/sloop](https://github.com/stroops/sloop).

Install it (it shells out to the tmux you already have):

```bash
brew install stroops/tap/sloop
sloop doctor          # confirm your AI tools + tmux are detected
```

Set up a project once, on the Mac mini:

```bash
cd ~/code/my-service
sloop init            # scaffold AGENTS.md + .sloop/, register the repo
sloop run claude      # launch an agent inside tmux
sloop hooks install   # so the board knows when an agent is waiting
```

## Daily use

From the laptop or phone:

```bash
mm                    # mosh into the Mac mini
tmux attach -t work   # back into your session
```

Close the lid and the session keeps running. Next time, `mm` and you're back where you left off. After a Mac mini reboot the tmux sessions are gone, so you start them again.

With Sloop, `sloop ps` replaces the manual attach: it lists every agent across every repo and lets you jump to a waiting one, and `sloop restore` brings the whole fleet back after a reboot.

## Notes

- **WireGuard vs Tailscale:** Tailscale is free for personal use and runs on the WireGuard protocol, so you get WireGuard's speed and modern crypto without hand-configuring it. It's lighter and faster than an older stack like OpenVPN. I run WireGuard myself for the control; I'd reach for Tailscale to get this working quickly.
- **Why I don't expose SSH to the internet:** A public SSH port gets scanned and brute-forced around the clock. So the Mac mini has no SSH port open to the world. Every connection comes in through the WireGuard tunnel first.
- **On the phone:** I use [Blink](https://blink.sh/) as the terminal. It has Mosh and SSH built in, so reconnecting from the phone is quick.
