Curated
Claude Code in Your Pocket — Dead Simple 60-Second Setup

Claude Code in Your Pocket — Dead Simple 60-Second Setup

IndiJo|
Source

Already have a way to access Claude from your phone? Ask yourself: does it cost money? Does it depend on a third-party server? If yes, keep reading.

TL;DR: Tailscale + Moshi = control your Mac's AI agent from your iPhone. Core setup takes under 60 seconds. No port forwarding, no complex networking, no VPS fees. Peer-to-peer, no middleman. (If you can already SSH to your Mac and know how to connect to it, you only need Moshi—15 seconds.)

Why This Setup Exists

You kick off a task with Claude Code, then step away. Grab coffee. Take a walk. Commute home.

But you want to stay in the loop. Check progress. Steer the direction. Give feedback before it goes too far down the wrong path.

image

The solution: keep the agent running on your Mac, check in and course-correct from your phone

This guide walks through the setup step by step—optimized for simplicity without sacrificing security.

What You'll Need

  • A Mac — Any Mac that can run Claude Code
  • An iPhone — For remote access via Moshi
  • Homebrew — macOS package manager (install guide)
  • 60 seconds — One command, one toggle, one app
  • Step 1: Enable Remote Login (10 seconds)

  • Open System Settings
  • Go to General → Sharing
  • Enable Remote Login
  • image

    This starts the SSH server that Moshi connects to.

    Step 2: Set Up Tailscale (35 seconds)

    Tailscale creates a secure private network between your devices. No port forwarding, no exposing your Mac to the internet.

    On your Mac:

    text
    brew install tailscale && sudo tailscale up --ssh

    Get your Tailscale IP (you'll need this):

    text
    tailscale ip # Example output: 100.64.0.1

    On your iPhone:

  • Install Tailscale from the App Store
  • Sign in with the same account
  • Done—your devices can now reach each other securely.

    Tailscale is free for personal use (up to 100 devices).

    Step 3: Set Up Moshi on Your iPhone (15 seconds)

    Moshi is a native iOS terminal built on mosh, designed specifically for workflows like this.

  • Install Moshi via TestFlight (currently in beta)
  • Tap + to add a server
  • Enter your Mac's Tailscale IP as the host
  • Enter your Mac username
  • Authenticate with SSH key (Moshi stores keys in the Secure Enclave, protected by Face ID)
  • Connect. You're in.

    image

    Using It: The Daily Workflow

    Start Claude on your Mac

    text
    $ claude

    Connect from your iPhone

    Open Moshi → tap your Mac → you're in.

    That's it

    Check progress, read output, give new instructions—all from your phone.

    Note: With this minimal setup, if you close Moshi or your connection drops, you'll need to restart Claude. Want sessions that survive disconnects? See the optional tmux section below.

    Push Notifications: Stay in the Loop

    Configure Claude to ping your phone with progress updates.

    Enable notifications in Moshi

  • Open Moshi → Settings → Notifications
  • Enable notifications
  • Copy your webhook token
  • image

    Tell Claude how to notify you

    Add this to your project's CLAUDE.md:

    markdown
    ## Notifications When you complete a task or hit a milestone, notify me: curl -s -X POST https://api.getmoshi.app/api/webhook \ -H "Content-Type: application/json" \ -d '{"token": "YOUR_TOKEN", "title": "Status", "message": "Brief summary"}'

    Replace YOUR_TOKEN with your Moshi webhook token.

    Now you get updates on your iPhone and Apple Watch. Tap to jump straight into your session.

    Optional: Add mosh + tmux for Persistent Sessions

    We moved this to optional so we could claim "60-second setup." But honestly, this is how you'll want to run it.

    The basic setup works, but has a limitation: close Moshi or lose your connection, and Claude stops. For long-running sessions, you want persistence.

    Install mosh and tmux:

    text
    brew install mosh tmux

    Tool What it does mosh Keeps your connection alive across network changes, sleep, WiFi → cellular tmux Keeps your session alive even when disconnected

    Why mosh?

    SSH dies when your network changes. Mosh uses UDP with state synchronization—switch networks, let your phone sleep, walk out of WiFi range, and you're still connected.

    According to the mosh research paper, on networks with 29% packet loss, mosh reduced response times from 16.8 seconds to 0.33 seconds. That's a 50x improvement.

    Why tmux?

    Mosh keeps your connection alive. tmux keeps your session alive. Different things.

    Close Moshi, your Mac restarts, whatever—Claude keeps running in tmux. Reconnect later and pick up where you left off.

    It also gives you scrollback. Mosh alone has none (it only syncs visible screen state).

    Using it

    text
    # Start a named session tmux new -s claude # Run Claude inside claude

    Now you can disconnect anytime. Reconnect with:

    tmux configuration (optional)

    text
    tmux attach -t claude

    Create ~/.tmux.conf:

    text
    set -g history-limit 50000 # More scrollback set -g mouse on # Touch scrolling set -g set-titles on # Pass titles to Moshi set -g set-titles-string "#S:#W"

    Essential tmux commands

    Keys Action

  • Ctrl+B, d Detach (leave session running)
  • Ctrl+B, [ Enter scroll mode
  • q Exit scroll mode
  • Moshi has a dedicated tmux shortcuts panel for these.

    Optional: Prevent Sleep for Always-On Operation

    If you want your Mac to stay awake indefinitely:

  • Open System Settings
  • Go to Energy Saver (or Battery → Options on laptops)
  • Enable Prevent automatic sleeping when the display is off
  • Enable Wake for network access
  • image

    For one-off sessions without changing system settings, use caffeinate:

    text
    # Prevent sleep while Claude runs caffeinate -s -- claude # Or prevent sleep for 4 hours caffeinate -t 14400 -- claude

    Security Notes

    This setup is secure by default, but here's why:

    Tailscale handles authentication

    With --ssh flag, Tailscale manages SSH authentication using your Tailscale identity. No passwords to brute-force, no keys to manage manually.

    Nothing exposed to the internet

    Your Mac's SSH port isn't open to the public. Only devices on your Tailscale network can reach it.

    Keys in Secure Enclave

    Moshi stores SSH keys in the iPhone's Secure Enclave—hardware-backed security, protected by Face ID.

    Optional hardening

    If you want to go further, disable password authentication entirely:

    Troubleshooting

    Can't connect from iPhone?

  • Verify both devices show as connected in Tailscale
  • Check that Remote Login is enabled on your Mac
  • Try tailscale ping from another device
  • Session died?

  • If tmux is still running: tmux attach -t claude
  • If tmux died: start fresh with tmux new -s claude
  • Mosh connection drops immediately?

  • Ensure mosh-server is installed: which mosh-server
  • Check firewall isn't blocking mosh (UDP 60000-61000)
  • FAQ

    Why not just use a VPS?

    Your Mac has your local environment, your SSH keys, access to your local network, and macOS-specific tools (Xcode, Simulator). No monthly fees either.

    What if I lose internet completely?

    Your tmux session keeps running on the Mac regardless. Mosh will reconnect automatically when connectivity returns—even if your IP changes.

    Does the agent keep working if I close Moshi?

    With tmux, yes. Claude runs in tmux on your Mac. Moshi is just a window into that session.

    Battery impact on iPhone?

    Minimal. Moshi only uses resources when the app is open. Push notifications use Apple's standard infrastructure.

    Cost?

    Tailscale: Free for personal use Moshi: Free

    Further Reading

  • mosh: Mobile Shell — Technical details on the protocol
  • tmux Wiki — Comprehensive tmux documentation
  • Tailscale SSH — How Tailscale handles SSH authentication
  • mosh Research Paper — The academic paper behind mosh's design
  • WireGuard Protocol — The VPN protocol Tailscale uses
  • Claude Code in Your Pocket — Dead Simple 60-Second Setup