Running Claude Code on an Always-On Mac mini, Reached Over Tailscale
Install Claude Code on the Mac mini, set macOS to never sleep and to restart after power loss, and join it to your tailnet. Reach it by SSH over Tailscale into a persistent tmux session, or drive sessions from your phone with Claude Code Remote Control. Run the agent under a separate account with narrow permissions.
Why put the agent on a separate machine
The workflow behind this setup, shown in a Japanese video by the creator Nagomi-ke that pairs Claude Code, an M4 Mac mini and Tailscale, is simple: the agent lives on a machine that never closes its lid. Long tasks keep running when the laptop goes into a bag. Files, scripts and small personal apps the agent builds stay in one place. And macOS-specific tooling works, which a Linux VPS cannot offer.
The trade-off is that you now operate a server. It needs to stay awake, come back after a power cut, be reachable from outside the house, and be safe to leave running with your credentials on it. Each of those is a short checklist.
Keep the Mac mini up
In System Settings, under Energy, turn on the option to prevent automatic sleeping when the display is off, and turn on starting up automatically after a power failure. For a one-off long job, the built-in caffeinate command also holds the machine awake while a process runs.
Plan for reboots. If FileVault is on, which it should be on a machine holding credentials, the disk must be unlocked at startup before your user session, and the apps in it, come back. The Tailscale GUI app runs in the logged-in user's session, so after an unattended reboot the mini may be unreachable until someone unlocks it. Keep a UPS on it, and decide in advance who can do that unlock.
Install Claude Code and sign in on the mini itself, then confirm a session works locally before adding any remote access.
Way in, option one: Tailscale, SSH and tmux
Tailscale puts your laptop, phone and the mini on one private network, a tailnet, with each device reachable by name. Nothing is exposed on your router and no ports are forwarded.
One macOS detail catches people. Tailscale's own documentation says only the open source tailscaled variant can act as a Tailscale SSH server on macOS; the App Store and standalone apps cannot. The simplest path with the regular app is to turn on Remote Login in macOS sharing settings, which runs the standard OpenSSH server, and connect to the mini's tailnet name with any SSH client, using key authentication. Screen Sharing works across the tailnet the same way when you need the GUI.
Once in, start Claude Code inside tmux. Detach when you leave, and the session keeps working. Reattach from the laptop, or from an SSH app on a phone, and the conversation is exactly where it was. This path works with any authentication Claude Code supports, including an API key, and gives you a full shell alongside the agent.
Way in, option two: Claude Code Remote Control
Remote Control connects claude.ai/code or the Claude mobile app to a Claude Code session running on your machine. Start it with claude remote-control, or run /remote-control inside an open session, then pick the session in the app. Anthropic's documentation says code execution and file access stay local, the local session makes outbound HTTPS requests only and never opens inbound ports, and it can push a notification to your phone when a task finishes or needs a decision.
The limits matter for an unattended box. It requires signing in with a claude.ai subscription; API keys are not supported. On Team and Enterprise plans an owner must enable it. Outside server mode, each interactive process supports one remote session. In server mode, if the machine stays awake but loses network for roughly 10 minutes, the process exits and has to be started again, which on a headless mini means you need a way in to restart it.
Which to use
Use both, for different jobs. Remote Control is the better phone experience: a chat view, attachments, notifications. Tailscale plus SSH is the recovery path and the power tool: a shell when Remote Control has exited, file transfer, logs, and Screen Sharing. A setup with only Remote Control has no way to fix itself remotely.
Lock it down before leaving it running
Separate user. Create a macOS account for the agent. It gets the project directories and the tools it needs, not your personal keychain, browser profiles or photo library.
Narrow permissions. Keep Claude Code's permission prompts on for anything that writes outside the project, pushes to a remote or touches production. Unattended does not mean unrestricted; a session nobody watched for six hours is exactly when a skipped approval matters.
Tailnet rules. Use Tailscale access controls so only your own devices reach the mini, and only on the ports you use. A shared tailnet with family devices should not grant them SSH.
Device trust for Remote Control. Anthropic offers a Trusted Devices setting that ties Remote Control access to a verified device and a recent authentication. Turn it on.
Context on the box. An always-on agent tends to reread the same notes and project docs across sessions. Indexing that material once and retrieving only what a task needs keeps long unattended runs smaller and cheaper.
Frequently asked questions
- Why run Claude Code on a Mac mini instead of a laptop?
- A Mac mini can stay on permanently, so long tasks keep running while a laptop sleeps or travels, and every session, file and tool lives in one place. It also runs macOS-only software that a Linux server cannot. The cost is operating it like a server: power settings, remote access, reboots and security.
- Do I need Tailscale if Claude Code has Remote Control?
- Not strictly, since Remote Control needs no inbound ports. Tailscale is still worth having as the recovery path. If the Remote Control process exits, for example after a long network outage in server mode, SSH over the tailnet lets you restart it. It also gives a full shell, file transfer and Screen Sharing.
- Can Tailscale SSH run on macOS?
- According to Tailscale's documentation, only the open source tailscaled variant can act as a Tailscale SSH server on macOS. The App Store and standalone apps cannot. With those apps, enable macOS Remote Login and connect with a normal SSH client to the mini's tailnet name, using key based authentication.
- Does Claude Code Remote Control work with an API key?
- No. Anthropic's documentation says Remote Control requires signing in with a claude.ai subscription on Pro, Max, Team or Enterprise plans, and API keys are not supported. On Team and Enterprise plans an owner must enable it first. If you run Claude Code with an API key, use SSH over Tailscale instead.
- How do I keep a Claude Code session alive when I disconnect?
- Start Claude Code inside tmux on the Mac mini. When you disconnect, detach rather than closing the terminal, and the process keeps running. Reconnect over SSH and reattach to the same tmux session to continue. Remote Control sessions also survive a client disconnecting, because the work runs on the mini.