Mastering AI agents
How to Use Claude Code and Codex from Your Phone (2026): Remote Control and Grok Build on a Remote PC
Claude Code, Codex and Grok Build can all work on another machine, but the official remote setups differ: Claude Code has Remote Control, Codex has Remote connections, and Grok Build has no phone control feature; its docs cover running the CLI on a remote machine over SSH. Requirements, setup steps and limits from the official docs as of 16 November 2026.
Kelvin Wang · · 12 min read
Key points
- In all three setups the code runs on the host; the phone only sends instructions and approvals. If the host sleeps or the program stops, the remote link goes with it.
- Claude Code Remote Control and Codex mobile remote control both need a subscription sign-in; signing in with an API key doesn't give you phone control.
- A Codex phone pairing host must be the ChatGPT desktop app on macOS or Windows; a Linux server joins as an SSH host of that desktop app.
- Grok Build's docs have no phone control feature. The documented remote route is SSH into the machine and sign in with grok login --device-auth.
All three tools share one design: the AI agent and your code live on the host, and the phone or second computer is a window for sending instructions, answering permission prompts and reading results. What differs is whether the vendor ships that window, and what the host has to run. Everything below comes from the Anthropic, OpenAI and xAI docs as checked on 16 November 2026. All three change often, so check the docs again before you set anything up.
Besides the Oracle host and my phone, I have three Macs: a Mac mini M4 Pro, a Mac mini M4 and an old MacBook Pro M1. I open Claude sessions on all of them to use as much of their memory as I can.
Three remote setups side by side
| Item | Claude Code | Codex | Grok Build |
|---|---|---|---|
| Official feature | Remote Control | Remote connections (mobile remote control, SSH hosts) | No remote control feature; the docs cover running the CLI on a remote machine over SSH |
| Plan | Pro, Max, Ultra, Team, Enterprise; no API keys | Mobile remote control: Plus, Pro, Business, Enterprise, not API. SSH hosts: all, including API | xAI sign-in, or XAI_API_KEY |
| Host | A machine running Claude Code (CLI, Desktop app or VS Code extension) | The ChatGPT desktop app on macOS or Windows, optionally connected to an SSH host | Any machine that runs Grok Build and accepts SSH |
| Control from | Claude app (iOS, Android) or claude.ai/code in a browser | The Codex tab in the ChatGPT app (iOS, Android), or the desktop app on another Mac or Windows PC | An SSH terminal |
| Code runs on | The host | The host or the SSH host it connects to | The remote machine |
| Connection | The host makes outbound HTTPS only, no inbound ports | OpenAI's relay; SSH hosts are started over SSH | Your own SSH |
Checked against each vendor's docs on 2026-11-16.
Plans and connection details come from each vendor’s docs12347.
How do you set up Claude Code Remote Control?
Remote Control connects the Claude app or claude.ai/code to a Claude Code session running on your machine. Claude keeps running locally, so files and commands stay on your machine; the phone and browser are views of the same session1.
Check three things first1:
- Sign in with a claude.ai account. Use
/logininsideclaude; API keys aren’t supported. On Team and Enterprise, an Owner has to turn Remote Control on in the Claude Code admin settings. - Keep the default API endpoint. Remote Control doesn’t work through Amazon Bedrock, Google Cloud or Microsoft Foundry, or with
ANTHROPIC_BASE_URLpointing at a gateway other thanapi.anthropic.com. - Make sure your organization allows it. Organizations with Zero Data Retention or the HIPAA configuration can’t enable it.
Setup:
- Start it in your project folder. Run
claude remote-control(aliasclaude rc). The first run asks whether to enable Remote Control and whether to trust the folder; answery1. - Connect from your phone. The terminal shows a URL; press the spacebar for a QR code and scan it to open the Claude app. Or open the Claude app, tap Code for the session list, and look for the computer icon with a green dot1.
- Turn on push notifications. In
claudeon the host, open/configand enable Push when actions required (permission prompts and questions), Push when Claude decides, or both. Sign in to the Claude app with the same account and allow notifications1.
Besides server mode, claude --remote-control starts an interactive session you can also type into locally, and /remote-control inside a running session moves the current conversation onto your phone. The Desktop app and the VS Code extension use /remote-control too1. In server mode, --spawn worktree gives every session you open from the phone its own git worktree1.
How is Remote Control secured?
- No inbound ports. Claude Code on your machine makes outbound HTTPS requests only, registers with the Anthropic API and polls for work, all over TLS1.
- The transcript is stored by Anthropic. While connected, messages, responses and tool activity are stored on Anthropic’s servers to sync devices and reconnect after drops; execution and file access stay on your machine1.
- You can require trusted devices. With Trusted Devices (beta) on, each phone and browser has to enroll, and a sign-in older than 18 hours needs Face ID, Touch ID, Windows Hello or a passkey. Pro, Max and Ultra users turn it on in their own settings; on Team and Enterprise an Owner does1.
- You can turn it off entirely with the
disableRemoteControlsetting1.
What are Remote Control’s limits?
- The process has to keep running. Close the terminal, the Desktop app or VS Code and the session goes offline. When you run
claudeon a remote machine over SSH, the docs say to run it insidetmuxorscreenso it survives the SSH disconnect1. - Server mode exits after about 10 minutes offline. If the machine is awake but can’t reach the network,
claude remote-controlgives up and exits; an interactive session keeps retrying1. - You can bring sessions back for about four hours. After stopping the server with Ctrl+C, run
claude remote-controlagain in the same folder1. - One remote session per process outside server mode. Use server mode for several at once1.
I use both modes. The Oracle host runs server mode (claude remote-control) and stays up waiting for work from my phone; on the Macs I use regular Remote Control, opening sessions on each machine and connecting to them one by one from the phone.
How do you set up Codex remote connections?
OpenAI calls the feature Remote connections. In the ChatGPT mobile app, open Codex (Remote in older versions) to work with Codex chats on a connected Mac or Windows host. You can also pick up work from another desktop device, or point the desktop app at projects on an SSH host2.
- A plan with Codex. Mobile remote control works on Plus, Pro, Business and Enterprise, not with API-key sign-in. In a ChatGPT workspace, an admin may have to enable Remote Control access first.
- The ChatGPT desktop app on the host. macOS or Windows, awake, online and signed in to the same account and workspace as the phone. Mobile setup starts in the desktop app; the Codex CLI and IDE extension can’t do it.
- The latest ChatGPT mobile app on iOS or Android. If you don’t see Codex or Remote, update first.
Pairing a phone2:
- Start on the host. In the ChatGPT desktop app, go to Settings > Connections > Control this Mac or PC, choose Set up or Add, approve remote access and complete any verification.
- Scan the QR code with your phone; it opens ChatGPT to finish. Each code pairs one phone with one host, so pair every host you want to control.
- Finish on the phone. Confirm the same account and workspace and complete MFA, SSO or passkey steps. The host then shows up under Codex (or Remote).
- Review the host settings. Under Settings > Connections you manage connected devices and can keep the computer awake, enable Computer Use or install the Chrome extension.
From the phone you can start or continue chats, answer questions, approve commands, review diffs and test results, and get notified when a task finishes or needs you2. Files, commands, MCP servers and skills all come from the host, and the host’s sandbox settings and approvals still apply2.
I’ve connected my phones and computers to ChatGPT and allowed remote access on each computer separately. In my setup, only my main phone can access every connected device. When I use Codex from that phone, I choose which computer will do the work.
What if the host is a Linux server?
Phone pairing only supports the desktop app on macOS and Windows. A Linux server joins through the desktop app’s SSH support: the phone connects to the desktop host, and Codex runs on the SSH host2.
- Add a host alias to
~/.ssh/configon the desktop machine, with a concreteHost,HostName,UserandIdentityFile. Pattern-only entries are ignored. - Check that SSH works with
ssh <alias>from that machine. - Install and sign in to Codex on the Linux host. The app starts the Codex app server through the remote user’s login shell, so
codexmust be on that shell’sPATH. - Add the SSH host in the app. Under Settings > Connections, add or enable the host and choose a remote project folder.
That puts a desktop host in the middle, and if it sleeps the phone loses the connection too. The docs also warn against exposing the app server directly on a public network; to reach a machine outside your network, use a VPN or a mesh networking tool2.
Moving a chat to another host
Handoff moves a chat and its Git state from your computer to a connected host, or back. Both sides need a saved project for the same Git repository; Codex creates or reuses a worktree on the destination and interrupts a running response first. Handoff to a Codex cloud environment isn’t supported2.
How do you use Grok Build with a remote PC?
Grok Build is xAI’s terminal coding agent. It runs as an interactive TUI, headless in scripts, or inside other apps through the Agent Client Protocol4. As of 16 November 2026, the Grok Build docs describe no feature for controlling a session from a phone or another computer. The /share command “shares the current session via URL”, and the docs don’t say the shared page accepts instructions56.
The documented remote route is to run the CLI on the remote machine itself:
- Install it on the remote machine. On macOS and Linux,
curl -fsSL https://x.ai/cli/install.sh | bash; Windows has a PowerShell installer4. - SSH in and sign in with a device code. Run
grok login --device-auth; it prints a URL and a short code you complete on any device with a browser. xAI lists this method for SSH sessions, containers and headless hosts75. For scripts or CI, setXAI_API_KEYinstead4. - Start it in the project folder.
cdinto the project and rungrok4. - Pick the conversation up after a disconnect. Grok saves every conversation under
~/.grok/sessions/on the host. After reconnecting,grok -ccontinues the most recent session for that folder8.
Over SSH and tmux, watch for these9:
- Run
/terminal-setupfirst. It shows the detected terminal, the active clipboard routes and any issues with fixes. - tmux needs extra settings. The docs give a
~/.tmux.confsnippet for 24-bit colour, clipboard and notification passthrough. - Apple Terminal can’t copy to your local clipboard over SSH. It ignores OSC 52; connect with
grok wrap ssh user@hostinstead.grok wrapis experimental.
Driving it from a phone means using an SSH terminal app on the phone; xAI doesn’t ship or name one.
How should you set Grok Build’s permissions and sandbox?
- It asks by default. Any tool call not already allowed prompts;
--always-approveapproves automatically, butdenyrules and PreToolUse hooks still apply10. - The sandbox is off by default.
grok --sandbox workspacelimits writes to the current folder,~/.grok/and temp; it uses Landlock on Linux and Seatbelt on macOS11. - The built-ins don’t protect
~/.ssh. The docs say built-in profiles don’t permanently protect credential paths like~/.ssh; add your owndenylist in a sandbox profile11.
When I use Grok, it runs on xAI’s own cloud machines: each Bot gets its own virtual machine, so nothing has to connect back to my computer. While I was trying to grab a free Oracle host, I had Grok Bot run the grab script on its own machine; a machine that never sleeps felt safer.
What goes wrong when you run an agent remotely?
- The host goes to sleep. In all three setups the agent runs on the host. Codex’s docs say a sleeping laptop stops remote access, and a closed Mac laptop needs an external display to stay reachable2; Claude Code needs the
claudeprocess to keep running1. An always-on cloud server or desktop is the steadier host. - Nobody answers the permission prompt. Claude Code and Codex send approvals to the phone12. Grok Build’s prompts appear in the SSH terminal, so after a disconnect you reconnect with
grok -cand answer there8. - Credentials sit on the host. GitHub sign-ins, MCP config and keys stay on the host, never on the phone, so a compromised host leaks all of them. Claude Code opens no inbound ports1, Codex says not to expose the app server on a public network2, and with Grok Build you add paths like
~/.sshto a deny list yourself11. - API-key sign-in has no phone control. Claude Code Remote Control doesn’t support API keys1; Codex mobile remote control isn’t available on the API plan, though SSH hosts are3.
- Several sessions on one repo overwrite each other. Use
--spawn worktreein Claude Code server mode1 andgrok -wto start a Grok Build session in a new git worktree5; Codex Handoff also creates a worktree on the destination2.
FAQ
Does the host have to be a Mac or a Windows PC?
It depends on the tool. Claude Code Remote Control runs on any machine that runs Claude Code, Linux servers included1. Codex phone pairing needs the ChatGPT desktop app on macOS or Windows, with Linux only as its SSH host2. Grok Build runs over SSH; its install script covers macOS and Linux, and Windows has a PowerShell installer4.
Can I use another computer instead of a phone?
Yes. With Claude Code, open claude.ai/code in a browser to reach the same session1. With Codex, add the host from the desktop app on another Mac or Windows PC under Settings > Connections > Control other devices2. With Grok Build, SSH in from any computer.
How is Remote Control different from a Claude Code cloud session?
Where it runs. Remote Control executes on your machine, so your local MCP servers, tools and project config are available; a cloud session runs on cloud infrastructure, needs no local setup, and suits repos you haven’t cloned or many parallel tasks1.
Go deeper How to Get an Oracle Cloud Free ARM Instance in 2026: Claude Code 24/7 and a Git Repo Workflow Getting an A1 instance, keeping Remote Control running with systemd, and connecting GitHub. Go deeper Claude Code vs Codex vs Grok Build in 2026: Which AI Coding Agent Fits You Who makes each one, how to install it, prices and usage limits, side by side.Sources
- 1. Continue local sessions from any device with Remote Control
- 2. Remote connections
- 3. Pricing
- 4. Grok Build: Get Started
- 5. CLI Reference
- 6. Use Grok Build: Modes and Commands
- 7. Enterprise Deployments
- 8. Sessions
- 9. Terminal Support
- 10. Permissions
- 11. Sandbox
- 12. Grok Bot for Mobile
- 13. Grok Bot FAQ
- 14. Grok Bot Security
Kelvin Wang
Electrical engineer building tools with AI agents, sharing hands-on notes on engineering and investing.
More about me