BlogTerminals and tmux

How do I run Claude Code on a remote server (VPS) and still answer its questions from my Mac?

Run Claude Code inside a tmux session on the server, and reconnect to that session from your Mac whenever you want to look at it. That works with nothing but SSH. What it does not do is tell you when the agent needs you: you watch the terminal. Kanbell 1.5.3 adds a guided setup for the same architecture, and shows the agent's state and questions in your menu bar.

Without Kanbell: SSH and tmux

1. Install Claude Code on the server

On the server, use the official installer from Anthropic's setup guide:

curl -fsSL https://claude.ai/install.sh | bash

2. Start it inside tmux

Connect and open a named tmux session. -A attaches to the session if it already exists and creates it otherwise:

ssh you@your-server
tmux new -A -s claude
cd ~/code/your-project
claude

The tmux manual says a session "will survive accidental disconnection (such as ssh(1) connection timeout)" and can be reattached. That is the part that keeps the agent alive when your laptop closes. Detach on purpose with C-b d, and come back with tmux attach or the same tmux new -A -s claude.

3. Sign in on a machine with no browser

On first launch Claude Code opens a browser to log in. On a server it cannot, so it shows a login URL: press c to copy it, open it in a browser on your computer, and paste the code you receive at the Paste code here if prompted prompt. Or set the ANTHROPIC_API_KEY environment variable and approve the key when Claude Code asks.

4. Know when it needs you

This is where plain SSH is thin. When Claude finishes or pauses for a permission prompt and you appear to be away, Claude Code fires a notification event. In Ghostty, Kitty and iTerm2 the docs say the desktop notification reaches your local machine over SSH, with iTerm2 needing its alert forwarding turned on. Inside tmux you also need passthrough, as covered in do I need tmux for Claude Code.

A hook that calls notify-send will not help on the server: the hooks guide notes that headless servers and SSH sessions usually have no notification daemon.

So the workflow is: reattach, read the terminal, answer. With several agents on several machines, that is one terminal to check per agent. To name the session in your own alerts, see how do I know which Claude Code session is waiting.

With Kanbell 1.5.3

Kanbell runs the same architecture for you, from your Mac.

  1. In a project, click + and choose On a machine….
  2. Pick a host from your ~/.ssh/config, or add user@host.
  3. Follow the guided setup, once per machine: connection with a host fingerprint check; a dedicated SSH key if the machine asks for a password, with your approval; the project folder found on the machine through its git remote; tmux (through apt or dnf) and Claude Code (official installer) installed if missing, with your approval; then Claude signs in on the machine, either through the sign-in page opened on your Mac or with an API key.

Kanbell never stores or types a password, and it does not clone the repository: if the folder is not there, it shows the git clone command.

The agent runs in tmux on the server, so it keeps working when you close Kanbell. The session sits in your sidebar with the machine's name on it. Its state, questions and permission requests reach the menu bar panel on your Mac, and the task board works as for a local agent. There is no Kanbell server: everything goes through SSH, with a reverse tunnel to your Mac.

Limits: Claude Code only (not Codex or Gemini CLI), Linux machines, and a remote session shows in a terminal rather than the Focus view. Details in Remote machines (SSH).

Which one to pick

  • One agent, one server, you are happy to check in: SSH and tmux.
  • Several agents, or you want the question to find you: Kanbell.

For what happens when your laptop closes, see does Claude Code keep running over SSH when I close my laptop.

FAQ

Can I run Claude Code on a VPS without tmux?

Yes, but the session is tied to your SSH connection. tmux sessions survive an SSH disconnection and can be reattached; a plain SSH shell does not offer that.

How do I sign in to Claude Code on a server with no browser?

Claude Code can show a login URL: press c to copy it, open it in a browser on your computer, then paste the code it gives you at the Paste code here if prompted prompt. You can also set the ANTHROPIC_API_KEY environment variable and approve the key.

Which machines and agents does Kanbell support over SSH?

Linux machines, and Claude Code only. Codex and Gemini CLI do not run on a remote machine, and a remote session shows as a terminal, not in the Focus view.

Does Kanbell need a server or an account to reach my VPS?

No. There is no Kanbell server: everything goes through SSH, with a reverse tunnel back to your Mac.

Sources