I’ve been using Claude Code (Anthropic’s CLI coding assistant) for a few months now, and one thing that kept bugging me was being tethered to my desk. What if I wanted to kick off a long-running task while away from my computer? Or review what Claude had done while sitting on the couch?

The solution turned out to be surprisingly simple: tmux on a home server + Termius on my phone.

The Problem

Claude Code runs in a terminal. It’s interactive, often long-running, and you definitely don’t want to lose your session if your SSH connection drops. Standard SSH from a phone is painful - connections drop when you switch apps, lock your screen, or hit a spotty cell signal.

I needed:

  • Persistent sessions that survive disconnects
  • A mobile SSH client that doesn’t suck
  • The ability to pick up exactly where I left off

The Solution

┌─────────────────┐         ┌─────────────────┐         ┌─────────────────┐
│     Phone       │   SSH   │   Home Server   │         │   Claude Code   │
│   (Termius)     │────────▶│     (tmux)      │────────▶│   (running)     │
└─────────────────┘         └─────────────────┘         └─────────────────┘
                                   │
                                   │ Session persists
                                   │ even when phone
                                   ▼ disconnects
                           ┌─────────────────┐
                           │ Desktop/Laptop  │
                           │ (attach later)  │
                           └─────────────────┘

The workflow:

  1. SSH into my home server from anywhere
  2. Attach to (or create) a tmux session
  3. Run Claude Code inside tmux
  4. Disconnect whenever - the session keeps running
  5. Reconnect from any device and pick up where I left off

tmux Basics

tmux (terminal multiplexer) lets you run terminal sessions that persist after you disconnect. If you’ve never used tmux, think of it as a “save state” for your terminal.

Install tmux:

sudo dnf install tmux

There are only three commands you really need:

Create a New Session

tmux new-session -s claude

This creates a named session called “claude”. Inside the session, run Claude Code:

claude

Detach from a Session

Press Ctrl+b then d to detach. The session keeps running in the background - Claude continues working even after you disconnect.

List Sessions

tmux list-sessions

Shows all running sessions:

claude: 1 windows (created Wed Dec 31 10:15:22 2025)

Attach to an Existing Session

tmux attach -t claude

This reconnects you to the session exactly where you left off.

That’s it. Those four operations cover 95% of what you need for running Claude Code remotely.

Termius on Mobile

I use Termius on my Pixel 8 Pro. The main reason: it maintains your SSH connection when you switch apps or lock your phone. Most SSH clients kill the connection immediately.

Setup is straightforward:

  1. Install Termius from the Play Store
  2. Add your server as a new host
  3. Set up SSH key authentication (password typing on mobile is painful)

Termius has a configurable toolbar above the keyboard with modifier keys. The essential ones for tmux:

  • Ctrl - For the tmux prefix (Ctrl+b)
  • Esc - Useful for canceling operations

The Workflow in Practice

Starting a New Session

From my phone:

  1. Open Termius
  2. Tap my home server connection
  3. Run tmux new -s claude (or tmux attach -t claude if session exists)
  4. Start Claude Code with claude
  5. Give it a task

Picking Up Later

Later, from my laptop:

ssh homeserver
tmux attach -t claude

I’m right back where I left off. If Claude finished its task, I can review the output. If it’s waiting for input, I can continue the conversation.

Gotchas

Screen Size

Claude Code’s output can be wide. On a phone:

  • Use landscape mode for wider output
  • Termius lets you pinch-to-zoom
  • Claude Code respects terminal width - smaller screens get wrapped output

Slow Typing on Mobile

Typing long prompts on a phone keyboard is tedious. My workarounds:

  • Keep prompts short and iterative
  • Prepare longer prompts in a notes app, then paste
  • Use voice-to-text for longer inputs

Connection Drops Still Happen

Even with Termius, connections can drop on bad networks. tmux handles this gracefully - just reconnect and reattach. Your Claude session is untouched.

Conclusion

The combination of tmux and Termius turned Claude Code into a mobile-friendly tool. I’m no longer tied to my desk for coding tasks. The persistent sessions mean I can context-switch freely - start something on my phone, continue on my laptop, check progress from my tablet.

The setup is minimal:

  • tmux on any Linux server (just learn attach, detach, list)
  • Termius on your phone
  • Claude Code installed on the server

Is it as good as a full desktop setup? No. But for quick tasks, monitoring long-running operations, and staying productive away from my desk, it’s been great.