Skip to content

Use Claude Code from another computer with hivemux

hivemux lets a second computer (say, a laptop) attach to the tmux of the Mac or Linux machine where your Claude Code sessions run, over ssh, with the same sidebar and sessions. Turn on Remote Login on a Mac, or run an ssh server on Linux, then on the laptop run hivemux connect --add me@work-mac.local once and hivemux connect me@work-mac.local to connect. If the connection drops, the work goes on.

The work keeps running in one computer’s tmux. The other opens a new Ghostty window attached to it over ssh (or mosh). Local work on the laptop stays as it is; the remote one opens in its own window. hivemux needs to be installed on both.

Macs and Linux connect in either direction: Mac to Mac, Mac to Linux, Linux to Mac, Linux to Linux. Ports, hivemux open, Option+O, Ctrl+V image paste, notifications and the bee office work the same in every case.

  1. Install hivemux (see Install).
  2. Turn on System Settings → General → Sharing → Remote Login.
  3. Keep it from sleeping when idle (System Settings → Energy). It cannot be reached while asleep.

hivemux doctor checks Remote Login and sleep in its remote section.

A common case is a Linux dev server: Claude Code runs there, close to the code, and you work on it from your Mac.

  1. Install hivemux with curl -fsSL https://hivemux.dev/install.sh | bash (see Install on Linux). It needs tmux 3.3 or newer: Ubuntu 24.04+, Debian 12+, Fedora or Arch.
  2. Run an ssh server: install the openssh-server (Debian, Ubuntu) or openssh package, then sudo systemctl enable --now ssh (or sshd).

hivemux doctor checks that the ssh server answers. A server with no desktop is fine: setup skips the Ghostty step there, and dev servers, files and the bee office open on the computer you connect from.

Terminal window
hivemux connect --add me@work-mac.local # check and remember (--mosh to use mosh)
hivemux connect me@work-mac.local # or: right-click → Connect to…, prefix Shift+H

The first time, --add (or “+ Add a host…” in the Connect to… list) asks you to trust the host and for your login password there once, then adds this computer’s ssh key there (making one if there is none), so later connections need no password. It also checks that hivemux is installed there. Keep hivemux up to date on both computers: when one side is too old for the other, the screen says so as you connect, with the computer to update and the command.

The host is anything ssh takes: a Host from ~/.ssh/config, user@address, or a device name on a VPN. On the same network name.local works. From outside, a VPN such as Tailscale on both computers is the simple way.

On a Linux desktop, the new connection window opens in Ghostty, or else in the desktop’s terminal (x-terminal-emulator).

  • The remote window shows ⇄ <name> at the right of the status line, before the clock: the name set in Settings → This computer’s name, else the Mac’s name or the Linux host name.
  • A dropped connection reconnects by itself: a box in the middle counts down to the next try (Enter tries now, Ctrl+C stops). prefix d detaches and closes the window.
  • Notifications from the remote tasks show on this computer.
  • Two screens on the same project share it: switching windows on one moves the other.
  • While a remote screen is attached, the sidebars keep still in every window (no spinners in the sidebar or the status line), because every animation frame would go over the network; a row under each sidebar’s head says ⇄ <Mac> attached · animation off.

Dev servers started on the other computer (npm run dev in a remote pane, say) are forwarded to the same port on this computer’s localhost while connected. A server on 5173 there opens here at http://localhost:5173. A port already taken here goes to the next free one. On a Linux server without lsof, hivemux finds the ports with ss and /proc, including a background server that systemd took over.

Option+W (or right-click → Ports) lists them on either side. Enter opens one in the browser of the computer you connect from; Ctrl+Y copies the address.

hivemux Ports popup listing http://localhost (node) and http://localhost (Python), each opening on MacBook-Air

Press p on a port in the list to open it on the Wi-Fi of the computer you connect from too: the list shows its address there (http://192.168.x.x:5173) and a QR code to scan with a phone on the same network. p again closes it. The code needs qrencode; without it the list offers to install it (i).

hivemux port list showing a dev server’s Wi-Fi address and a QR code for a phone

From a terminal, or to turn forwarding off:

Terminal window
hivemux connect --ports
HIVEMUX_PORTS=0 hivemux connect me@work-mac.local

A screenshot on the MacBook’s clipboard pasted with Ctrl+V into a Claude running on the Mac Studio: it shows up as [Image #1], and Claude sees the pay button running out of the card and changes its width from 360px to 100%

  • Ctrl+V in a remote Claude pane pastes the image on this computer’s clipboard (a screenshot taken here, say): it is copied over and shows up as [Image #1]. On a Linux laptop the image comes from wl-paste (Wayland) or xclip (X11). Both computers need hivemux 0.1.26 or later.
  • Files too: copy a PDF (or any files) in Finder with ⌘C and press Ctrl+V in a remote Claude pane; they go over under their own names and their paths are pasted for Claude to read. Several at once, no folders, up to 100 MB in all; from 5 MB the status line there shows the progress (📎 report.pdf and 2 more… 45%). Both computers need hivemux 0.1.52 or later.
  • hivemux open <file> in a remote pane copies the file to this computer and opens it with its default app, so a screenshot Claude made there shows up here. The 🐝 button there opens the bee office here. Both computers need hivemux 0.1.29 or later.
  • In the Option+O popup on a remote screen, Tab, Enter and Ctrl+F do the same: the file is copied to this computer and opens here, not on the one you are not looking at. A folder cannot be opened this way; the popup says so, and Ctrl+Y copies its path. Ctrl+Y also puts the path on this computer’s clipboard.
  • With VS Code or Cursor as the Open path editor, Enter in the Option+O popup opens the file on the computer you connect from over Remote-SSH instead (it needs the Remote - SSH extension there).

With --mosh (or m in the Connect to… list), the session survives sleep and network changes by itself, but notifications do not pass through mosh; the list marks such a host “mosh · no notifications”. Both computers need mosh: brew install mosh on a Mac, the mosh package on Linux.

Terminal window
brew install mosh # macOS
sudo apt-get install mosh # Ubuntu, Debian

If it stops at “Nothing received from server on UDP port”, allow incoming connections for mosh-server in the other computer’s firewall.

For other ways to reach Claude Code away from your desk, including the phone app, see Claude Code remote access.