Using Claude Code and Codex from your phone: three ways compared
There are three ways to keep using Claude Code or Codex from your phone. With an official remote control (Claude Code's Remote Control, or Codex in the ChatGPT mobile app), the phone is only a remote and the agent keeps running on your computer. With cloud tasks, the agent runs in the vendor's cloud sandbox. With SSH plus tmux, a terminal app on the phone connects straight to the server where the agent runs. The first two are the quickest to set up but come with requirements on your plan, host OS and how you reach the API. The third works with any command-line agent on any machine you can SSH into.
Checked against the official documentation as of October 2026; commands were tested with Claude Code 2.1.302 and Codex CLI 0.163.
The three ways at a glance
| Official remote control | Cloud tasks | SSH + tmux | |
|---|---|---|---|
| Agent runs on | Your computer | Vendor's cloud | Your server or computer |
| On the phone | Claude app / ChatGPT app | Claude app / ChatGPT app | An SSH terminal app |
| Host requirements | Claude: any system that runs claude. Codex: the ChatGPT desktop app on a Mac or Windows PC | None; the cloud environment must be able to fetch your code | Any Linux, macOS, BSD or Windows host you can SSH into |
| Account | Claude: Pro / Max / Team / Enterprise plan, no API keys. Codex: a ChatGPT account, subject to rollout | The vendor's subscription | Anything: API keys, Bedrock and self-hosted gateways all work |
| Agents | Each vendor's own only | Each vendor's own only | Any CLI agent: Claude Code, Codex, Gemini CLI, Grok… |
| Phone experience | Native chat UI with push notifications | Native chat UI | The full terminal UI; driving a TUI on a small screen takes some getting used to |
Way one: Claude Code Remote Control
Remote Control connects the Claude app (iOS and Android) or claude.ai/code in a browser to a Claude Code session running on your machine. Claude runs on your machine the whole time, so your files, MCP servers and project configuration are all available, and you can send messages from the terminal and the phone interchangeably.
Starting it
# An interactive session you can also drive remotely, started in the project directory
claude --remote-control "my-project"
# Or server mode, which lets you start several sessions from the phone
claude remote-control
# Already inside Claude Code: hand the current session to your phone
/remote-control
In server mode, press the spacebar to show a QR code and scan it with your phone, or find the session in the Claude app's session list.
Requirements and limits
- Plan: Pro, Max, Team or Enterprise, signed in with
/login. On Team and Enterprise, an Owner has to turn on Remote Control in the admin settings first. - No API keys or third-party endpoints: it is unavailable with Amazon Bedrock, Google Cloud, Microsoft Foundry, or when
ANTHROPIC_BASE_URLpoints to a proxy or gateway. - The
claudeprocess must keep running: close the terminal and the session goes offline. The official docs recommend starting it inside tmux or screen on a remote machine so it survives an SSH disconnect. - Network outages: an interactive session keeps retrying and reconnects when the network returns; server mode gives up after about 10 minutes and has to be restarted.
- Some commands are terminal-only, such as
/pluginand/resume./model,/compact,/contextand others work from the phone. - Turn on push notifications in
/configto get a notification on your phone when Claude needs an approval or an answer.
Way one: Codex in the ChatGPT mobile app
OpenAI offers Codex in the ChatGPT mobile app. The phone connects to a paired computer and the agent runs there; from the phone you start tasks, read terminal output and diffs, and approve commands.
- On a Mac or Windows PC, open the ChatGPT desktop app, go to Settings → Connections → Control this Mac or PC, choose Set up and complete the verification.
- Scan the QR code with your phone, sign in to the same ChatGPT account and workspace, and approve the connection.
- Open Codex in the mobile app, pick the computer and project, and describe the task.
- The computer has to stay on, awake and online.
- The official docs only list the desktop app on Mac and Windows as the controlled machine; they don't mention Linux servers or the standalone Codex CLI. If your code and toolchain live on a Linux dev box, this route doesn't fit.
- OpenAI notes that availability depends on rollout and your workspace settings, so check what your account shows.
Way two: cloud tasks
Both Claude Code and Codex can run tasks in the vendor's cloud: pick a repository on your phone, describe the change, and the agent edits code in a cloud sandbox while you review the diff and open a PR. Your computer can stay off, which suits "I just thought of a change, let me hand it off".
The trade-off is that the agent can't see your own environment: internal services, local databases, private dependencies, GPUs and CLI tools you're already signed in to are all out of reach, and the build and tests have to be reproducible in the cloud environment. That's a different job from local development, so the rest of this post leaves it aside.
Way three: SSH + tmux into your server
The most general approach is to run the agent inside tmux on the server and connect from the phone over SSH. tmux decouples the work from the phone's connection: lock the screen, lose signal or switch networks, and the task keeps running on the server; reconnect and reattach. Any command-line agent works this way, with no restriction on accounts or how you reach the API.
1. Install the agent and tmux on the server
# Ubuntu / Debian
sudo apt install openssh-server tmux mosh
# Sign in to the agent on the server once
claude # or codex, gemini
mosh is optional; with it, the phone can switch between Wi-Fi and mobile data without dropping the connection. See the mosh and tmux guide for setup and common errors.
2. Start the agent inside tmux
tmux new -A -s claude # attach if the session exists, otherwise create it
cd ~/my-project
claude --permission-mode plan # plan first, edit only after you approve
After a disconnect, run tmux new -A -s claude again to get back to the same screen with all of the agent's output intact. The read-only equivalent for Codex is codex --sandbox read-only. Think twice before using --dangerously-skip-permissions or --dangerously-bypass-approvals-and-sandbox from a phone: they skip every confirmation, and on a small screen it's hard to notice in time what the agent did.
3. Reach it from anywhere
When the server is on a home or office network, join it to Tailscale and connect to its 100.x.y.z address from the phone, so SSH never has to face the internet. If relayed connections are slow where you are, run your own DERP relay.
4. Combine them
Remote Control and tmux don't conflict: run claude --remote-control inside tmux on the server, and you can chat from the Claude app and still SSH in to see the full terminal, or run Codex and tail logs on the same machine.
What's hard about a TUI on a phone
The biggest problem with the SSH route isn't the connection, it's the phone keyboard: Claude Code and Codex rely on Esc, Shift+Tab, the arrow keys and Ctrl+C, none of which a phone keyboard has. The keys you'll use most:
| Key | Claude Code | Codex |
|---|---|---|
| Esc | Interrupt the current reply | Interrupt the current reply |
| Esc Esc | Rewind to an earlier message | Edit the previous message |
| Shift+Tab | Switch mode (default / accept edits / plan) | Toggle Plan mode |
| ↑ ↓ | Browse input history, move between options | Browse input history, move between options |
| Ctrl+C | Clear input or cancel | Clear input or quit |
Other friction: long prompts are awkward to edit in a terminal input box; sending a screenshot to the agent means uploading it to the server first; and with several agents running, you have to attach to each one to find out which is waiting for you.
The SSH route with Roamtty
Roamtty is a phone SSH terminal (Android and iPhone) built for this, and turns the steps above into buttons:
- One-tap agent launch: pick a host, folder, agent (Claude Code, Codex, Grok) and permission mode. The app creates a separate tmux session on the server and passes the matching flags, for example
claude --permission-mode planfor plan mode. - Session cards: the home screen groups every agent into needs approval, running and done. Tap Allow on a card that's waiting, or Follow up on a finished one to give the next instruction, without opening the terminal.
- tmux and mosh: each session is its own remote tmux session and reattaches automatically. With mosh installed the terminal prefers UDP and falls back to SSH after 8 seconds without a reply. Both can be installed from inside the app.
- Keys: press and hold the little ghost at the screen edge for a shortcut ring with the keys of whichever agent is in front, Claude Code, Codex, Grok or Gemini CLI (Esc Esc, Shift+Tab, Ctrl+C and so on). Swipe left or right for arrow keys, double-tap for Tab.
- Images and long text: insert up to 9 images at once; they're uploaded and their server paths are typed into the prompt. Write long prompts in a full-size text box before sending.
Roamtty has no backend server and never handles your agent accounts or API keys; connections go only to hosts you add. Roamtty will soon be open source; the iPhone app is on the App Store (not yet available in mainland China), and the Android app is coming soon to Google Play. See the documentation for details.
Which one to pick
- You only use Claude Code, have a Pro or Max plan and mostly work on your own computer: start with Remote Control; it's the least effort.
- You only use Codex and your machine is a Mac or Windows PC: use Codex in the ChatGPT mobile app.
- The change doesn't depend on your local environment and you'd rather not keep a computer on: use cloud tasks.
- Your code is on a Linux server or dev box, you use API keys or a company gateway, you run several kinds of agents, or you want the full terminal on your phone: use SSH + tmux.
FAQ
| Question | Answer |
|---|---|
| Does the agent stop when my phone locks? | Not with Remote Control or SSH + tmux: the agent runs on your computer or server, as long as the claude process or tmux session is still there and the computer isn't asleep. |
| Remote Control says it needs a claude.ai subscription | You're on an API key or a third-party endpoint. Sign in to a subscription with /login and unset ANTHROPIC_BASE_URL and similar variables; if you can't, use the SSH route. |
| The ChatGPT app doesn't list my computer | The controlled machine must be the ChatGPT desktop app on a Mac or Windows PC, kept awake and signed in to the same account and workspace as the phone. |
| The agent exits when SSH disconnects | It wasn't running in tmux. Run tmux new -A -s name first, then start the agent. |
| I can't reach my home server when I'm out | Use Tailscale; see Connecting from anywhere in the docs, and run your own DERP relay if relays are slow. |