Go somewhere.

Home Page About Page Projects Page CV Page Dev Page Journal Page Contact Page Astro for Documentation and a Professional Site Dev Codex anywhere with tmux, Mosh, Termius, and Tailscale Dev Observing Codex MCP Tool Calls with Langfuse Dev Localization in Product Apps Dev MCP as a Safe AI Integration Boundary Dev Zod, OpenAPI, and Swagger for API Contracts Dev pg-boss for Durable Background Jobs Dev pgvector and RAG, Explained Through a Real Knowledge Workflow Dev Pragmatic Drag and Drop for Real Ordering Tasks Dev Prisma and PostgreSQL as the Product Source of Truth Dev Ralph Loop as a Plan Queue Dev React Router for Full-Stack Product Workflows Dev shadcn-Style UI as an Owned Product System Dev Dense Operational UI with Tables and Editors Dev Terminal Spike: a Native Android Terminal Dev Input Chinese pinyin with tones on Linux with fcitx Dev How to configure the DEFT Pro trackball on Linux Dev Use Pocket (read it later) on KOReader Dev Vercel AI SDK with Explicit Tool Boundaries Dev Vertical Slice Architecture with Dependency-Cruiser Dev Testing Product Workflows with Vitest and Playwright Dev Zod Beyond Validation Dev The Brothers Karamazov is the best novel I have ever read Journal Oral history of two Christians in a Chinese labour camp in the 1960s Journal The Word in the Bible Journal We love because He first loved us, not meaningless self-love Journal Mom, let me take the blame for Dad's mistakes Journal My story with God Journal The world is far from God, close to China Journal The Five Love Languages and Extrovert Only Exist in Language Journal Personality types don't exist, life is not a matching game Journal Dangerous words, why psychology is impossible Journal The story of a Shenzhen worker in 2000 Journal A Conversation with a Driver in Ras Al Khaimah Journal Shadian: a 1975 conflict between Communist forces and Muslims in China Journal Documentaries About China Journal
← Dev/Tools

Codex anywhere with tmux, Mosh, Termius, and Tailscale

A practical mobile setup for using Codex from a phone with Mosh, Tailscale, and a durable tmux session.

My current mobile Codex setup is deliberately simple: I use Termius on my phone to connect to my own laptop, then run Codex inside a tmux session. For a normal connection I use SSH; on a less reliable mobile network I use Mosh instead.

When I am at home, this is just SSH over my home Wi-Fi. When I am outside, I turn on Tailscale and use the same Termius profile against the laptop’s Tailscale address. The workflow stays the same:

Phone -> Termius -> Mosh or SSH -> laptop -> tmux -> Codex

Mosh makes the interactive connection more forgiving. It starts through SSH, then uses UDP so the terminal can survive short interruptions and roam between Wi-Fi and mobile data. On my Arch Linux laptop, the server is a small install:

sudo pacman -S mosh

I can then connect to the laptop by its Tailscale hostname or address:

mosh jiyu@my-laptop

Mosh does not replace tmux. Mosh keeps a shaky connection usable; tmux keeps Codex running when the terminal client is closed, the Mosh session eventually ends, or I want to reconnect from another device. That separation is the important part of the setup.

tmux new -s codex

Later, reconnect with:

tmux attach -t codex

I also tested remote control through the Codex app. The UI is better for phone use, but on Arch Linux it is not an official target for me, and the connection has been too slow and unreliable. A nicer UI does not help much when the session keeps dropping.

So I went back to the boring setup that works: Termius on the phone, Mosh or SSH for the terminal connection, Tailscale for private networking when I am away from home, and tmux as the durable shell on the laptop.

It is not elegant, but it gives me the thing I actually need: access to the same local development environment from anywhere, without pretending the phone is the development machine.