@levelsio: So here's my latest set up Every site I have is a profile on Termius like > hoodmaps .com I click it and immediately I'…
Summary
Pieter Levels shares his server workflow using Termius profiles and a custom tmux function that auto-attaches to per-site sessions, enabling seamless switching between devices and consistent work sessions.
View Cached Full Text
Cached at: 05/23/26, 06:15 PM
So here’s my latest set up
Every site I have is a profile on Termius like
hoodmaps .com
I click it and immediately I’m in my server and I get dropped in a tmux session that’s always tied to the corresponding site I wanna log in to
To make this work I have this startup snippet in each site’s Termius profile:
cd /srv/http/hoodmaps.com && tm
(so /srv/http is where my sites are and then hoodmaps .com is the example site here, and “&& tm” is the important part here)
Then in my ~/.bashrc file I added this (written by Claude Code) which defines the “tm” function, again all it does it just put me in the right tmux session based on the folder I’m in
The result is I can switch without interruption from my laptop to phone in Termius with auto reconnecting sessions and usually I just have Claude Code open in each session to work
Before I had to mess around with 1) not having smooth switching from laptop to phone, I’d have to use Claude Code’s /resume for it, annoying, 2) having multiple sessions for same sites, gets messy and confusing fast, now it FORCES me into one session per site, this just works so well, I’m so fast, and each of my sites is just an open tab in Termius, I’ve never worked so structured and clean!
Here is the code, maybe it helps somebody:
tmux session per folder. tm (no args) attaches to / creates a session
named after the current dir’s basename. tm name overrides the name.
Works whether already inside tmux (uses switch-client) or outside it.
tm() { command -v tmux >/dev/null 2>&1 || { echo “tmux not installed”; return 1; } local name=“{1:-$(basename "$PWD")}" # tmux session names can't contain '.' or ':' — replace with '-' name="{name//./-}” name=“{name//:/-}" if [ -n "TMUX” ]; then tmux has-session -t “name" 2>/dev/null || tmux new-session -d -s "name” -c “PWD" tmux switch-client -t "name” else tmux attach -t “name" 2>/dev/null || tmux new -s "name” -c “$PWD” fi }
Auto-attach on interactive login: picks a session named after wherever
you land. Plain ssh server lands in $HOME → session “root”. Use
ssh server -t "cd /srv/sm.levels.io && bash -l" to land in a site
folder → session “sm-levels-io”. Skips inside tmux and non-interactive
shells so scp/rsync/scripted ssh keep working.
if command -v tmux >/dev/null 2>&1 && [ -z “$TMUX” ] && [[ $- == i ]]; then tm fi
Thank you man, we all have different opinions and are different people but we can talk and co exist!!!!
Less work, I only work with live code now
I think I pay
Similar Articles
@dingyi: 我现在都懒得用 tmux 了,直接用 https://herdr.dev 或 https://muxy.app 更方便,适合懒人。
Herdr is a terminal-based agent multiplexer offering persistent sessions, agent awareness, and a mouse-native TUI, positioned as a convenient alternative to tmux. The tweet recommends it alongside muxy.app for users seeking simpler terminal session management.
Herdr: One terminal to rule them all
Herdr is a terminal multiplexer that lets developers run multiple coding agents in separate terminals, on any machine or over SSH, with persistent sessions viewable at a glance.
@paulmillr: https://x.com/paulmillr/status/2075335421920239651
This thread describes a secure and reliable development setup for agentic AI using a dedicated server accessed via SSH with tmux for session persistence, a terminal emulator with native tmux integration, and a VPN for secure access. The author advocates for this over local agent execution due to security and reliability concerns.
@vimtor: i’ve fallen in love with cmux by @manaflowai coding has become all about parallel work. this means you need: 1. more vi…
The developer shares a personal workflow improvement using cmux, a terminal multiplexer, to manage parallel work across multiple projects and tools with better visual context and faster switching.
@laogui: The best Hermes WebUI I’ve used so far—sessions, file tree, automation, long-term memory, multiple profiles, all inside the browser. Pick up any TUI or Telegram thread right where you left off.
Hermes WebUI packs session control, workspace file tree, automation, persistent memory and multi-profile support into a browser chat that syncs with TUI and Telegram.