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 | 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 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.