From the Claude Code CLI, how do `--cloud`, `--teleport` and `/desktop` move work between surfaces, and what does each carry or leave behind?
answer
- handoff runs in one direction
- the remote branch, not your checkout
- push before you send
- clean tree, same repo, same account
- save, open in the app, exit
basics
~20 sclaude --cloud starts a new cloud session from your GitHub remote's current branch; --teleport pulls a cloud session's branch and conversation into the terminal; /desktop moves the CLI session into Desktop. No CLI command pushes a running session to the cloud.
solid answer
~50 s`claude --cloud "task"` creates a **new** cloud session: the VM clones your directory's GitHub remote at the current branch, not your working tree, so unpushed commits are missing unless Claude Code falls back to uploading a bundle (no remote, or the Claude GitHub App not installed). `claude --teleport` (or `/teleport`, `/tp`) goes the other way: it checks that you are in the same repository with a clean tree, fetches and checks out the session's pushed branch and loads the full conversation, and from then on the terminal holds its own copy. `/desktop` saves the CLI session, opens it in the Desktop app and exits the CLI; since 2.1.285 `claude --desktop --resume <id>` does the same from the shell. There is no CLI command that pushes a running terminal session to the cloud; only Desktop's **Open in > Cloud** sends a local session there, as a summary. All of these need a claude.ai subscription login.
go deeper
Recall the directions: --cloud starts a new cloud task, --teleport brings a cloud session into the terminal, and /desktop moves the session into the Desktop app.
Explain what each carries: --cloud takes the remote branch, teleport takes the branch and conversation after its checks, and /desktop hands the saved session to the app and exits.
Diagnose failed handoffs: unpushed commits, bundle fallbacks and their size and secret-file rules, teleport's clean-tree and same-account checks, and API-key or provider logins that block all three.
Judge what crosses the boundary: a bundle upload can carry uncommitted tracked changes off the machine, and Windows does not filter secret-named files, so set team guidance on when to push instead.
## Three doors, three directions The CLI can move work to two other surfaces, and the direction matters: | Command | Direction | What moves | | :- | :- | :- | | `claude --cloud "task"` | Terminal to cloud | A **new** session with only your task text; the code comes from the remote | | `claude --teleport [id]`, `/teleport`, `/tp` | Cloud to terminal | The cloud session's branch and its full conversation | | `/desktop` (alias `/app`), `claude --desktop` | Terminal to Desktop | The CLI session itself, which Desktop continues | The docs spell out the asymmetry: from the CLI the handoff is **one-way**. You can pull a cloud session down, but you cannot push an existing terminal session up. The older `--remote` spelling of `--cloud` still works as a deprecated alias. Do not confuse either with `--remote-control`, which keeps a session local and lets you steer it from another device. ## `--cloud`: start fresh in the cloud - The VM **clones your current directory's GitHub remote at your current branch**, not your local checkout, so push local commits first. - If the repository has **no git remote**, or the Claude GitHub App is not installed on it, Claude Code instead **bundles and uploads** the repository: history plus uncommitted changes to tracked files, with **untracked files excluded**; above 100 MB it falls back to the current branch, then to a snapshot of the working tree. - On macOS, Linux and WSL the upload leaves out uncommitted changes to files named like credentials (`.env`, `*.tfvars`, `id_rsa`, `*.pem`) and prints `Left on this machine:`; on native Windows those changes upload as they are. - `CCR_FORCE_BUNDLE=1` forces a bundle even when cloning would work; a session made from a non-GitHub bundle cannot push back to that remote. - Each `--cloud` call is an independent session, so several can run in parallel while you keep working locally. - `claude -p "message" --cloud <session-id>` queues a follow-up into an existing cloud session and exits; without `-p`, attaching is refused. ## `--teleport`: pull a cloud session down Before resuming, teleport checks four things: 1. **Clean git state**: uncommitted changes must be stashed, and it offers to do so. 2. **Correct repository**: a checkout of the same repository, not a fork. 3. **Branch available**: the cloud session's branch must have been pushed; teleport fetches and checks it out. 4. **Same account**: the same claude.ai account that owns the cloud session. The fetch never waits for terminal input, so a passphrase or new-SSH-host prompt makes it fail; load the key into `ssh-agent` first. After teleporting, the terminal has **its own copy**: new local work does not appear in the cloud session. To keep steering from a phone, start `/remote-control` locally. `--teleport` is not `--resume`: resume reads this machine's local history and never lists cloud sessions. ## `/desktop`: hand the session to the app `/desktop` saves the current session, opens it in the Desktop app's Code tab and exits the CLI. It works on macOS and x64 Windows when you are signed in with a Claude subscription, and not with API-key authentication or on Bedrock, Agent Platform or Foundry. Claude Code 2.1.285 added the shell form: `claude --desktop` opens Desktop on the current directory, and `--continue` or `--resume <session-id>` (an ID, not a name) opens that session. It will not move a session still open in another terminal. The terminal is then free; the session lives on in the app. In the other direction, Desktop's **Open in > Cloud** sends a local Code-tab session to the cloud with the conversation carried over as a **summary**. ## Requirements and failure modes - All of these need a **claude.ai account**. On an API key you see `Unable to get organization UUID` or a message that API-key authentication is not sufficient; `/login` fixes it. - With a third-party provider configured, `--cloud` refuses with a message naming it; unset the provider switch and sign in with `claude auth login`. - The organization's `allow_remote_sessions` policy must be on, or the CLI reports that cloud sessions are disabled by your organization's policy; an Owner turns it on in the Claude Code admin settings. - Teleport travels over the Remote Control infrastructure, so its expiry errors use Remote Control wording. A practical pattern from the docs: plan locally in plan mode, commit and push the plan, then `claude --cloud "Execute the plan in docs/plan.md"` so the cloud session can read it from the clone.
- You ran `claude --cloud` and the session doesn't have the fix you committed an hour ago. Why?When the repository is on GitHub with the Claude GitHub App installed, the cloud VM clones the remote at your current branch, not your local checkout, so an unpushed commit is invisible. Push the branch and start the session again. Claude Code uploads a bundle of the local repository only when there is no remote, the app is not installed, or `CCR_FORCE_BUNDLE=1` is set.
- After `claude --teleport`, does new work in the terminal show up in the cloud session on your phone?No. Teleport gives the terminal its own copy of the session: new local work stays local and does not appear in the cloud session at claude.ai or in the app. To keep steering the now-local session from your phone, start `/remote-control` in it.
- What does `claude --desktop --resume <id>` refuse to do?It takes only a session ID, not a name or transcript path, and takes no prompt and almost no other flags, since the app starts the session itself. It will not move a session that is open in another terminal or still running in the background, and it needs macOS or x64 Windows with a Claude subscription login. Without Desktop installed it prints a download link.
- claude --cloud always sends my working tree, so pushing first is unnecessary.
- You can push a running terminal session to the cloud with --cloud.
- After teleporting, work in the terminal syncs back to the cloud session.
- --teleport and --resume are interchangeable ways to reopen any session.
- Teleport works with an API key as long as the repository matches.
Assumes Claude Code 2.1.286; the claude --desktop shell flag was added in 2.1.285, while /desktop, --cloud and --teleport predate it.