claude --cloud, Claude Tag, routines, the Claude mobile app, and the Desktop app. Remote Control sessions are the exception: they connect the web and mobile interfaces to a session on your own machine, which uses your machine’s network and files, not a cloud environment.
The Default environment
Onboarding sets up the Default environment for you, whether you connect through the web or a CLI flow such as/web-setup; if web onboarding shows an environment form instead of creating the environment, keep the form’s defaults to get the same Default environment. Default carries no configuration of its own:
- Trusted network access: sessions reach package registries and other allowlisted domains, and nothing else through the session’s network.
- No other configuration: Default defines no environment variables or setup script, so sessions start with just the pre-installed tools.
- On the web, the Desktop app, and the mobile app, sessions use the environment shown in the selector. An admin-set organization default fills the selection when you haven’t picked one.
- From the CLI, sessions use your
/remote-envpick, or fall back to your first available cloud environment.
Configure your environment
Create, edit, and archive environments from the environment selector at claude.ai/code, which you reach after web onboarding. Environments you create are personal to your account; shared environments created by your admins appear in the same selector. See Installed tools for what’s available without any configuration.Open the environment selector

Add or edit an environment

Set environment variables
Environment variables use.env format, one KEY=value pair per line. Plain values don’t need quotes, and if you quote a value with a matching pair, the quotes don’t become part of the value. Quote a value that spans multiple lines or contains a #: in an unquoted value, # starts a comment and the rest of the line is dropped.
The following example defines three variables.
Select an environment from the CLI
Run/remote-env in your terminal to choose the default environment for cloud sessions you create from the CLI, such as claude --cloud. The command opens a picker of your existing environments and saves your choice to the remote.defaultEnvironmentId key in your user settings, so it applies in every project on your machine until you change it, unless the same key is set at a higher-precedence settings layer, such as a repo’s project settings.
/remote-env only sets the default: it doesn’t start a session, and it can’t add or edit environments. Manage them at claude.ai/code.
Archive an environment
To archive an environment, open it for editing and select Archive. You can’t delete an environment, only archive it. Archiving affects new sessions, not running ones:- Sessions already running in the environment continue to work.
- The environment disappears from the selector and from
/remote-env, so you can’t pick it for new sessions. - No new session can start in an archived environment, on any surface. If the environment was your saved CLI default, CLI cloud sessions fall back to your first available cloud environment. Anything configured with the environment explicitly, such as a routine, can’t start new sessions in it; point it at another environment.
Organization-shared environments
Owners and admins on Team and Enterprise plans can create cloud environments that are shared with every member of the organization. Shared environments appear in each member’s environment selector alongside their personal ones, so a team can standardize on one configuration instead of each member recreating it. Create, edit, and archive shared environments from the Cloud environments page in admin settings. Each shared environment has a name, a network access level, environment variables in.env format, and a setup script. Owners and admins choose the organization’s default environment separately, at claude.ai/admin-settings/claude-code.
Values in a shared environment reach every member’s sessions in that environment. Like personal environments, shared environments have no dedicated secrets store, so don’t include secrets.
Shared environments add to members’ selectors rather than replacing them.
Network access
Each environment sets one network access level, which controls the outbound connections its sessions can make. The default level, Trusted, allows package registries and other allowlisted domains; Custom takes your own domain list. To change an environment’s network access, open it for editing and use the Network access selector in the dialog. The cloud icon that opens the selector appears on the app surfaces listed under The Default environment and in the routine editor; personal environments don’t have a separate page in your claude.ai account settings.Access levels
The Network access field in the environment dialog takes one of four levels:Allow specific domains
To allow domains that aren’t in the Trusted list, select Custom in the environment’s network access settings, then list one domain per line in the Allowed domains field. This example allows three hosts an internal project might need.api.example.com, any subdomain of internal.example.com, and registry.example.com, and no other domains through the session’s network; GitHub traffic and MCP connector traffic don’t go through this allowlist. A leading *. matches every subdomain. To keep the Trusted domains too, check Also include default list of common package managers; leave it unchecked to allow only what you list.
Each environment has its own allowed-domains list; there’s no organization-level allowlist that admins can push to every member’s environments. Server-managed settings still apply inside cloud sessions, but none of them adds domains to the environment’s network allowlist.
GitHub proxy
All GitHub operations go through a dedicated proxy that keeps your real GitHub credentials outside the session’s VM, independent of the environment’s access level:- Git credentials: the git client inside the VM uses a scoped credential, which the proxy verifies and swaps for your actual GitHub token.
- API requests: requests from the built-in GitHub tools, and from
ghunder theproxy-injectedplaceholder, go out with your real credentials substituted. - Push protection:
git pushworks only against the session’s current working branch; cloning, fetching, and PR operations work normally. - Repository scope: GitHub API and release-asset requests reach only repositories attached to the session, so a setup script that downloads release assets from an unattached repository gets a 403.
raw.githubusercontent.com, which the security proxy handles instead. That domain is in the default Trusted list, so those files stay reachable unless the environment’s access level excludes it.
Security proxy
Cloud sessions run behind an HTTP/HTTPS network proxy for security and abuse prevention purposes. All outbound internet traffic passes through this proxy, which provides:- Protection against malicious requests
- Rate limiting and abuse prevention
- Content filtering for enhanced security
- A DNS-level audit trail of requested hostnames
What’s available in cloud sessions
Each session gets a fresh virtual machine (VM) running Ubuntu 24.04, regardless of your own operating system, with your repository cloned and common toolchains pre-installed. This section covers those defaults, the built-in GitHub tools, how to run tests and services, and the resource limits each VM gets.What carries over from your setup
Cloud sessions start from a fresh clone of your repository. Anything you commit to the repo is available. Anything you’ve installed or configured only on your own machine isn’t available in the session. Your organization’s policy arrives separately through server-managed settings.Installed tools
Cloud sessions come with common language runtimes, build tools, and databases pre-installed. The table below summarizes what’s included by category.check-tools in a cloud session. It’s a shell command installed on the session VM, not a slash command; you ask Claude because Claude runs all VM commands for you.
Toolchains outside this list, such as the .NET SDK, aren’t pre-installed even when their package registries are on the default allowlist. Install them with a setup script.
Work with GitHub issues and pull requests
Cloud sessions include built-in GitHub tools that let Claude read issues, list pull requests, fetch diffs, and post comments without any setup. These tools authenticate through the GitHub proxy using whichever method you configured under GitHub authentication options, so your token never enters the container. You can setGH_TOKEN or GITHUB_TOKEN yourself in environment settings, or leave both unset and let the GitHub proxy authenticate for you:
- If you set a token, it passes through to the container unchanged, so your scripts, and GitHub’s
ghCLI if you install it, use it directly. - If you set neither and the GitHub proxy is handling authentication for your session, both variables read as the placeholder string
proxy-injectedin the commands Claude runs, and the proxy substitutes your real credentials on outbound GitHub requests.ghworks without a token of your own, but a script that readsGITHUB_TOKENdirectly gets the placeholder, not a usable token.
echo $GH_TOKEN.
GitHub’s gh CLI isn’t pre-installed. If you need a gh command the built-in tools don’t cover, like gh release or gh workflow run, install and authenticate it yourself:
Install gh in your setup script
apt update && apt install -y gh to your setup script.Provide a token if the proxy is not handling authentication
echo $GH_TOKEN prints proxy-injected, the GitHub proxy authenticates gh for you and this step is unnecessary. Otherwise, add a GH_TOKEN environment variable to your environment settings with a GitHub personal access token; like any environment variable, it’s readable by anyone who uses the environment, so scope the token narrowly. gh reads GH_TOKEN automatically, so you don’t need to run gh auth login.Link output back to the session
Each cloud session has a transcript URL on claude.ai, and the session can read its own ID from theCLAUDE_CODE_REMOTE_SESSION_ID environment variable. Use this to put a traceable link in PR bodies, commit messages, Slack posts, or generated reports so a reviewer can open the run that produced them.
Commits that Claude creates in a cloud session include a Claude-Session: <url> git trailer, and PR bodies include the session URL on its own line. This requires v2.1.179 or later. To omit the trailer and the PR-body link, set attribution.sessionUrl to false. The setting requires v2.1.182 or later.
To include the session link in something other than a commit or PR, such as a Slack message Claude posts or a report file it writes, have Claude run the following command and use its output. The command converts the cse_ prefix in the environment variable’s value to the session_ prefix that the transcript URL expects:
Run tests, start services, and add packages
You don’t get a shell into the session VM. Claude runs every command for you, so phrase the tasks in this section as requests in your prompt.Run tests
Claude runs tests as part of working on a task. Ask for it in your prompt, like “fix the failing tests intests/” or “run pytest after each change.” Test runners that come with the pre-installed toolchains, like pytest and cargo test, work without additional setup. A runner your project declares as a dependency, like jest, installs with your dependencies.
Start services
PostgreSQL and Redis are pre-installed but not running by default. Ask Claude to start whichever you need; the commands it runs are:docker compose up to start your project’s services. Network access to pull images follows your environment’s access level, and the Trusted defaults include Docker Hub and other common registries.
If your images are large or slow to pull, add docker compose pull or docker compose build to your setup script. The environment cache keeps the pulled images, so each new session has them on disk. The cache stores files only, not running processes, so Claude still starts the containers each session.
Add packages
To add packages that aren’t pre-installed, use a setup script. The environment cache keeps what the script installs, so packages you install there are available at the start of every session without reinstalling each time. You can also ask Claude to install packages mid-session, but those installs don’t carry over to other sessions.Resource limits
Cloud sessions run with approximate resource ceilings that may change over time:- 4 vCPUs
- 16 GB of RAM
- 30 GB of disk
Setup scripts
A setup script is a Bash script that runs when a new cloud session starts, before Claude Code launches. Use setup scripts to install dependencies, configure tools, or fetch anything the session needs that isn’t pre-installed. Scripts run as root on Ubuntu 24.04, soapt install and most language package managers work.
To add a setup script, open the environment settings dialog and enter your script in the Setup script field.
This example installs GitHub’s gh CLI, which isn’t pre-installed.
Script requirements
A setup script has three constraints to write around:- Exit zero: if the script exits non-zero, the session fails to start. Append
|| trueto non-critical commands so an intermittent install failure doesn’t block the session. - Finish within five minutes: keep the script’s total runtime under roughly five minutes so the environment cache can build. Run independent installs in parallel with
&andwait, and move any single download that won’t fit into a SessionStart hook that launches it in the background. - Network access for installs: package installs need to reach registries. The default Trusted level covers common package registries including npm, PyPI, RubyGems, and crates.io; with None network access, installs fail.
Environment caching
The setup script runs the first time you start a session in an environment. After it completes, Anthropic snapshots the filesystem and reuses that snapshot as the starting point for later sessions. New sessions start with your dependencies, tools, and Docker images already on disk, and skip the setup script step. This keeps startup fast even when the script installs large toolchains or pulls container images. The cache is a filesystem snapshot, so it keeps what the setup script writes to disk and loses anything that was only running. Packages you install, Docker images you pull, and files you write all carry over. A database the script started, adocker compose up stack, or any other background process doesn’t; start those per session by asking Claude or with a SessionStart hook.
The setup script runs again to rebuild the cache when you change the environment’s setup script or allowed network hosts, and when the cache reaches its expiry after roughly seven days. Resuming an existing session never re-runs the setup script.
You don’t need to enable caching or manage snapshots yourself.
Setup scripts vs. SessionStart hooks
Use a setup script to provision the VM itself: toolchains and CLI tools that aren’t pre-installed. Use a SessionStart hook for project setup that should run everywhere, cloud and local, likenpm install.
Setup scripts and SessionStart hooks run in a fixed order when a cloud session starts:
- The setup script runs first, before Claude Code launches, and only when no cached environment exists.
- Claude Code launches and runs your SessionStart hooks, as it does at the start of every session, local or cloud.
~/.claude/settings.json, don’t expect them in the cloud: user-level settings stay on your machine. In a cloud session, Claude Code runs hooks from the repository and from your organization’s server-managed settings.
Install dependencies with a SessionStart hook
To install dependencies only in cloud sessions, pair a SessionStart hook with a script that checks where it’s running. First, add a SessionStart hook to your repo’s.claude/settings.json. This configuration tells Claude Code to run scripts/install_pkgs.sh from your repository whenever a session starts or resumes:
matcher limits the hook to the startup and resume events, and $CLAUDE_PROJECT_DIR resolves to the repository root, so the hook finds the script regardless of the session’s working directory.
Next, create the script at scripts/install_pkgs.sh. It exits immediately outside the cloud, then installs your dependencies:
CLAUDE_CODE_REMOTE check is what scopes the install to cloud sessions: the session VM’s environment carries that variable as true, it’s never true locally, so on your laptop the script exits before installing anything.
Together, the two files give every cloud session a fresh npm install and pip install at startup while leaving local sessions untouched.
Limitations in cloud sessions
SessionStart hooks behave the same in the cloud as locally, with these caveats:- No cloud-only scoping: hooks run in both local and cloud sessions. To skip local execution, check the
CLAUDE_CODE_REMOTEenvironment variable as shown above. - Requires network access: install commands need to reach package registries. If your environment uses None network access, these hooks fail. The default allowlist under Trusted covers npm, PyPI, RubyGems, and crates.io.
- Proxy compatibility: all outbound traffic passes through a security proxy. Some package managers don’t work correctly with this proxy. Bun is a known example.
- Adds startup latency: hooks run each time a session starts or resumes, unlike setup scripts which benefit from environment caching. Keep install scripts fast by checking whether dependencies are already present before reinstalling.
$CLAUDE_ENV_FILE. See SessionStart hooks for details.
To customize the base image, use a setup script to install what you need on top of the provided image, or run your own image as a container alongside Claude with docker compose. Replacing the base image entirely isn’t supported yet.
Default allowed domains
With Trusted network access, sessions can reach the following domains by default. Domains marked with* indicate wildcard subdomain matching, so *.gcr.io allows any subdomain of gcr.io.
Anthropic services
Anthropic services
- api.anthropic.com
- statsig.anthropic.com
- docs.claude.com
- platform.claude.com
- code.claude.com
- claude.ai
Version control
Version control
- github.com
- www.github.com
- api.github.com
- npm.pkg.github.com
- raw.githubusercontent.com
- pkg-npm.githubusercontent.com
- objects.githubusercontent.com
- release-assets.githubusercontent.com
- codeload.github.com
- avatars.githubusercontent.com
- camo.githubusercontent.com
- gist.github.com
- gitlab.com
- www.gitlab.com
- registry.gitlab.com
- bitbucket.org
- www.bitbucket.org
- api.bitbucket.org
Container registries
Container registries
- registry-1.docker.io
- auth.docker.io
- index.docker.io
- hub.docker.com
- www.docker.com
- production.cloudflare.docker.com
- download.docker.com
- gcr.io
- *.gcr.io
- ghcr.io
- mcr.microsoft.com
- *.data.mcr.microsoft.com
- public.ecr.aws
Cloud platforms
Cloud platforms
- cloud.google.com
- accounts.google.com
- gcloud.google.com
- *.googleapis.com
- storage.googleapis.com
- compute.googleapis.com
- container.googleapis.com
- azure.com
- portal.azure.com
- microsoft.com
- www.microsoft.com
- *.microsoftonline.com
- packages.microsoft.com
- dotnet.microsoft.com
- dot.net
- visualstudio.com
- dev.azure.com
- *.amazonaws.com
- *.api.aws
- oracle.com
- www.oracle.com
- java.com
- www.java.com
- java.net
- www.java.net
- download.oracle.com
- yum.oracle.com
JavaScript and Node package managers
JavaScript and Node package managers
- registry.npmjs.org
- www.npmjs.com
- www.npmjs.org
- npmjs.com
- npmjs.org
- yarnpkg.com
- registry.yarnpkg.com
Python package managers
Python package managers
- pypi.org
- www.pypi.org
- files.pythonhosted.org
- pythonhosted.org
- test.pypi.org
- pypi.python.org
- pypa.io
- www.pypa.io
Ruby package managers
Ruby package managers
- rubygems.org
- www.rubygems.org
- api.rubygems.org
- index.rubygems.org
- ruby-lang.org
- www.ruby-lang.org
- rubyforge.org
- www.rubyforge.org
- rubyonrails.org
- www.rubyonrails.org
- rvm.io
- get.rvm.io
Rust package managers
Rust package managers
- crates.io
- www.crates.io
- index.crates.io
- static.crates.io
- rustup.rs
- static.rust-lang.org
- www.rust-lang.org
Go package managers
Go package managers
- proxy.golang.org
- sum.golang.org
- index.golang.org
- golang.org
- www.golang.org
- goproxy.io
- pkg.go.dev
JVM package managers
JVM package managers
- maven.org
- repo.maven.org
- central.maven.org
- repo1.maven.org
- repo.maven.apache.org
- jcenter.bintray.com
- gradle.org
- www.gradle.org
- services.gradle.org
- plugins.gradle.org
- kotlinlang.org
- www.kotlinlang.org
- spring.io
- repo.spring.io
Other package managers
Other package managers
- packagist.org (PHP Composer)
- www.packagist.org
- repo.packagist.org
- nuget.org (.NET NuGet)
- www.nuget.org
- api.nuget.org
- pub.dev (Dart/Flutter)
- api.pub.dev
- hex.pm (Elixir/Erlang)
- www.hex.pm
- cpan.org (Perl CPAN)
- www.cpan.org
- metacpan.org
- www.metacpan.org
- api.metacpan.org
- cocoapods.org (iOS/macOS)
- www.cocoapods.org
- cdn.cocoapods.org
- haskell.org
- www.haskell.org
- hackage.haskell.org
- swift.org
- www.swift.org
Linux distributions
Linux distributions
- archive.ubuntu.com
- security.ubuntu.com
- ubuntu.com
- www.ubuntu.com
- *.ubuntu.com
- ppa.launchpad.net
- launchpad.net
- www.launchpad.net
- *.nixos.org
Development tools and platforms
Development tools and platforms
- dl.k8s.io (Kubernetes)
- pkgs.k8s.io
- k8s.io
- www.k8s.io
- releases.hashicorp.com (HashiCorp)
- apt.releases.hashicorp.com
- rpm.releases.hashicorp.com
- archive.releases.hashicorp.com
- hashicorp.com
- www.hashicorp.com
- repo.anaconda.com (Anaconda/Conda)
- conda.anaconda.org
- anaconda.org
- www.anaconda.com
- anaconda.com
- continuum.io
- apache.org (Apache)
- www.apache.org
- archive.apache.org
- downloads.apache.org
- eclipse.org (Eclipse)
- www.eclipse.org
- download.eclipse.org
- nodejs.org (Node.js)
- www.nodejs.org
- developer.apple.com
- developer.android.com
- pkg.stainless.com
- binaries.prisma.sh
Cloud services and monitoring
Cloud services and monitoring
- statsig.com
- www.statsig.com
- api.statsig.com
- sentry.io
- *.sentry.io
- downloads.sentry-cdn.com
- http-intake.logs.datadoghq.com
- browser-intake-us5-datadoghq.com
- *.datadoghq.com
- *.datadoghq.eu
- api.honeycomb.io
Content delivery and mirrors
Content delivery and mirrors
- sourceforge.net
- *.sourceforge.net
- packagecloud.io
- *.packagecloud.io
- fonts.googleapis.com
- fonts.gstatic.com
Schema and configuration
Schema and configuration
- json-schema.org
- www.json-schema.org
- json.schemastore.org
- www.schemastore.org
Model Context Protocol
Model Context Protocol
- *.modelcontextprotocol.io
Related resources
- Claude Code on the web: start, manage, and share cloud sessions
- Web quickstart: connect GitHub and start your first cloud session
- Claude Tag: sessions Claude starts from Slack run in the same environments
- Routines: scheduled runs use the same environments and network access levels
- Remote Control: run sessions on your own machine’s network and files instead
- SessionStart hooks: repo-committed setup that runs in local and cloud sessions
- Server-managed settings: organization policy that reaches cloud sessions