Cloud sessions quickstart
Connect GitHub, create your first cloud environment and hand Claude Code a task that runs on a cloud VM instead of your laptop.
A cloud session is Claude Code running on a virtual machine that Anthropic manages (or on your organisation's own runners, if it uses a self-hosted environment). You start it from a browser, phone, the desktop app or your terminal, Claude clones your GitHub repository, does the work, and pushes a branch. You can close the laptop and review the result from your phone an hour later.
This page gets you from nothing to a reviewed pull request. The full feature set is covered in Claude Code on the web.
Note: Cloud sessions are included with Pro, Max and Team plans, and for Enterprise users who hold premium seats or Chat + Claude Code seats.
When the cloud is the right choice
I send work to the cloud when:
- I want several things done at once. Each task gets its own session and branch, with no worktree juggling on my machine.
- I do not have the repo cloned. Every session starts from a fresh clone.
- The task is well defined. "Upgrade the date library and fix whatever breaks" is ideal: submit, walk away, review later.
- I am exploring. Tracing how a feature works in an unfamiliar codebase without checking it out.
If the job depends on your local tools, credentials or config, run Claude Code locally instead, or use Remote Control to drive a local session from another device.
Where a session runs, compared
| Cloud session | Local session | Local + Remote Control | |
|---|---|---|---|
| Executes on | A cloud VM | Your machine | Your machine |
| Started from | claude.ai/code, mobile app, desktop app (Cloud), or claude --cloud | Terminal, IDE, desktop app (Local) | Terminal, VS Code extension, desktop app |
| You chat from | Web, mobile or desktop | Wherever you started it | Web and mobile as well as the origin |
| Reads your local config | No, only what is in the repo | Yes | Yes |
| Needs GitHub | Yes, unless you bundle a local repo with --cloud | No | No |
| Survives you disconnecting | Yes | No | Only while the local session stays open |
| Permission modes | Accept edits, Plan, Auto | Any (see permission modes) | Manual, Accept edits, Plan or Auto from web and mobile |
| Network | Set per environment | Your network | Your network |
What happens when you submit a task
- Clone and prepare. Your repo is cloned onto the VM and your environment's setup script, if any, runs.
- Network rules apply. Internet access follows the environment's access level.
- Claude works. It reads, edits, runs tests and checks itself. Watch and steer, or leave it.
- A branch is pushed. At a natural stopping point Claude pushes to GitHub. The session stays open, so you can raise a PR or ask for more changes in the same conversation.
Step 1: connect GitHub
You do this once, either in the browser or from the CLI.
Note: On Team and Enterprise plans, an Owner must first switch on the GitHub connector under Organization settings > Connectors. Until they do, onboarding shows "GitHub access is required for Claude Code cloud sessions" instead of a sign-in button. Reload claude.ai/code once it is on.
In the browser
- Go to claude.ai/code and sign in with your Claude account.
- Follow the prompt to authorise GitHub. You are bounced to GitHub and back.
- Decide on the Claude GitHub App. With only the OAuth connection, sessions can clone any public repo. For private repos the app has to be installed on the owning account or organisation (an org owner may need to approve it). Installing it also enables auto-fix for pull requests. You can click Skip and do it later.
Cloud sessions work on existing repositories. For a brand new project, create an empty repo on GitHub first.
When you connect, any GitHub accounts you own that already have the Claude GitHub App installed are linked to your Claude organisation, and Team and Enterprise admins can see them in their connected accounts list.
From the terminal with /web-setup
If you already use the GitHub CLI, this is quicker. On Team and Enterprise it only appears after an Owner enables Quick setup in the Claude Code admin settings.
gh auth login # if gh is not already signed in
claude # start the CLI
Inside Claude Code:
- Make sure you are signed in with a claude.ai account, not an API key.
/statusshows the Login method; use/loginif needed. - Run
/web-setupand confirm.
Claude Code reads the token from gh auth token, sends it to Anthropic (stored encrypted against your account) and prints Connected as <username>. If you have no cloud environment yet, it creates one with Trusted network access and no setup script. From then on, sessions you start can reach every repo that token can, with no GitHub App needed. Threads inside a project still need the app.
Running /web-setup after connecting in the browser replaces the browser connection.
Warning: Organisations with Zero Data Retention or the HIPAA configuration cannot use
/web-setupor any cloud session features.
Removing the token later: disconnect GitHub at claude.ai/customize/connectors. That deletes the stored credential (browser or /web-setup), but the token itself stays valid on GitHub and gh stays signed in. To kill the token, revoke the GitHub CLI entry under Authorized OAuth Apps in your GitHub settings, which also signs gh out everywhere.
Step 2: get a cloud environment
A cloud environment is the saved recipe for network access, environment variables and setup script.
- Pro and Max: onboarding creates one called Default automatically.
- Team and Enterprise: onboarding shows Create your first cloud environment. Keep the suggested name and network setting and click Create & finish. If an Owner has turned on Quick setup, it is created for you.
Default uses Trusted network access: common package registries and other allowlisted domains are reachable, nothing else is. That is fine for a first run. Add variables or a setup script later.
Step 3: start a task
-
Pick repositories and branches. Use the selector under the input box at claude.ai/code (or the Code tab in the mobile app). Each repo has its own branch picker, and you can add more than one repo to a session.
-
Pick a permission mode.
- Auto: a classifier vets actions instead of asking you (shown when your org allows it and the model supports it).
- Accept edits: Claude edits and pushes without pausing.
- Plan: Claude proposes an approach and waits for approval before editing.
Manual and Bypass permissions are not offered in the cloud.
-
Describe the task. Specific beats vague. Compare:
fix the testswith:
test_invoice_totals in tests/billing/test_totals.py fails since we moved to Decimal. Here's the output: <paste>. Totals should round half-up to 2dp.
Press Enter. Every task is its own session and branch, so start the next one straight away if you like.
Prefilled links
You can open claude.ai/code with fields already filled in via query parameters. Handy for an "Ask Claude" button in an issue tracker.
| Parameter | Fills in |
|---|---|
prompt (alias q) | The prompt text |
prompt_url | A URL to fetch the prompt from, for long prompts. Must allow cross-origin requests; ignored if prompt is set |
repositories (alias repo) | Comma-separated owner/repo slugs |
environment | Environment name or ID |
URL-encode every value:
https://claude.ai/code?q=Add%20rate%20limiting%20to%20the%20search%20endpoint&repo=northwind/api,northwind/infra
Step 4: review and iterate
- Open the diff. A counter such as
+57 -12opens a file list and diff, compared with the base branch by default. Compare against picks another branch. - Comment on lines. Click a line, type feedback, press Enter. Comments queue and are sent with your next message, so Claude knows exactly which line you mean.
- Create a PR. Create PR offers a full PR, a draft, or GitHub's compose page with a generated title and body.
- Keep going. The session lives on after the PR. Paste CI output or review comments and ask for fixes, or let auto-fix watch the PR for you.
Troubleshooting
No repositories listed
Browser connection: private repos only appear when the Claude GitHub App is installed on the owner and its repository access includes that repo. /web-setup connection: run gh repo view OWNER/REPO to check your gh login can see it, and rerun /web-setup if you have switched gh accounts.
Only a GitHub login button
GitHub is mandatory for cloud sessions. Connect it, or use Remote Control if you would rather not.
"Claude Code isn't available on your account"
Your seat in the selected organisation lacks Claude Code. Use Switch organization if you belong to another, or ask an Owner for a seat that includes it.
/web-setup says "Not signed in to Claude"
The CLI has no valid claude.ai sign-in (or it expired). Run /login, then /web-setup again.
/web-setup warns about the workflow scope
You can continue, but GitHub may reject pushes that touch Actions workflow files. Fix it with gh auth refresh -s workflow and rerun /web-setup.
/web-setup is "Unknown command" or not in the menu
It is a Claude Code command, not a shell command: start claude first. If it is still hidden, the usual cause is API key or third-party provider authentication; /login with claude.ai. On Team and Enterprise it stays hidden until Quick setup is on. It is also hidden when an admin has disabled cloud sessions (submitting it then returns Cloud sessions are disabled by your organization's policy) or under Zero Data Retention or HIPAA.
"Could not create a cloud environment" or "No cloud environment available" with --cloud
Automatic environment creation failed, or your CLI is too old to do it. Run /web-setup, or add an environment from the selector at claude.ai/code.
Setup script failed
A non-zero exit blocks the session. Usual suspects: a registry outside your network access level (None blocks all package managers), a path that does not exist in a fresh clone, or a command that behaves differently on Ubuntu. Put set -x at the top to see the failing line, and append || true to anything non-essential.
Sessions hang during setup
The environment cache build has a budget of roughly five minutes. Run independent installs in parallel with & and wait, move big downloads into a background SessionStart hook, and drop long retry sleeps.
The session keeps going after I close the tab
Intended. It runs until the current task finishes, then idles. Archive or delete it from the sidebar.
Next steps
- Learn teleporting, sharing and auto-fix in Claude Code on the web.
- Tune network and setup in cloud environments.
- Automate recurring work with routines.
- Add standing instructions with CLAUDE.md memory.
- Install the Claude mobile app to follow sessions on the move;
/mobilein the CLI shows a QR code for it.