> ## Documentation Index
> Fetch the complete documentation index at: https://mint.skeptrune.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Run Claude Code on Your Phone with Termux and Tailscale

> SSH into your desktop from Android using Tailscale and Termux. Get full terminal access, tmux session persistence, and mobile browser testing in 20 minutes.

There's a mini gold rush to put [Claude Code](https://claude.ai/claude-code) on your phone. Some startups are building custom apps, others are creating managed cloud environments. They're solving real problems, but you're trading raw Unix power for convenience. If you have a desktop and 20 minutes, you can get full kernel access with SSH, [Termux](https://termux.dev/en/), and [Tailscale](https://tailscale.com/).

This approach was proven in practice: shipping a feature to a live blog from the passenger seat of a car driving from San Francisco to Apple Hill, CA — SSH'd into an office desktop, prompted Claude to make changes, tested on the phone's browser, and pushed to production in 10 minutes.

This guide walks through SSH-based mobile development with Claude Code. If you have a desktop that stays on (or a cheap VPS), you can get full terminal access from your phone with session persistence, port forwarding, and the ability to test your code on your actual mobile browser. The initial setup takes about 20 minutes and just works once configured.

## The architecture

The setup uses five standard Unix tools that work together without custom integration:

| Tool          | Role                                                     |
| ------------- | -------------------------------------------------------- |
| **Desktop**   | Runs Claude Code and your development environment        |
| **Tailscale** | Creates a private encrypted network between your devices |
| **Termux**    | Gives you a real terminal on Android                     |
| **SSH**       | Handles the connection between phone and desktop         |
| **tmux**      | Keeps your sessions alive when you disconnect            |

## Setup

<Steps>
  <Step title="Set up your desktop">
    You need a computer that stays on. This could be a home desktop, an office desktop, a cloud VM, or a home server. It doesn't need to be powerful — Claude Code just makes API calls, the actual compute happens at Anthropic.

    Install Claude Code globally using npm:

    ```bash theme={null}
    npm install -g @anthropic-ai/claude-code
    ```

    Install tmux for session persistence. When you disconnect from SSH (phone locks, network drops, whatever), tmux keeps your Claude Code session running in the background:

    <Tabs>
      <Tab title="Ubuntu/Debian">
        ```bash theme={null}
        sudo apt install tmux
        ```
      </Tab>

      <Tab title="macOS">
        ```bash theme={null}
        brew install tmux
        ```
      </Tab>
    </Tabs>

    With Claude Code and tmux installed, your desktop is ready to host development sessions.
  </Step>

  <Step title="Install Tailscale everywhere">
    Tailscale creates a private network between all your devices. Your phone gets a stable IP address that can reach your desktop, even when you're on different networks.

    On your desktop, run the Tailscale installer and bring up the connection:

    ```bash theme={null}
    curl -fsSL https://tailscale.com/install.sh | sh
    sudo tailscale up
    ```

    The `tailscale up` command will prompt you to authenticate in your browser. Install Tailscale on your phone from the Play Store and sign in with the same account. Your devices are now on the same private network.

    Grab your desktop's Tailscale IP address — you'll need it to connect:

    ```bash theme={null}
    tailscale ip -4
    ```

    You'll get something like `100.64.0.5`. That's your desktop's address on the Tailscale network. It's stable, private, and works from anywhere.
  </Step>

  <Step title="Install Termux on your phone">
    Termux is a terminal emulator for Android that gives you a real Linux environment — not a toy terminal. A real one with bash, ssh, and full package management.

    <Warning>
      Install Termux from F-Droid, not the Play Store. The Play Store version is outdated and broken. Get it from [https://f-droid.org/en/packages/com.termux/](https://f-droid.org/en/packages/com.termux/).
    </Warning>

    Once installed, update the package repositories and install the SSH client:

    ```bash theme={null}
    pkg update
    pkg install openssh
    ```
  </Step>

  <Step title="SSH into your desktop">
    Open Termux and SSH to your desktop using the Tailscale IP you grabbed earlier. Replace `100.64.0.5` with your actual IP and `your-username` with your desktop username:

    ```bash theme={null}
    ssh your-username@100.64.0.5
    ```

    The first time you connect, SSH will ask you to verify the host fingerprint. Type `yes`, then enter your password.

    You're now running a shell on your desktop, from your phone, over a secure encrypted connection that works anywhere you have internet.
  </Step>

  <Step title="Use tmux for session persistence">
    From your SSH session, start a new tmux session with a name you'll remember. Name it after the project you're working on:

    ```bash theme={null}
    tmux new -s code
    ```

    Inside the tmux session, launch Claude Code:

    ```bash theme={null}
    claude
    ```

    You're now coding from your phone using Claude Code running on your desktop.

    When you need to disconnect, don't exit Claude Code and don't exit tmux. Just close Termux or let your phone lock. The tmux session stays running on your desktop.

    When you want to code again, SSH back in and reattach:

    ```bash theme={null}
    ssh your-username@100.64.0.5
    tmux attach -t code
    ```

    Your conversation with Claude is still there, your file context is still loaded, and you can continue immediately.
  </Step>
</Steps>

## Why this works better than custom apps

Every startup trying to solve "Claude Code on mobile" is building abstractions on top of these primitives. They're not giving you anything you can't already do with SSH and Termux. They're just wrapping it in a prettier UI and charging for hosting.

When you do it yourself, you get several advantages:

**Port forwarding just works.** With Tailscale, your desktop's ports are directly accessible from your phone. No configuration, no exposing services to the public internet, no proxies adding latency.

**Full CLI access.** Want to run your dev server with `--host` so you can test on your phone's browser? Just add the flag. Need to adjust firewall rules, modify server configs, or install system packages? You have root access. Native mobile coding apps can't offer this level of control.

**Session persistence that actually works.** tmux was built for this. Your session survives network disconnections, phone reboots, and SSH reconnects. You never lose your place.

**Your own hardware.** Your desktop has your SSH keys, your git credentials, your environment exactly how you configured it. You're not coding in a disposable cloud container.

## The mobile experience

Coding on a phone isn't as good as coding on a desktop. The screen is small, the keyboard is mediocre, and you can't see multiple files at once. But Claude Code is different from traditional coding.

You're not typing out functions character by character. You're describing what you want, reviewing Claude's changes, and approving or rejecting them. That workflow translates to mobile well. You're reading more than you're typing, and phones are great for reading.

The Apple Hill example isn't cherry-picked. Real features ship from a phone. Production bugs get fixed while getting coffee. Pull requests get reviewed from the back of an Uber. It's not a primary development environment, but it's shockingly capable when needed.

## Practical tips

Once the basic setup is running, these tweaks make the mobile coding experience dramatically better.

### Test your changes on your phone's browser

This is the killer feature. You're not just editing code remotely — you can test it on your phone while the dev server runs on your desktop.

Start your dev server with the `--host` flag, which makes it accessible on your Tailscale network instead of just localhost:

<Tabs>
  <Tab title="Vite / Astro">
    ```bash theme={null}
    yarn dev --host
    ```

    This binds the dev server to `0.0.0.0` instead of `127.0.0.1`.
  </Tab>

  <Tab title="React (CRA)">
    ```bash theme={null}
    npm start -- --host
    ```
  </Tab>

  <Tab title="Next.js">
    ```bash theme={null}
    next dev -H 0.0.0.0
    ```
  </Tab>

  <Tab title="Django">
    ```bash theme={null}
    python manage.py runserver 0.0.0.0:8000
    ```
  </Tab>
</Tabs>

Then navigate to `http://100.64.0.5:4321` on your phone's browser (replace with your Tailscale IP and port). You're now viewing your local dev server in your phone's browser, testing on the actual target device with the actual screen size and layout.

### Use SSH keys

Don't type your password every time you SSH. Generate an SSH key on your phone and add it to your desktop's authorized keys:

```bash theme={null}
ssh-keygen -t ed25519
ssh-copy-id your-username@100.64.0.5
```

### Create an SSH config

Make connecting faster by adding an alias in Termux's SSH config at `~/.ssh/config`:

```
Host desktop
    HostName 100.64.0.5
    User your-username
```

Now you can type `ssh desktop` instead of the full IP and username every time.

### Use a better keyboard

Termux works with external Bluetooth keyboards. When actually trying to get work done on a phone, a small keyboard makes a massive difference. The phone screen is fine for reading; the keyboard makes typing bearable.

### Set up tmux keybindings

tmux's default keybindings are terrible on mobile. On your desktop, create or edit `~/.tmux.conf`:

```bash theme={null}
# Use Ctrl-A instead of Ctrl-B (easier to type on phone)
unbind C-b
set -g prefix C-a
bind C-a send-prefix

# Split panes with | and -
bind | split-window -h
bind - split-window -v
```

### Run multiple sessions

You can have multiple tmux sessions for different projects:

```bash theme={null}
tmux new -s backend
tmux new -s frontend
tmux new -s experiments
```

List running sessions with `tmux ls`, then attach to whichever one you want:

```bash theme={null}
tmux attach -t frontend
```

## Security considerations

You're SSH'ing into your desktop over the internet. Do it right with a few precautions.

<Warning>
  Never expose SSH directly to the public internet. Always use Tailscale to create a private network between your devices. Your SSH traffic stays encrypted and never touches the public internet directly.
</Warning>

**Disable password authentication.** Keys are longer, stronger, and can't be brute-forced. Edit `/etc/ssh/sshd_config` on your desktop:

```
PasswordAuthentication no
PubkeyAuthentication yes
```

Restart sshd after saving.

**Keep your phone secure.** Your phone now has SSH access to your development machine. Use a strong PIN or biometric lock, enable disk encryption, and consider using a password manager for your SSH key passphrase.

**Monitor SSH access.** Check who's connected with `who` or `w`. Check SSH logs with:

```bash theme={null}
sudo tail -f /var/log/auth.log
```

If you see connections you don't recognize, revoke SSH keys and investigate.

## When this doesn't work

**No persistent desktop.** If you don't have a computer that stays on, rent a \$5/month VPS from [DigitalOcean](https://www.digitalocean.com/) or [Hetzner](https://www.hetzner.com/), install Tailscale and Claude Code, and SSH into it the same way.

**iOS instead of Android.** Termux isn't available on iOS. Use a different SSH client like [Blink](https://blink.sh/) or [Prompt](https://panic.com/prompt/) instead. The rest of the setup is identical.

**Unstable internet.** [Mosh](https://mosh.org/) (mobile shell) is designed for high-latency or unreliable connections. Install it on both your phone and desktop, then use `mosh desktop` instead of `ssh desktop`. It handles disconnections gracefully and keeps your terminal responsive even on bad networks.

## The bottom line

Mobile development with Claude Code doesn't require new infrastructure or custom applications. The components you need are SSH, Tailscale, Termux, and a desktop that stays on — standard Unix tools that have been solving remote access problems for decades.

SSH has been the standard for secure remote access since 1995. Tmux has provided session management since 2007. Tailscale is built on WireGuard, which has undergone extensive security audits. These tools are mature, well-documented, and widely deployed in production environments.

If you have a desktop or VPS and 20 minutes for setup, you can have this working today.
