Posted elsewhere but will copy here. Been doing this for a while.

- - -

get tailscale (free) and join on both devices

install tmux

get an ios/android terminal (echo / termius)

enable "remote login" if on mac (disable on public wifi)

mosh/ssh into computer

now you can do tmux then claude / codex / w/e on either device and reconnect freely via tmux ls and tmux attach -t <id>

- - -

You can name tmux and resume by name via tmux new -s <feature> and tmux attach -t <feature>

I have just today discovered zmx [1] which is like tmux but I always hated the tmux terminal emulation and how it hijacks scrolling, especially on Termius on my phone. It does session persistence but I think without the terminal emulator side of things, so scrolling works normally.

Been testing it today with Claude Code and it seems to work quite well switching between my laptop and phone.

[1] https://github.com/neurosnap/zmx

I also hate how tmux uses alt mode and can never remember all the shortcuts, copy paste is a PITA and just today I had to look up how to dump the scrollback buffer to a file. Named sessions without window management makes a lot more sense these days. Similarly, I'm not a fan of all the ANSI escape codes that CC uses to jump the cursor around and rewrite the display to look like a GUI. I prefer a TUI that doesn't mutate rows after writing them, that's what alt mode is for. CC often clears whatever was in the scrollback buffer before you opened it, it hides bracketed paste, and goes crazy sometimes when content overflows the window and I have to resize the terminal or get blasted with a wall of glitching characters--extra annoying if I'm working from a low bandwidth link. I develop my own agent framework and code agent, and while some features aren't as polished as CC, one of my explicit goals is to preserve the traditional CLI feel, like the python REPL (that's what it's based around). I'll give zmx a try tonight :)

I think everyone started out with this

I think people familiar with tmux/screen and tailscale or how to setup their own VPN might have.

Based on my experience many people don't know this is a thing you can do.

I'm still doing this. Is there a better setup? It's already very convenient and secure.

I'm still doing this, too! The only thing I added was setting up notifications on my local machine using hooks in Claude Code (using a reverse ssh tunnel from my local machine to a VPS).

As for fancier setups, I keep bookmarking them, but haven't gotten around to trying any of them, yet.

I do this and it is powerful, but I find that not being able to swipe/autocorrect my mobile typing in Termius makes things pretty painful.

Do you have an alias or something so that every time you open CC, tmux is running?

How do you deal with multiple concurrent sessions of CC with this setup?

How important is mosh? I wasn't able to get it set up the last time I tried... ran into a bunch of issues.

I always setup my terminals to open a tmux session by default (or attach to any existing one). For example, in my ~/.config/alacritty/alacritty.toml:

    [terminal.shell]
    args = ["-l", "-c", "tmux attach || tmux"]
    program = "/opt/homebrew/bin/zsh"
tmux supports tabs so you can have multiple Claude Code sessions running concurrently. You do need to learn a few tmux keyboard shortcuts to use it effectively (e.g. opening/closing/switching tab).

Sorry didn't answer "how important is mosh?"

Depends- how good is your signal? Mosh has a great property that it buffers everything locally so there's no lag even if your connection sucks.

On ssh, every keystroke is a roundtrip

"tmux ls" shows you all the open tmux sessions

Could even use cc to check in on and/or "send-keys"

What wasn't working about mosh? Just install mosh and use mosh to connect

I recommend Eternal Terminal instead of mosh for this.

Yes. Doing the same. What is the advantage of this new feature? Tmux/Tailscale/Termius give you full control of your terminal. Or mainly to save the end user the hassle to set it up correctly?

> Or mainly to save the end user the hassle to set it up correctly

It's this.

Don't have a Dropbox moment ;) [1]

[1]: https://news.ycombinator.com/item?id=9224

Oh lots of people will not be comfortable with tmux approach. The anthropic feature makes sense. But it's Max only and doesn't work well according to other comments.

What I posted "just works".

Ease of setup is the biggest reason. I use this setup as well, but there are other UX niceties that would be a lot better with a dedicated mobile app: push notifications when Claude needs your input (I use a hook for this that connects to Pushover, but that's another service and extra setup), voice input, autocorrect that's right for this context, etc.

Very interesting. Tell me more about your push notification setup!

I have a hook in my claude.json that fires on "Stop", it calls a shell script (written by Claude, of course) that calls the Pushover API: https://pushover.net/, which lets you send push notifications to your device. It's paid, but just a one-time fee when you install the app on your phone.

The shell script takes a message which includes Claude's message, but unfortunately there's no deeplinking back to my ssh app (for obvious reasons, the notification just routes you to the pushover app), so instead of tapping the message, I know to just open my Blink shell app to respond to Claude.

This is also quite noisy when I'm just sitting at my desk working, but I usually turn off phone notifications while working anyway.

It can help to recognize that tmux combines three kinds of functionality: 1. process persistence; 2. client attachment; 3. view layout. If you don't like how tmux works, there are alternatives. I prefer Zellij [1]. (It also can be informative to take a peek at dtach [2] and abduco [3].)

[1]: https://zellij.dev and https://github.com/zellij-org/zellij

[2]: https://github.com/crigler/dtach and https://dtach.sourceforge.net

[3]: https://github.com/martanne/abduco/issues/70

I also do this!