Skip to main content

Daily Workflow

Starting a session

# Open a terminal and connect via SSH
ssh abc@<your-server> -p 2222
# → Enter SUDO_PASSWORD
# → You're in /workplace and Claude is ready.

Claude launches automatically on every login (SSH and web terminal). Exit Claude (/exit or Ctrl+D) and you're dropped to a normal shell prompt.

Open http://<your-server>:7681 in a browser for the web terminal, or SSH in. Both launch Claude in /workplace automatically.

Persistent sessions with tmux

The server auto-detects where you're connecting from and starts tmux only when needed.

Setup (one-time): In Termius, edit your Claude World host → add environment variables:

KeyValuePurpose
TMUX_AUTO1Auto-attach tmux on connect
TMUX_TIMEOUT2Kill detached session after N hours (-1=never, 0=on detach)

With TMUX_TIMEOUT=2: if you disconnect and don't reconnect within 2 hours, the tmux session auto-cleans. No zombie sessions.

From Mac/PC: Claude launches immediately, ask your question, get an answer, exit, done.

ssh abc@<server> -p 2222 # → Claude auto-launches in /workplace

From iPhone/Termius: auto-attaches to a persistent tmux session. Claude launches automatically inside tmux. Switch apps, lose signal, everything keeps running.

ssh abc@<server> -p 2222 # → auto-attached to tmux "main" (Termius sent TMUX_AUTO=1)
# → Claude launches automatically inside tmux

Next time you connect from Termius, you reattach to the same session with Claude still running.

How it works: Login (SSH or web terminal) sources .bashrc: cd /workplace, then if TMUX_AUTO=1 is set, exec tmux new-session -A -s main wraps the session in tmux first. Finally, claude launches. Exiting Claude returns you to a shell prompt. Reconnecting with tmux reattaches to the running session (Claude still there).

Key commands inside tmux:

ActionCommand
Detach (leave running)Ctrl+B then D
Scroll upCtrl+B then [ (arrows, q to quit)
New sessiontmux new -A -s name
List sessionstmux ls
Manual attach anytimeta (alias for tmux new -A -s main)
Kill current sessiontmux kill-session
Kill all sessionstmux kill-server
Kill all except currenttmux kill-session -a
Keep session forevertmux-keep, prevents auto-cleanup for this session

:::tip Override the timeout

Mid-task and realize you need more time? Run tmux-keep inside the tmux session. The cleanup daemon will skip it, it stays alive until you manually kill it, regardless of TMUX_TIMEOUT.

:::

Working server-side

You don't need a local machine. Everything runs on the server:

  • Terminal: web terminal at http://<server>:7681 or SSH from anywhere
  • Claude Code / long tasks: inside tmux, survives disconnects
  • Files: live at /workplace/, visible from terminal and SSH

Accessing from elsewhere

MethodURL / CommandAuth
Web terminal (browser)http://<server>:7681Password
SSH from anywheressh abc@<server> -p 2222Password
SSH from iPhone (Termius)Add host with port 2222Password

Ending a session

Exiting works in two steps:

  1. Exit Claude: type /exit or press Ctrl+D. You're dropped to a normal shell prompt in /workplace
  2. Exit shell: type exit or press Ctrl+D again. The SSH or web terminal session ends

If you're inside tmux, detach instead of exiting to keep the session alive: press Ctrl+B then D. Next time you connect, you reattach to the same session.

note

If the server reboots, your SSH session ends, just connect again.

tmux sessions survive disconnects but not server reboots. Reattach with tmux attach -t main after reboot.