Learning resourcesReviewed · Anthropic

Claude Code: Configure cloud environments

This is Anthropic's guide for developers and team owners configuring Claude Code cloud sessions, where disabling network access still permits several service connections. It explains environment variables, API secrets, setup scripts, shared environments and cached Linux workspaces.

Researched 25 Nov 2026

In short.

This is Anthropic's configuration guide for developers and organization Owners using Claude Code cloud sessions, where network restrictions have exceptions and local configuration does not all carry over. It explains how to provision an Ubuntu workspace, control outbound connections, keep supported API credentials outside the virtual machine and reuse installed dependencies through caching. Its most consequential details concern credential access, when configuration changes take effect and differences between setup scripts and session hooks. Subscription prices, practical performance and operational reliability are unknown from this page.

Researched and written by an AI model and checked by a second AI model. How it works

Coverage is the complete selected page at https://code.claude.com/docs/en/cloud-environments.md, including its plan notices, hosted and self-hosted distinctions, network exceptions, credential handling, setup and caching requirements, resource limits and default domain allowlist. The report summarizes that allowlist without reproducing every domain. Linked documentation, support pages, service terms and other resources were excluded. All behavior is described from the captured text; execution, configuration, performance and security behavior were not tested.

The overview

Identity

Configure cloud environments is an Anthropic documentation page about the execution environments used by Claude Code cloud sessions. It is a configuration guide rather than a separate application, model or downloadable library. The original source is [https://code.claude.com/docs/en/cloud-environments.md].

The page covers Anthropic-hosted environments in detail and explains where self-hosted environments differ. The same environment configurations serve cloud sessions started through the browser, Desktop app, mobile app, terminal, scheduled tasks and Claude Tag.

Assessment

This guide is useful when a repository needs dependencies, API access or configuration beyond the default cloud workspace. It gives concrete controls and explains their operational consequences, including when edits reach existing sessions.

Its particularly useful distinction is between restricting ordinary outbound traffic and restricting every service Claude can reach. Another is between caching installed files and preserving running services. These details help determine whether a cloud environment fits an existing development workflow; actual startup speed, reliability and project compatibility remain unassessed.

Users

The main audience is developers moving repository work into Claude Code cloud sessions. Readers need enough familiarity with environment variables, dependency installation and repository configuration to apply the instructions. Bash knowledge is needed for custom setup scripts.

Organization Owners can use shared environments to give Team and Enterprise members a common configuration. Claude Tag channel sessions use organization-level shared or self-hosted environments. Remote Control users work with their own machine's network and files, so the hosted workspace configuration does not govern those sessions.

Capabilities

Environments support three outbound network levels: None, Limited and Full. Limited can combine a built-in domain allowlist with custom domains and wildcard subdomains. The default environment uses Limited with Allow package managers enabled; that allowlist includes development and cloud services as well as package registries.

Other controls include ordinary environment variables, proxy-held API secrets, Bash setup scripts, automatic filesystem caching and organization sharing. The /remote-env command selects a default environment for CLI cloud sessions but does not create or edit environments.

Pre-installed tools include common Python, Node.js, Ruby, PHP, Java, Go, Rust and C/C++ tooling, Docker, PostgreSQL, Redis and Chrome. Node.js 22 is on PATH by default, with versions 20 and 21 also installed. PostgreSQL and Redis are installed but require starting in each session.

Using it

Requirements

The page lists cloud sessions for Pro, Max, Ultra and Team plans, plus Enterprise users with premium seats or Chat + Claude Code seats. Browser configuration requires completing web onboarding. Local tools and personal settings are not automatically transferred to a cloud session.

Network secrets require an Anthropic-hosted environment and an internet-reachable API. They are unavailable for self-hosted environments and organizations using customer-managed encryption keys. Users can manage secrets on their own environments; shared environments and their secrets require an Owner. The Admin role cannot open the Cloud environments admin page.

The self-hosted --environment flag requires Claude Code v2.1.224 or later and accepts ccpool_ environment IDs. Anthropic-hosted env_ IDs must be selected through /remote-env instead.

Mechanism

Each Anthropic-hosted session gets an Ubuntu 24.04 virtual machine using x86_64 architecture and a clone of the repository. Dependencies with native binaries must match Linux x86_64. Committed repository configuration can be available, while user-level configuration stored only on a developer's machine is absent. Project threads and sessions with several repositories load less repository configuration.

Network restrictions apply to connections passing through the session's network allowlist. GitHub's dedicated proxy, enabled MCP connectors, permitted network-secret hosts and Claude Code's own Anthropic API requests follow separate paths. Those connections can remain available at the None level.

For supported API requests, an agent proxy attaches a stored secret after the request leaves the virtual machine. The credential stays outside the VM, but every session using that environment can make authenticated requests to its configured hosts. This protects the key's visibility while still granting API access.

Setup caching saves filesystem changes, including installed packages and pulled Docker images. It does not preserve running databases, containers or background processes. The cache is rebuilt after setup-script or allowed-host changes and expires after roughly seven days.

Setup

At [https://claude.ai/code], use the environment selector before sending a new session's first message to create or edit a personal environment. Configure Network access, Setup script and Environment variables, then save. Owners manage shared environments through the Cloud environments admin page. An existing personal session also offers Edit cloud environment from its title menu.

Variables use .env syntax, with one KEY=value pair per line. Values containing # or spanning multiple lines need matching quotes. Anyone using the environment can read ordinary variables and the setup script. OTEL_* variables are reserved for Claude Code telemetry and are not passed to commands. Existing hosted sessions read variable changes when their VM is next restored or rebuilt; network changes generally reach allowlisted requests within about a minute.

A setup script runs as root before Claude Code launches. It should exit successfully and finish within roughly five minutes to qualify for caching. Environment-configured variables are not set yet, and network secrets are unavailable to setup-script requests.

Use setup scripts for VM provisioning and SessionStart hooks for repository setup that should also work locally. Repository hooks run after Claude Code starts and can run on resume. In Anthropic-hosted environments, project threads and sessions with several repositories do not run repository-defined SessionStart hooks.

Example

For illustration, a Node.js project needing ShellCheck could keep Limited network access with package managers allowed, set NODE_ENV=development and use a setup script containing apt update && apt install -y shellcheck. Successful setup completed within roughly five minutes would make ShellCheck available through the cached filesystem in later sessions.

In a supported single-repository session outside a project thread, a committed SessionStart hook could install project dependencies. The page's example checks CLAUDE_CODE_REMOTE before running and records hashes to skip unchanged npm installs. If an installation also depends on workspace manifests, package-manager configuration or other files, those inputs must be included in the change detection.

If the project needs an authenticated external API, a network secret can supply the credential without exposing its value inside the VM. That credential will not be available during the setup script, so authenticated bootstrap downloads need a different arrangement.

Assessment & evidence

Limitations

Hosted VMs have approximate ceilings of 4 vCPUs, 16 GB RAM and 30 GB disk, which may change. Memory-heavy tasks can be stopped. Interactive authentication such as AWS SSO is unsupported, and replacing the hosted base image is unsupported. Additional toolchains such as .NET require installation. Bun has documented package-fetching compatibility problems with the hosted proxy.

GitHub API access is scoped to attached repositories. The proxy blocks GraphQL, including gh pr and gh issue operations that use it, even when a user supplies a token. REST operations through gh api are the documented alternative. The proxy rejects branch deletions and non-branch pushes, but restricting which branches can be updated requires GitHub protections.

Network secrets are not attached to GitHub requests, the Anthropic API, specified public package registries, setup-script requests or Claude Code telemetry exports. Overlapping secret host patterns can result in only one secret being sent. Changing a secret's value or hosts requires deleting and recreating it.

Archiving an environment prevents new sessions but leaves existing sessions running and their secrets attached. Foreground commands default to a two-minute wait and can request up to ten minutes; reaching that timeout normally moves work to the background, where a further default time limit applies. Idle VMs can pause and later be reclaimed.

Reasoning

The guide supports a practical fit decision because it connects configuration controls to dependency installation, credential exposure, repository settings and session lifecycle. A team needing repeatable tool installation and a shared environment has documented mechanisms for both.

A workflow requiring complete network disconnection, interactive browser authentication, substantially larger builds or a custom base image needs closer architectural consideration. The documented exceptions and resource ceilings explain those concerns. No claim about productivity gains, security effectiveness or compatibility with a particular project can be established without further evidence.

Alternatives

The Default environment may be sufficient when the pre-installed tools and default allowed domains meet a project's needs. It adds no environment variables or setup script.

The page identifies Remote Control for sessions using a person's own machine, network and files, and self-hosted environments for cloud sessions running on an organization's infrastructure. These are relevant options for workloads exceeding hosted limits or needing different infrastructure. Their linked documentation, deployment effort, costs and full limitations were not assessed.

Evidence

The evidence consists of the complete captured documentation page at [https://code.claude.com/docs/en/cloud-environments.md], retained as selected-page.txt. Its source revision is sha256:31e38896dbbeb74ebc5471b05bfd8f3d57134d2e2d7063945466032849a15720.

The findings describe documented behavior. Nothing was executed: no environment was configured, no command or sample script was run, and no API, credential flow or network restriction was tested. Linked pages and independent performance or security measurements are outside the evidence.

Access & freshness

Costs

The page identifies supported subscription plans but gives no subscription prices, cloud-session charges, usage quotas or third-party API prices. It does not establish whether additional compute or storage charges apply. Total operating cost is unknown.

Caching is documented to skip repeated setup work, but the page provides no measured time savings or financial savings.

Rights

The supplied page does not state a documentation licence or explicit redistribution terms for its text and example scripts. Permission to redistribute the complete page or reuse its examples is therefore unknown from this source.

Contractual service terms, ownership of generated code and data-retention terms are not established by this configuration guide. Its descriptions of credential handling do not establish those broader rights.

Freshness

The source was captured on 2026-11-25 at 02:32:06.663 UTC. The supplied page gives no publication date, last-updated date or overall release version. The snapshot hash identifies the captured text rather than a software release.

The page explicitly describes VM resource ceilings as approximate and subject to change. Plan availability, tool inventories, UI controls and network behavior should be confirmed before relying on them for a deployment. The v2.1.224 requirement applies specifically to the documented self-hosted environment flag.

Actions

Confirm the account plan and whether sessions will use Anthropic-hosted or self-hosted infrastructure. Compare the project's architecture, memory needs, authentication and toolchain with the documented hosted limits. Review the full default domain allowlist before leaving Allow package managers enabled.

Choose the required domains and connectors, store supported API credentials as network secrets, and keep required setup steps within the caching window. Account for the absence of environment-configured variables and network secrets during setup. Check whether the intended session type loads repository hooks.

In a new session, ask Claude to report installed tool versions with check-tools, install project dependencies and run the project's relevant checks. Confirm API access, GitHub REST operations and expected behavior after configuration changes. These checks remain to be performed. When retiring an environment, delete unwanted secrets before archiving it.

Evidence for this report

selected-page.txtselected · checked 2026-11-25