Harness Engineering 6 months ahead, in a few hours.

Claude Code cloud sessions: --cloud, teleport and environments

Thomas Poulain ·

A Claude Code cloud session runs on a virtual machine that Anthropic manages instead of on your computer. You start one from your terminal with claude --cloud and pull it back into your terminal with claude --teleport. It keeps going after you close your laptop, and you can check on it from claude.ai/code or the Claude mobile app. Since v2.1.274, /status, /web-setup and the teleport messages say “cloud session” instead of “Claude Code on the web”.

A /code-review ultra review also runs as a cloud session, see the article on code review. For the SessionStart hooks mentioned below, read what hooks are in Claude Code.

How do I start a cloud session from the terminal?

Pass the task to --cloud. Each command creates its own session, and they run in parallel.

claude --cloud "Fix the flaky test in auth.spec.ts"
claude --cloud "Update the API documentation"

The VM clones your current directory’s GitHub remote at your current branch, not your local checkout, so push your commits first. If the branch isn’t on GitHub, the terminal prints Branch <name> is not on GitHub and names the point the session starts from instead. --cloud works with one repository at a time, and --remote still works as a deprecated alias.

To clone private repositories, connect GitHub through the Claude GitHub App or with /web-setup, which sends your local gh CLI token to your Claude account. When the app isn’t installed on the repository, Claude Code uploads a bundle of your local repository instead, and untracked files aren’t in it.

On the branch of an open PR, /autofix-pr starts a cloud session that watches the PR and pushes a fix, when one is clear, after a CI failure or a review comment. It needs the gh CLI and the Claude GitHub App on the repository.

How do I send a follow-up to a running session?

Pass the session ID to --cloud, together with -p.

claude -p "Also add a test for the empty case" --cloud <session-id>

The CLI queues the message and exits without waiting for a reply. The ID looks like session_... or cse_..., and the session’s claude.ai/code/<id> URL works too. The command runs from any machine signed in with claude auth login, a CI script included.

How do I pull a cloud session into my terminal?

claude --teleport opens a session picker, and claude --teleport <id> resumes one session directly. Inside a running CLI session, /teleport or /tp opens the same picker, and t in /tasks does the same. Claude checks the repository, then fetches the branch and the conversation history.

RequirementDetails
Clean git stateNo uncommitted changes, teleport offers to stash them
Same repositoryA checkout of the session’s repository, not a fork
Branch pushedThe session’s branch must be on the remote
Same accountThe claude.ai account that ran the session

Your terminal gets its own copy of the session, and work you do locally doesn’t show up on claude.ai. From the CLI, you can’t push an existing local session to the cloud.

What is a cloud environment?

It’s the saved configuration that sets network access, environment variables and the setup script. If you don’t have one yet, onboarding sets up a Default environment with Trusted network access, either by creating it or by asking you to. Each session gets a fresh Ubuntu 24.04 VM with roughly 4 vCPUs, 16 GB of RAM and 30 GB of disk.

LevelOutbound connections
NoneNone through the session’s network
TrustedAllowlisted domains: package registries, GitHub, cloud SDKs
FullAny domain
CustomYour own allowlist, with or without the defaults

GitHub, MCP connectors and the Anthropic API stay reachable even at None, because they don’t go through that allowlist. To pick the environment your claude --cloud sessions use, run /remote-env in your terminal.

How do I prepare the VM with a setup script?

The script runs as root before Claude Code launches, the first time you start a session in an environment. It has to exit with code 0, or the session fails to start.

#!/bin/bash
apt update && apt install -y shellcheck

If it finishes in roughly five minutes, Anthropic snapshots the filesystem, and later sessions start from that snapshot without running the script again. The cache rebuilds when you change the script or the allowed hosts, and after about seven days. Since v2.1.310, a Choose file button loads the script from a file of up to 64 KB.

For a step that should also run locally, like npm install, use a SessionStart hook in the repository’s .claude/settings.json instead. CLAUDE_CODE_REMOTE is set to true inside the VM, so your script can exit right away on your laptop.

if [ "$CLAUDE_CODE_REMOTE" != "true" ]; then
  exit 0
fi

Which parts of my setup reach the cloud?

The session starts from a fresh clone, so whatever you committed comes along: CLAUDE.md, .claude/rules/, the skills, agents and commands under .claude/, and the hooks in the repository’s .claude/settings.json. Your personal ~/.claude folder stays on your machine. MCP servers added at local or user scope don’t come along either, so add them with claude mcp add --scope project and commit .mcp.json. Plugins turned on in the repository’s settings aren’t installed.

To keep personal preferences out of the repository, have the setup script write ~/.claude/CLAUDE.md in the VM.

Who can use cloud sessions, and what do they cost?

Cloud sessions are available on Pro, Max and Team, and on Enterprise with a premium seat or a Chat + Claude Code seat. You need to sign in with a claude.ai account, so an API key or a third-party provider like Amazon Bedrock won’t do. Organizations with Zero Data Retention or the HIPAA configuration can’t use them.

There’s no separate charge for the VM. Sessions count toward your plan’s usage limits along with the rest of your usage, and parallel sessions use those limits up proportionally faster.


Section 8.4 of module 8, IDE, tools and practical cases covers the Desktop app and the web interface. Module 15, GUI, Cowork and Chrome goes through claude.ai/code and moving a web session to your terminal with teleport.

To see these articles more often on Google, add Harness Engineering to your preferred sources.

You might also like