top | item 47153313

(no title)

jasonjmcghee | 4 days ago

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>

discuss

order

madjam002|4 days ago

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

jacob019|4 days ago

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 :)

zeppelin101|4 days ago

I think everyone started out with this

jasonjmcghee|4 days ago

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.

canadiantim|4 days ago

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

nebben64|3 days ago

Thanks for the tip. Other ppl are saying "most of us started out like this" but if you haven't played with tailscale etc. (like me). Then this is new and good for learning imo

fudged71|4 days ago

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.

olalonde|4 days ago

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

jasonjmcghee|4 days ago

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

jasonjmcghee|4 days ago

"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

simlevesque|4 days ago

I recommend Eternal Terminal instead of mosh for this.

fittingopposite|4 days ago

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?

mlinsey|4 days ago

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.

oakashes|4 days ago

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.