Terminal multiplexer you can SSH into.

Sessions survive disconnects. Close your laptop, SSH back in from another machine, pick up where you left off. Built-in SSH server, web terminal, key management. One binary.

Quick Start GitHub
~ latch
curl -sSf https://unixshells.com/install.sh | sh
installed: ~/.local/bin/latch
latch v1.0.3
 
latch
session "default" created
you@macbook:~$

AI agents need persistent sessions

Claude Code runs for hours. It rewrites files, runs tests, waits for builds. If the terminal dies, the session dies, and the agent loses all its context. latch keeps sessions alive through disconnects, laptop suspends, and network changes. SSH back in from any machine and the agent is still running.

This is the same reason tmux exists, but latch has the SSH server built in. You don't set up sshd separately. You don't manage keys in a different place. You run latch new --ssh and it's reachable.

Quick start

One command to install, one command to start. Detach with Ctrl-] then d and it keeps running in the background.

~ quick start
curl -sSL https://unixshells.com/install.sh | sh
latch v1.0.9 installed
 
latch
session "default" created
 
latch new work
session "work" created
 
latch ls
default 1 window
work 1 window
 
latch attach work
attached to "work" (1 window)

SSH, Mosh, and web terminal. Built in.

latch includes an SSH server. Add a public key and start with --ssh. No separate sshd, no extra config.

Any SSH client

SSH

Ed25519 key auth. Add your public key with latch auth add and connect from any machine. Keys are stored in ~/.latch/authorized_keys, same format as OpenSSH.

Built-in server

Mosh

The mosh server is built into the binary. No separate install on the server. UDP connections survive network switches, cellular handoffs, and hours of idle time.

No install needed

Web Terminal

Start with --web to get an HTTPS + WebSocket terminal in a browser. Ed25519 challenge-response auth. Works on any device.

~ remote access
latch auth add ~/.ssh/id_ed25519.pub
key added (ssh-ed25519 user@laptop)
 
latch new work --ssh
session "work" created (ssh :2222)
 
# from another machine:
ssh -p 2222 mybox
attached to "work" (1 window)

Behind NAT? The relay connects you.

If you're behind NAT, the relay gives you a stable address without needing a public IP or port forwarding. Your machine maintains a persistent encrypted tunnel to the nearest relay server. End-to-end encrypted. Free with any account.

~ relay
latch relay register
registered! relay enabled.
 
# from anywhere in the world:
ssh [email protected]
Welcome to macbook-pro
rasengan:~$
Learn more about the relay

Key bindings

All shortcuts start with the prefix key. The default is Ctrl-], which doesn't conflict with tmux (Ctrl-b) or screen (Ctrl-a), so you can nest them. Configurable in ~/.latch/config.

~ key bindings (prefix: Ctrl-])
c new window
n / p next / previous window
0-9 select window by number
g<N> go to window N (for windows > 9)
x close window
d detach from session
s admin panel
[ scroll mode (j/k to scroll, q to exit)
Ctrl-] Ctrl-] toggle HUD lock

Configuration

Optional config file. Everything has sensible defaults.

~/.latch/config
# ~/.latch/config
# all settings are optional
 
prefix = ctrl-]
ssh-addr = :2222
web-addr = :7680
shell = /bin/zsh

Why latch

tmux and screen are good multiplexers, but they weren't designed for remote access. If you want to SSH into a tmux session from another machine, you set up sshd separately, manage keys in a different place, and wire everything together yourself.

This matters more now that AI coding agents run long sessions. Claude Code, Codex, Aider -- they all need a terminal that stays alive. latch keeps those sessions running through disconnects, laptop suspends, and network changes. SSH back in from any machine and pick up where you left off.

latch treats remote access as a first-class feature. The SSH server, key management, and session multiplexing are all in one binary. You run latch new --ssh and it's reachable. If you're behind NAT, you add the relay and it's reachable from anywhere. Standard SSH clients connect to it. Nothing to install on the client side.

Written in Go. Single binary. Nothing else to install. The design is deliberately simple: one pane per window, no splits, no scripting engine. The hard part is remote access, not being a tmux clone.

Open source. MIT license.

github.com/unixshells/latch

Get started in one command.

~ install
curl -sSf https://unixshells.com/install.sh | sh