Claude Code is Anthropic's agentic coding tool: it reads your codebase, runs commands, edits files, and commits code. It's built for the terminal, and it runs on a server, not on the phone. That's exactly why your iPhone can drive it: anything that holds an SSH session can reach the agent.
What do you need to run Claude Code on iPhone?
Three things:
- An iPhone with an SSH terminal app
- A server with SSH access (a cloud VPS, or a home machine on Tailscale)
- A Claude Code subscription (Anthropic Max plan) or API key
Step 1: Make Sure You Can Reach the Server
Before anything else, your phone has to be able to open an SSH connection to the box. If it's a cloud VPS with a public IP, you're set; connect straight to it from anywhere. If Claude Code lives on a machine behind NAT, say a Mac mini, a Raspberry Pi, or your laptop at home, it has no public address, so put it on a private network like Tailscale and reach it over its tailnet address. This step is unavoidable for NAT'd hosts regardless of which app you use; it's how the network works.
Step 2: Install Claude Code on the Server
If it isn't installed yet, SSH in and install it:
npm install -g @anthropic-ai/claude-code
Authenticate with your Anthropic account or set your API key as an environment variable.
Step 3: Connect from Your iPhone
Add your server (hostname or tailnet address, username, SSH key) and connect. You get a full, real terminal; Claude Code's interactive UI renders natively.
Step 4: Start Claude Code Inside tmux
Don't launch the agent in a bare session; if your phone locks or switches networks, the connection can drop and take the agent with it. Start it inside tmux so it survives:
tmux new -s claude
Then, in your project directory, run:
claude
Claude Code launches in interactive mode, the same interface as on a desktop terminal, file diffs and tool calls and all, rendered on your phone. If you disconnect, reattach later with tmux attach -t claude and it's exactly where you left it.
Step 5: Give It a Task
Type your task in natural language:
- "Fix the failing CI tests in the payments module"
- "Add rate limiting to the API endpoints"
- "Refactor the database queries to use connection pooling"
Claude Code reads the relevant files, proposes changes, and executes them after your approval.
Tips for running Claude Code on iPhone
- Use headless mode for long tasks:
claude -p "your task here"runs without interactive prompts - Name a tmux session per task:
tmux new -s fix-auth,tmux new -s migrate-db, so several agents stay untangled - Start big tasks before idle time (commute, lunch, overnight) and let the agent work while you're away
Can you run Claude Code on an iPad?
Yes, and the steps above are unchanged. Claude Code runs on the server either way, so the iPad is doing exactly what the iPhone does: holding an SSH session to the machine where the agent actually lives. Every command in this guide works as written.
What the iPad adds is room. Agent output is dense, with file diffs, tool calls, and multi-line plans, and the extra screen makes a long run genuinely readable rather than a scroll. Split View lets you keep documentation or the repo on GitHub next to the session. Most usefully, a hardware keyboard turns tmux attach -t claude and interrupt sequences like Ctrl-C back into muscle memory instead of a hunt through a touch key bar.
The limits are the same ones, though. iPadOS suspends backgrounded apps, so switching away long enough still drops the connection, which is why starting the agent inside tmux matters just as much here. And an iPad behind the same NAT as everything else still needs a way in, covered in SSH without port forwarding.
Why Not Just Use a Laptop?
You absolutely can. But laptops aren't always available. Claude Code on mobile isn't about replacing your desk setup; it's about never being blocked. Incident at 2 AM, idea on the train, quick fix between meetings. Your phone is always there.
For the deeper version of the reachability and session-persistence problem, and where the manual tmux-and-Mosh dance starts to chafe on a phone, see running AI coding agents from your iPhone over SSH. Still picking an SSH client? The Termius vs Blink comparison covers the options, or start from scratch with the SSH from iPhone guide. If you'd rather skip the tmux ceremony and get native push when the agent needs you, that's what Onepilot is built for.
