DEV Community

Cover image for Two-Machine Dev: Home + Work Macs, SSH / tmux / Tailscale Workflow
SecondShiftDev
SecondShiftDev

Posted on Originally published at youtube.com

Two-Machine Dev: Home + Work Macs, SSH / tmux / Tailscale Workflow

Two-Machine Dev: Home + Work Macs, SSH / tmux / Tailscale Workflow

The video version, "Two-Machine Dev: Home + Work Macs, SSH / tmux / Tailscale Workflow," goes public on YouTube on Friday, December 4, 2026. This article is the written version.

One machine was the hidden assumption

Every article in this series before this one quietly assumed one machine. One desk, one terminal, one computer that had to stay awake for the work to exist. That assumption breaks the moment agent runs get long: a session that works for an hour cannot live on a machine that gets closed, carried, and put to sleep. So here is the two machine pattern: where the work actually lives, how the sessions survive the trip between desks, and why the second machine is only a window.

1. Why two machines

Agent work changed the shape of the day. Runs are long now, an hour or more, and a long run needs a machine that stays awake, stays connected, and never gets carried out of the room mid run.

So the job splits in two. The always-on machine, a desktop or a spare machine that never sleeps, runs the heavy and the long work: big test suites, overnight sessions, anything that should still be running tomorrow morning. The second machine, the laptop, is for looking: reviewing diffs, steering a session, reading results. It computes almost nothing, so it can be slow, old, or borrowed.

The payoff is the whole pattern in one sentence: close the laptop whenever you like, and the work does not notice.

2. SSH and tmux: sessions that survive

Two tools carry the pattern. SSH is the door. One command from the laptop, and the terminal on screen is a terminal on the always-on machine. Everything typed after that happens there, not on the laptop.

tmux is the room behind the door. Sessions live inside it, one per project, named after the repo, and agent runs are processes inside those sessions. They are not children of the SSH connection, and that one fact is the difference between a setup and a hope. Drop the connection, close the lid, lose the network for an hour. The session keeps running, and reattaching scrolls the accumulated output back into view.

The daily rhythm follows from that. Attach when you sit down. Detach when you stand up. Reattach from the other chair and pick up mid sentence, with one session per repo turning reattaching into a lookup instead of a dig through forgotten terminals.

One limit, said out loud: tmux is not a backup. If the always-on machine dies, its sessions die with it. Sessions protect work from disconnects. Commits protect it from everything else.

3. Reachable, not exposed

The always-on machine has to be reachable from the second desk. The obvious way is the wrong way: forward the SSH port on the home router. An open port gets scanned and probed constantly, and the only thing behind it is a login prompt.

The pattern instead is a private network layer, a mesh VPN, with Tailscale as the common example. Both machines join one private network and find each other by stable name, wherever they physically are. SSH rides on top of it. The router opens nothing, and the home IP address becomes a detail nobody needs to know.

Two consequences do the daily work. The laptop reaches the always-on machine by name from any network, with no dynamic DNS juggling when the home address changes. And access is per device: replace a machine or lose one, revoke that one device, and the rest never notices. Add key only SSH login on top, so there is no password to guess.

4. Git is the only sync layer

The rule is blunt: if it is not committed and pushed, it does not exist on the other machine. Committed alone is not enough, because a commit on one disk is invisible from the other chair. Code moves between the two chairs as commits through a shared remote, and project rules, task packets, and subagent configs move the same way. Nothing else is a sync layer.

Synced folders and shared drives look easier and lose quietly. They copy half written states, fight over the same file from both chairs, and when two versions disagree they have no answer to which one is real. Git was built to answer exactly that question.

The working rhythm is two habits. End every sitting with a commit; a work in progress commit on a branch is fine, and often the honest one. Start every sitting with a pull. And the handoff is a rule, not a courtesy: one writer at a time. The active machine pushes its commits plus a handoff note in the repo, what is done, what is mid flight, what comes next. The other machine pulls, reads the note, and takes over.

5. The rules travel, the secrets do not

Earlier articles put the project rules in CLAUDE.md, inside the repo. This is the payoff that design was buying. The file is committed, so it syncs like everything else in the last section, and both machines enforce the same rules with no settings copied by hand. Sessions opened from either chair read the same commands, the same boundaries, the same definition of done. The chair changed. The rules did not. Same for subagent configs and packets: files, committed, identical in both places. The setup is the repo.

Secrets obey the opposite rule. API keys and tokens live on each machine separately, and they never enter the repo. A repo gets cloned, shared, backed up, and screenshotted, and anything committed once should be treated as published everywhere that repo will ever go. Per machine secrets mean a leaked clone leaks code, not keys.

The cost, stated plainly: a new machine gets its keys typed in by hand, once, minutes of work. A committed example file with placeholder values documents what each machine needs.

The honest failure: the session that simply was not there

The pattern to design against is the pre tmux habit: the agent running directly in the SSH session, or directly on the laptop, because it was quicker to start. A long run is deep into its task, an hour of work stacked up, context built that exists nowhere else. Then the laptop sleeps, or the lid closes, or the network drops. The connection dies, and everything attached to it dies with it: the process, its context, the uncommitted state it was working toward.

The repo is fine, git saw to that. The run is gone, and the failure is silent: no error, no crash report, the session just is not there when the chair gets sat in again. The cost, stated plainly: the task restarts from the last commit, the replacement run gets paid for, and the hour spent on the dead one buys nothing.

The fix is one habit, not a tool purchase: the agent never runs outside tmux on the always-on machine. Connections are disposable. Sessions are not.

Get the Starter Pack

The free Multi Agent Starter Pack is the three CLAUDE.md templates plus the one page orchestration checklist from the first article in this series:

The video version of this article, "Two-Machine Dev: Home + Work Macs, SSH / tmux / Tailscale Workflow," goes public on YouTube on Friday, December 4, 2026, and shows the pattern lived across one day, two chairs, one repo.

The day job ends. The agent team clocks in.

Second Shift Dev

Top comments (1)

Collapse
 
userxnom profile image
Abdullah Naseer •

The line I keep coming back to is "Connections are disposable. Sessions are not." That reframes tmux for me — I had always thought of it as a convenience for flaky wifi, but here it is the actual reliability layer, and the commit is the backup layer. Two different jobs, and naming them that plainly makes the setup easier to trust.

The part I would steal first is the handoff note. "One writer at a time" is easy to say and hard to keep, and the note is what stops the two chairs from silently disagreeing about what the last state was — synced folders fail the same way, quietly, which is exactly the failure you describe.

One question on the one case the post leaves open: when the always-on machine itself needs a reboot mid-run, is there anything that survives that, or is the rule just "commit before you reboot"?