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:
| Key | Value | Purpose |
|---|---|---|
TMUX_AUTO | 1 | Auto-attach tmux on connect |
TMUX_TIMEOUT | 2 | Kill 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:
| Action | Command |
|---|---|
| Detach (leave running) | Ctrl+B then D |
| Scroll up | Mouse scroll or Ctrl+B then [ (arrows, q to quit) |
| New session | tmux new -A -s name |
| List sessions | tmux ls |
| Manual attach anytime | ta (alias for tmux new -A -s main) |
| Kill current session | tmux kill-session |
| Kill all sessions | tmux kill-server |
| Kill all except current | tmux kill-session -a |
| Keep session forever | tmux-keep, prevents auto-cleanup for this session |
:::tip Copying text while mouse mode is on
Mouse scrolling works out of the box — the container sets set -g mouse on in /config/.tmux.conf automatically.
But mouse mode also captures text selection. To copy text out of tmux:
| Method | How |
|---|---|
| Shift + select (easiest) | Hold Shift while clicking and dragging — bypasses tmux, uses your terminal's native copy. Works in Terminal.app, Termius, ttyd, and most SSH clients |
| tmux copy mode | Ctrl+B then [ → move with arrows → Space to start selection → Enter to copy → Ctrl+B ] to paste inside tmux |
| ttyd (browser) | Hold Shift + select, or right-click → Copy. Toggle mouse-capture in the ttyd titlebar to disable tmux mouse entirely for that session |
Without set -g mouse on, scrolling in tmux cycles through shell history instead of scrolling output, which is a common tmux gotcha and not a Claude Code or Termius bug. If you're using tmux outside Claude World, add set -g mouse on to your ~/.tmux.conf and restart tmux.
:::
:::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>:7681or SSH from anywhere - Claude Code / long tasks: inside tmux, survives disconnects
- Files: live at
/workplace/, visible from terminal and SSH
Accessing from elsewhere
| Method | URL / Command | Auth |
|---|---|---|
| Web terminal (browser) | http://<server>:7681 | Password |
| SSH from anywhere | ssh abc@<server> -p 2222 | Password |
| SSH from iPhone (Termius) | Add host with port 2222 | Password |
Ending a session
Exiting works in two steps:
- Exit Claude: type
/exitor pressCtrl+D. You're dropped to a normal shell prompt in/workplace - Exit shell: type
exitor pressCtrl+Dagain. 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.
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.