Heads up — the easy free way to put an AI-built page online usually makes it public and searchable on Google. Pagelive keeps yours private →
+ +

Guide · July 21, 2026 · 10 min read

How to Use Claude Code Remotely (and Share What It Builds)

You're away from your main machine and you want Claude Code to keep working — from your phone, over SSH to a server, or on a box you'll close the laptop on and walk away from. Then you need to hand off whatever it built. The confusing part in 2026 is that "Claude Code remote" no longer means one thing. It splits into two genuinely different setups, and picking the wrong one costs you an afternoon.

The old meaning is the sysadmin one: the Claude Code CLI running on a machine that isn't in front of you, reached over SSH. Nothing Anthropic-specific — it's a terminal program on a remote host. The new meaning is a set of first-party "work from anywhere" surfaces: Remote Control (drive your local session from a phone), Claude Code on the web / --cloud (Anthropic runs the session in a cloud VM), plus the mobile app and a couple of lighter tools. Most guides online only cover the SSH path. Here's both, with the tradeoffs — and then the thing everyone asks about last: once it builds something, how do you actually share it.

+ +

What "Claude Code remote" actually means: four real setups

Treat this as a decision, not a checklist. The right setup depends on where your code lives and how present you can be.

A. SSH into a box and run the CLI there — the classic. You ssh you@server, install Claude Code (curl -fsSL https://claude.ai/install.sh | bash), cd into a project, and run claude. This is correct when the code lives on that server: a work dev box, a GPU host, a machine holding data you can't move. You want Claude Code where the files already are.

The gotcha every SSH user hits: an SSH disconnect can terminate the shell — or leave the session wedged and unusable. Close the laptop, lose Wi-Fi for thirty seconds, and the work may be gone. So this path is really "SSH + a persistent terminal multiplexer." On Ubuntu/Debian: sudo apt install tmux; then run tmux new -s claude, start claude inside it, and detach with Ctrl-b d before you disconnect. Reconnect later with tmux attach -t claude and you're back mid-task, scrollback intact. This one detail separates a usable remote setup from a maddening one, and most tutorials skip it.

On a headless server you authenticate on first run through the browser-login flow (it prints a URL you open on any device). For truly unattended boxes you can mint a long-lived token with claude setup-token and set CLAUDE_CODE_OAUTH_TOKEN — but that token can only make model requests. It can't establish Remote Control (you'll hit a "requires a full-scope login token" error), so skip it if you plan to attach a phone later.

B. Headless / non-interactive mode (claude -p). Not "remote" in the SSH sense, but it's what you actually want for scripted server work: Claude Code as a one-shot command — pipe data in, get output out, no interactive UI.

claude -p "fix the failing tests" --allowedTools "Bash,Read,Edit"

The flags that matter: --output-format json returns the result plus a session ID and total_cost_usd; --continue / --resume <session-id> chain calls together; --permission-mode acceptEdits locks down what it can touch without asking. This is the building block behind cron jobs, CI steps, and "SSH in, kick off a batch task, log out." The headless mode docs have the full list.

**C. Remote Control — drive your local session from another device.The mental model that matters:Claude keeps running on your machine; the phone or browser is just a window into it.** Your filesystem, your MCP servers, your project config all stay local. Start it with claude remote-control (server mode — prints a URL and QR code), or type /remote-control inside a session you already have going to hand it off mid-conversation. Then open the URL, scan the QR, or find the session at claude.ai/code or in the mobile app. This is the answer to "I started something at my desk and want to keep steering it from the couch."

D. Claude Code on the web / --cloud — Anthropic runs it. No local machine involved. Each task runs in a fresh Anthropic-managed VM that clones your GitHub repo. Kick it off from claude.ai/code, from the mobile app, or from your terminal: claude --cloud "fix the auth bug". Sessions persist even if you close the browser or shut the laptop. This is the pick for "I can't (or don't want to) run anything locally," for long autonomous tasks, and for running several in parallel. The sessions run in an Anthropic-managed VM with no separate compute charge — cloud sessions draw on your normal account rate limits. Details in the Claude Code on the web docs.

The same thing as a table:

Where Claude runsLocal files/env come along?Survives you disconnecting?What you need
SSH + tmuxThe remote boxYes (files are on that box)Yes, via tmux/screenAny plan; SSH access
Headless -pWherever you run itYesIt's one-shotAny plan
Remote ControlYour machineYesNo — local process must stay alivePro/Max/Team/Enterprise, OAuth login
Cloud / --cloudAnthropic's VMNo (clones your GitHub repo)YesPro/Max/Team, GitHub
+ +

Driving it from your phone

There are two separate phone stories, and conflating them is where people get stuck.

Phone as a remote control for local work → Remote Control. Install the Claude mobile app, sign in to the same account, connect to a running local session. You send messages, approve permission prompts, even send images or files — Claude Code downloads them to your machine as @ references. It can push a notification when a long task finishes or when it needs a decision; enable the "push when actions required" options via /config, or just write "notify me when the tests finish" into the prompt. Setup and limits are in the Remote Control docs.

Phone as the whole workstation → Claude Code on the web. Because the session runs in the cloud, your phone genuinely is enough — no laptop has to be awake anywhere. Monitor and steer from the mobile app's Code tab.

Two lighter tools are worth knowing. Dispatch can start a Claude Desktop Code session from the mobile app, but it needs a paired Desktop app and is currently limited to Pro and Max — it is not an SSH or Linux-server feature. And claude --teleport pulls a cloud session (and its branch) down into your local terminal to continue there — the round trip, for when you started on your phone and want to finish at your desk.

The honest gotcha for this whole section: Remote Control needs the local process alive. Close the terminal, quit your editor, or lose network for around ten minutes, and the session times out and exits. It is not a substitute for a server. If you need the work to continue with your laptop shut, that's the cloud path.

+ +

Giving it access safely, remotely

Remote Control lets you answer permission prompts right from your phone. But truly unattended jobs — headless runs, cron, CI, or a detached session you won't be watching — have no one to tap "approve," so they need explicit permission rules. That part deserves real thought rather than a shrug.

Permissions are the actual safety control. By default Claude Code asks before running commands or editing files. Remotely, the temptation is --dangerously-skip-permissions (YOLO mode). Say it to yourself plainly: that flag lets Claude run anything without asking. It belongs only in a sandboxed, disposable, non-privileged environment — a throwaway VM or a container — never on a box that holds production credentials or your SSH keys. The middle grounds are worth learning: scope tools with rules like --allowedTools "Bash(git diff *),Read,Edit" (the trailing * is prefix matching), or run with --permission-mode acceptEdits, which auto-approves file edits and common filesystem commands like mkdir, touch, mv, and cp — while other shell or network actions still need allow rules.

Prefer isolation over trust. The cloud path reduces blast radius — your laptop credentials stay out of the container — and it's worth knowing why: each session is an isolated VM, and a proxy injects scoped git credentials so git push is restricted to the working branch. But it isn't automatically safe for sensitive work: the session still receives your repository contents and any environment variables you configure, so it's not the right home for a secret-laden repo. Network access is configurable, too — check the environment's allowlist before assuming package downloads or external APIs will work. For SSH and local setups you have to build that isolation yourself: run in a container or a dedicated low-privilege user, and look at Claude Code's own --sandbox flag for filesystem and network isolation.

Remote Control's security model, stated plainly: your machine makes outbound HTTPS only — no inbound ports open. Traffic goes through the Anthropic API over TLS with short-lived scoped credentials. The tradeoff: while connected, the session transcript (your messages, Claude's responses, tool activity) is stored on Anthropic servers to sync across devices. Execution and files stay local, but the conversation is retained under Anthropic's data policy, so Zero-Data-Retention orgs can't use it. Team and Enterprise can add Trusted Devices — device enrollment plus a biometric step-up every 18 hours.

Two more real-world notes for the cloud path. There's no dedicated secrets store yet — environment variables and setup scripts are visible to anyone who can edit the environment, so don't paste production secrets there casually. And if your org runs an IP allowlist, it will silently break every cloud session, because those sessions call the API from Anthropic infrastructure, not your network. That single fact explains a lot of "why isn't this working."

+ +

Once it builds something, how do you share it?

This is the question you started with, and the honest answer is: it depends entirely on what got built. Sharing by habit is how people end up emailing an HTML file that arrives as gibberish. Share by output type.

A PR or code change → GitHub, built in. With GitHub connected, a cloud session can push its branch and open a PR directly, and it carries a claude.ai session URL whose access follows your account and org sharing settings. For SSH and local sessions it's the normal git push and open a PR — once the repo has a remote configured and gh is authenticated, just tell Claude Code to do it: claude "commit the changes, push a branch, and open a PR". Code belongs in a code review, not on a webpage.

A deployed app or site → a host, not a link tool. If Claude built a Next.js app or a static site, the share mechanism is a deploy: Cloudflare Pages, Vercel, Netlify, or wrangler deploy for a Worker. Don't overthink it.

A file blob — a zip, a binary, a dataset → file transfer. Use scp/rsync off the server, or a file-share service. Link-publishing tools don't cover arbitrary files.

A single self-contained HTML artifact — a proposal, deck, report, demo, dashboard, one-pager → the awkward gap. Claude Code produces exactly this constantly: a standalone .html file. And every obvious sharing route is wrong for it. GitHub is wrong — nobody wants to review an HTML diff. A full Vercel or Cloudflare deploy is overkill for a one-off page. Emailing the .html is worst of all: it renders unreliably across clients and there's no link to send.

This is the one spot where a publish-to-link tool earns its place. For a self-contained HTML page sent privately to named reviewers, Pagelive fits if you want password protection and open tracking — it turns the file into a link that's private and noindex by default, and shows you whether and when it was opened. Because Claude Code speaks MCP and Pagelive has a remote connector, you can publish from inside the session and get the URL back in one call, without switching to a dashboard. For a public demo or a site you'll keep maintaining, use Cloudflare Pages, Netlify, or Vercel instead — Pagelive isn't a website builder or a file-transfer tool, so it's the wrong pick for the deploy and blob cases above.

+ +

The short version

Pick the setup that matches where your code lives and how present you can be. Code on a server you need to touch → SSH plus tmux, and don't forget the tmux. Steering local work from your phone → Remote Control, as long as your machine stays awake. Hands-off, parallel, or no laptop at all → the cloud path. Then share by what got built, not by reflex: PRs and code go to GitHub, real apps get deployed, blobs get scp'd, and a lone HTML artifact becomes a link. Match the tool to the job in each half of that sentence and remote Claude Code stops being fiddly.

+ +

Frequently asked

How do I run Claude Code remotely? +

Four ways: SSH into a box and run it inside tmux; headless claude -p for scripted jobs; Remote Control to drive your local session from a phone; or Claude Code on the web (--cloud), where Anthropic runs the session in a managed VM. Pick by where your code lives and how present you can be.

Can I use Claude Code from my phone? +

Yes, two ways. Remote Control lets the mobile app drive a session running on your own machine, which must stay awake. Claude Code on the web runs the session in the cloud, so the phone alone is enough — no local machine required.

How do I keep a Claude Code session alive after I disconnect over SSH? +

Run it inside tmux: tmux new -s claude, start claude, detach with Ctrl-b d, and reconnect later with tmux attach -t claude. Without a multiplexer, an SSH disconnect can terminate the session.

Is it safe to run Claude Code remotely? +

Permissions are the real control. Avoid --dangerously-skip-permissions outside a throwaway sandbox; scope tools with allow rules or use acceptEdits. The cloud path is the most isolated — a disposable VM that keeps your real credentials out of the container.

How do I share what Claude Code builds when working remotely? +

By output type: code goes to a GitHub PR, a real app gets deployed, a file blob gets scp'd, and a single self-contained HTML page becomes a link — via a Gist viewer, a Pages upload, or a private-by-default tool like Pagelive that Claude Code can publish to over MCP.

Related: publish from Claude Code · Cursor vs Claude Code

+ +

Working remote? Share what you built in one call.

When Claude Code produces a standalone HTML page, Pagelive turns it into a private, tracked link — publishable straight from the session over MCP. Free for 5 pages, no card.