DEV Community

hon6
hon6

Posted on AI-assisted

One list for Claude Code sessions on two computers: how Kiteline links a home and an office machine

Kiteline is a tool for managing coding agents: Claude Code, Codex and others do the work on a computer, and you follow progress, reply and approve permissions from your phone. The desktop side (Mac, Windows, Linux) is open source. No API key, no changes to the agents' configuration.

Plenty of people now run agents on more than one machine: a desktop at the office with a few Claude Code sessions, and a laptop or Mac at home with a few more. Checking on the office machine usually means remote desktop or SSH and a scroll through a terminal.

Kiteline has a feature for this called Add Kiteline Computer. Two computers that both run Kiteline add each other as sources, and the other machine's sessions show up in the same session list as the local ones. You can read the conversation, reply and approve permissions from either machine; the action is carried out by the computer the session lives on.

Pairing

There is no QR code between two desktops, so pairing uses an address plus a 6-digit code:

  1. On computer B, open Settings → Phone Access and note the 6-digit code.
  2. On computer A, open Settings → Sources and click "Add Kiteline Computer". The Mac version lists Kiteline computers it finds on the local network; on Windows and Linux you type IP, IP:port or a domain (port 8766 by default).
  3. Enter the code and click Add.
  4. B shows "Allow computer A to link with this computer?" — click Allow within 60 seconds.

After that the link is two-way: A sees B's sessions and B sees A's.

Network

Computers talk to each other directly over your own network: the same LAN, a public IP, port forwarding, or your own overlay network such as Tailscale. The traffic does not go through Kiteline's relay.

Because some people will expose the port to the internet, the code is protected against guessing:

  • a code is discarded after 5 wrong attempts and a new one is generated;
  • 10 wrong codes per hour from public addresses pause pairing from public addresses for an hour, while the LAN keeps working;
  • a computer asking to link always needs a click on "Allow" on the other machine.

Each side then trusts only the other's local root certificate and does not check the host name, so connecting through a public IP, a domain or a forwarded port does not fail on a certificate name mismatch.

How the sessions are merged

Every 30 seconds A asks B which sources it has. Each of B's sources becomes a source on A with an id like kl:<first 8 chars of B's id>:<source id>, backed by a long-lived stream of B's watcher events (newline-delimited JSON, with a heartbeat every 15 seconds). A treats those events exactly like its own: session snapshots, conversation updates, terminal output.

Writes go the other way. The editor lives on B, so any request on A that targets a kl: source is forwarded to B as a whole and the keys in the response are mapped back. Local state such as pins, marks, todos and favorites stays on A. B also leaves out the computers it has linked itself when it reports its sources, so two machines linking each other cannot loop.

Phones

A phone only needs to pair with one of the two. Once connected, it asks that computer for the other's credentials. If the current computer becomes unreachable and the other one is online on the same network, the phone switches over automatically and still sees all sessions from both machines.

Mac and Windows/Linux use the same protocol, so any combination can be linked.

Claude Code is a product of Anthropic; Kiteline is an independent third-party tool.

Top comments (0)