Text of code.claude.com › docs › en › cloud-environments as Styx crawled it on Nov 20, 2026. The page may have changed since. Only its words are kept, without pictures or layout, and only the first part of a long page.

Open the live page

Configure cloud environments - Claude Code Docs

Documentation Index Fetch the complete documentation index at: /docs/llms.txt Use this file to discover all available pages before exploring further. Skip to main content Assistant Responses are generated using AI and may contain mistakes. Cloud environments apply to cloud sessions , which are available on Pro, Max, Ultra, and Team plans, and for Enterprise users with premium seats or Chat + Claude Code seats . Each cloud session runs in a cloud environment.

You can configure an environment to allow or deny network access , set environment variables for the session, store network secrets that sessions use without seeing them, and run a setup script before Claude starts working. The same environments apply wherever you start a cloud session: The Desktop app The Claude mobile app Your browser at claude.ai/code The terminal with claude --cloud Cloud scheduled tasks Claude Tag Each of these surfaces can also route to a self-hosted environment .

Availability and limitations covers what Claude can’t use yet when a Claude Tag session runs in one. Remote Control sessions 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. To choose the environment a Claude Tag channel uses, see Set the environment a Claude Tag channel uses . The Default environment If you don’t have an environment yet, onboarding sets up the Default environment.

How depends on where you onboard: CLI flows such as /web-setup : create Default for you Web onboarding on Pro, Max, and Ultra : you get Default automatically Web onboarding on Team and Enterprise : shows a Create your first cloud environment form unless an Owner has turned on Quick setup ; keep the form’s defaults and click Create & finish to get the same Default environment Default carries no configuration of its own: Limited network access : sessions reach package registries and other allowlisted domains .

No other configuration: Default defines no environment variables or setup script, so sessions start with just the pre-installed tools . With only Default available, every session runs in it. When you have more than one environment, sessions choose one per surface: In the Desktop app, the mobile app, and at claude.ai/code, sessions you start yourself use the environment shown in the selector . An organization default set by an Owner fills the selection when you haven’t picked one.

Threads in a project use the environment set in the project’s settings instead. From the CLI, Claude Code uses your /remote-env pick , or falls back to the Anthropic-hosted environment when your list has one, and otherwise to the first environment in your list that isn’t a bridge environment, an entry Remote Control registers to represent your own machine rather than a cloud environment. For a self-hosted environment , passing --environment <environment-id> with its ccpool_ ID when you dispatch a session overrides the /remote-env pick and the fallback for that invocation.

Claude Code rejects Anthropic-hosted env_ IDs passed to the flag, so use /remote-env to target those. The flag requires Claude Code v2.1.224 or later. Configure an environment when the default isn’t enough: when Claude needs to reach domains outside the default allowlist , needs environment variables set for its sessions, or needs dependencies installed before it starts working. Configure your environment Add, edit, and archive environments from the environment selector under the message box on the screen where you start a new session at claude.ai/code .

To reach that screen, complete web onboarding . For the Desktop app, see Cloud sessions . Environments you create are personal to your account; shared environments created by an Owner appear in the selector alongside them. See Installed tools for what’s available without any configuration. The selector appears only until you send a new session’s first message. To edit the environment of a running cloud session of your own, select the caret after the session title at the top, then select Edit cloud environment .

1 Open the environment selector On the new-session screen, select the first control in the row under the message box. 2 Add or edit an environment Add an environment : select New environment at the bottom of the menu to open the New environment dialog. Fill in the form and select Add environment . Your new session then uses the environment you added. Edit an environment : find its row under Cloud . If Cloud is a single row, select it to open the list.

If your environment isn’t listed under Cloud , select the More row under that heading. Hover over the environment’s row and select the settings icon that appears on its right to open its dialog. When you add an environment or edit one of your own, select the dialog’s Network access , Setup script , or Environment variables row to open that setting. After your last change, save with Add environment for a new environment or Save changes for an existing one.

To store a key that sessions use without seeing it, see Add network secrets . 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. NODE_ENV=development LOG_LEVEL=debug DATABASE_URL=postgres://localhost:5432/myapp A session reads the environment’s values into ordinary environment variables that any command Claude runs can read, except OTEL_* variables. Claude Code uses those for its own telemetry export and doesn’t pass them to the commands it runs. In an Anthropic-hosted environment, a session reads the environment’s values when you create it and again each time Claude Code starts in the session’s VM afterward, which happens in two cases: The VM is restored after being idle : after a few minutes without activity, a session’s VM pauses with its files saved.

Your next message restores the same VM and starts Claude Code again. The VM was reclaimed and is rebuilt : if the paused VM has since been reclaimed , reopening the session provisions a fresh VM. After you edit, add, or remove a variable, an existing session in an Anthropic-hosted environment keeps the values it last read until its VM is next restored or rebuilt, and uses your change from then on. Its VM pauses on its own once the session is idle, and you can’t pause it yourself.

To use a new value right away, ask Claude to set it on the command it runs, for example LOG_LEVEL=trace npm test , or start a new session. A cloud session also sets some variables itself when it starts. For CLAUDE_AUTOCOMPACT_PCT_OVERRIDE , the value the session sets overrides one you add here, so adding that key here has no effect. Anyone who uses the environment can read the values. In an Anthropic-hosted environment, use a network secret instead for a key the agent proxy can attach to a request.

The requests that never get a secret are listed there. Add network secrets A network secret is an API key or token you store on a cloud environment so Claude can call that API from any session in the environment without seeing the key. Anthropic’s agent proxy adds the key to requests for the hosts you list, after each request leaves the session’s VM, so the key itself stays outside the VM. Network secrets are available on Pro, Max, Ultra, Team, and Enterprise plans.

To check whether you can add one yourself, see Requirements . Requirements These requirements decide whether you can add a secret and whether the agent proxy can use it once added: Role : on every plan, you can add and delete secrets on your own environments whatever your role. On Team and Enterprise, Owners hold an organization admin role in your claude.ai organization and

The rest of this page is on the live site.