modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -19,7 +19,7 @@ * **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](</docs/en/claude-code-on-the-web#quick-setup-for-team-and-enterprise>); keep the form’s defaults and click **Create & finish** to get the same **Default** environment + * **Web onboarding on Team and Enterprise** : in some organizations, claude.ai/code creates **Default** for you. If you see a **Create your first cloud environment** form instead, keep the form’s defaults and click the **Create & finish** button to create the same **Default** environment **Default** carries no configuration of its own: @@ -65,7 +65,7 @@ * **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](</docs/en/claude-code-on-the-web#environment-expired>), 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`](</docs/en/claude-code-on-the-web#manage-context>), 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. +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`](</docs/en/env-vars>), 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 @@ -166,9 +166,11 @@ ## Network access -Each environment sets one network access level, which controls the outbound connections its sessions can make. A new environment starts at **Limited** with **Allow package managers** checked, so its sessions reach package registries and other allowlisted domains. To change an environment’s network access, open it for editing and use the **Network access** selector in the dialog. A shared environment opens read-only there, so an Owner changes its network access from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>) instead. The control that opens the selector appears on the app surfaces listed under The Default environment and in the [cloud scheduled task editor](</docs/en/routines#environments-and-network-access>). When you change an Anthropic-hosted environment’s network access, its existing sessions follow the new setting within about a minute, for requests that go through the session’s network allowlist. You don’t need to start a new session. +Each environment sets one network access level, which controls the outbound connections its sessions can make. A new environment starts at **Limited** with **Allow package managers** checked, so its sessions reach package registries and other allowlisted domains. To change an environment’s network access, open it for editing and use the **Network access** selector in the dialog. A shared environment opens read-only there, so an Owner changes its network access from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>) instead. The control that opens the selector appears on the app surfaces listed under The Default environment and in the [cloud scheduled task editor](</docs/en/routines#environments-and-network-access>). MCP connectors you enable on a session or scheduled task work without adding their hosts to **Allowed domains** , because connector traffic travels through Anthropic’s servers rather than the session’s network. This relies on the same Anthropic-bound channel noted under [Security and isolation](</docs/en/claude-code-on-the-web#security-and-isolation>). Turn off any connector you don’t need to limit which tools Claude can reach. + +When you change an Anthropic-hosted environment’s network access, existing sessions follow the new setting within about a minute for requests that commands such as `curl` send through the agent proxy. If a request is still blocked after that, start a new session. ### Access levels @@ -236,7 +238,7 @@ A cloud thread in a [project](</docs/en/claude-projects>) loads less of the repository configuration in this table. It starts without `.mcp.json` servers or `.claude/settings.json` hooks and permission rules, and it can skip skills, agents, and commands. See [What threads pick up from your repositories](</docs/en/claude-projects#what-threads-pick-up-from-your-repositories>).[PR Steward](</docs/en/pr-steward-pull-requests#save-pr-steward-instructions-for-everyone-in-a-repository>) sessions and [Approvals classifier runs](</docs/en/approvals-classifiers#what-a-classifier-run-can-read-and-change>) load less of it too. -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](</docs/en/server-managed-settings>). +Cloud sessions start from a fresh clone of your repository. Your organization’s policy arrives separately through [server-managed settings](</docs/en/server-managed-settings>). | Available in cloud sessions| Why ---|---|---
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -146,7 +146,7 @@ * **Saved CLI default** : if the environment was your saved CLI default, Claude Code starts CLI cloud sessions in the Anthropic-hosted environment when your list has one. Otherwise, it starts them in the first environment in your list that isn’t a Remote Control bridge environment. * **Configured explicitly** : anything configured with the environment explicitly, such as a [cloud scheduled task](</docs/en/routines#environments-and-network-access>), can’t start new sessions in it. Point it at another environment. -When you no longer need an Anthropic-hosted environment, archive it. Neither the environment dialog nor the **Cloud environments** admin page has an option to delete an Anthropic-hosted environment. If the environment is [self-hosted](</docs/en/self-hosted-environments>), an Owner can delete it from the **Cloud environments** page in admin settings. If you aren’t an Owner, ask one to delete it. +When you no longer need an Anthropic-hosted environment, archive it. Neither the environment dialog nor the **Cloud environments** admin page has an option to delete an Anthropic-hosted environment. If the environment is [self-hosted](</docs/en/self-hosted-environments>), an Owner can delete it from the **Cloud environments** page in admin settings. ### Organization-shared environments
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -249,7 +249,7 @@ Your organization’s [server-managed settings](</docs/en/server-managed-settings>)| Yes, except in [Claude Tag](<https://claude.com/docs/claude-tag/overview>) sessions| Fetched from Anthropic’s servers when the session starts. See [Surface coverage](</docs/en/model-config#surface-coverage>) for how `availableModels` is enforced in cloud sessions. Settings deployed to your device through MDM or managed settings files don’t apply, because the session runs on an Anthropic-managed VM; in a [self-hosted environment](</docs/en/self-hosted-environments>), sessions also read the managed settings file in the runner image, per [how Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) Your user `~/.claude/CLAUDE.md`| No| Lives on your machine, not in the repo. See Add personal preferences without committing to the repo Your user `~/.claude/skills/`, `~/.claude/agents/`, `~/.claude/commands/`| No| Live on your machine, not in the repo. Commit them to the repo’s `.claude/` directory instead. Cloud sessions automatically load [skills you enable on claude.ai](</docs/en/skills#skills-in-cowork-and-cloud-sessions>) -Plugins enabled only in your user settings| No| User-scoped `enabledPlugins` lives in `~/.claude/settings.json` on your machine +Plugins enabled only in your user settings| No| User-scoped `enabledPlugins` lives in `~/.claude/settings.json` on your machine. To use one, see the **Cloud session** tab under [Install a plugin](</docs/en/plugins/install#install-a-plugin>) MCP servers you added with `claude mcp add` at the default local scope or the user scope| No| At those scopes, the command writes to `~/.claude.json` on your machine. Run `claude mcp add --scope project` from the repository root to write the repo’s [`.mcp.json`](</docs/en/mcp#project-scope>), and commit that file. A session with one repository loads it Transport variables in your repo’s `.claude/settings.json` `env` block, such as `NODE_EXTRA_CA_CERTS` and the [mTLS client certificate variables](</docs/en/network-config#mtls-authentication>)| No| The hosting environment manages the session’s API connection, so Claude Code ignores these keys and notes each ignored key in the session’s debug log API keys and tokens for services Claude calls| In an Anthropic-hosted environment, as network secrets| You add the key once on the environment and the agent proxy attaches it to requests for the hosts you list. A key the agent proxy can’t attach stays in an environment variable
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -234,7 +234,7 @@ ### What carries over from your setup -A cloud thread in a [project](</docs/en/claude-projects>) loads less of the repository configuration in this table. It starts without `.mcp.json` servers or `.claude/settings.json` hooks and permission rules, and it can skip skills, agents, and commands. See [What threads pick up from your repositories](</docs/en/claude-projects#what-threads-pick-up-from-your-repositories>). +A cloud thread in a [project](</docs/en/claude-projects>) loads less of the repository configuration in this table. It starts without `.mcp.json` servers or `.claude/settings.json` hooks and permission rules, and it can skip skills, agents, and commands. See [What threads pick up from your repositories](</docs/en/claude-projects#what-threads-pick-up-from-your-repositories>).[PR Steward](</docs/en/pr-steward-pull-requests#save-pr-steward-instructions-for-everyone-in-a-repository>) sessions and [Approvals classifier runs](</docs/en/approvals-classifiers#what-a-classifier-run-can-read-and-change>) load less of it too. 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](</docs/en/server-managed-settings>). @@ -245,7 +245,7 @@ Your repo’s `.mcp.json` MCP servers| Yes, in a session with one repository| Part of the clone, found from the session’s working directory. For a self-hosted environment, see [which repository’s settings apply](</docs/en/self-hosted-environments-configuration#repository-settings-in-sessions-with-several-repositories>) Your repo’s `.claude/rules/`| Yes| Part of the clone Your repo’s `.claude/skills/`, `.claude/agents/`, `.claude/commands/`| Yes| Part of the clone -Plugins and marketplaces declared in your repo’s `.claude/settings.json`| No| A cloud session doesn’t install the plugins a repository turns on under [`enabledPlugins`](</docs/en/settings-reference#enabledplugins>), including ones from the marketplaces it lists under [`extraKnownMarketplaces`](</docs/en/settings-reference#extraknownmarketplaces>) +Marketplaces declared in your repo’s `.claude/settings.json`| No, in an Anthropic-hosted environment| The session doesn’t add the marketplaces a repository lists under [`extraKnownMarketplaces`](</docs/en/settings-reference#extraknownmarketplaces>). For a self-hosted environment, see [which repository’s settings apply](</docs/en/self-hosted-environments-configuration#repository-settings-in-sessions-with-several-repositories>) Your organization’s [server-managed settings](</docs/en/server-managed-settings>)| Yes, except in [Claude Tag](<https://claude.com/docs/claude-tag/overview>) sessions| Fetched from Anthropic’s servers when the session starts. See [Surface coverage](</docs/en/model-config#surface-coverage>) for how `availableModels` is enforced in cloud sessions. Settings deployed to your device through MDM or managed settings files don’t apply, because the session runs on an Anthropic-managed VM; in a [self-hosted environment](</docs/en/self-hosted-environments>), sessions also read the managed settings file in the runner image, per [how Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) Your user `~/.claude/CLAUDE.md`| No| Lives on your machine, not in the repo. See Add personal preferences without committing to the repo Your user `~/.claude/skills/`, `~/.claude/agents/`, `~/.claude/commands/`| No| Live on your machine, not in the repo. Commit them to the repo’s `.claude/` directory instead. Cloud sessions automatically load [skills you enable on claude.ai](</docs/en/skills#skills-in-cowork-and-cloud-sessions>)
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -234,7 +234,7 @@ ### What carries over from your setup -Of the repository configuration in this table, a cloud thread in a [project](</docs/en/claude-projects>) loads only the repository root’s `CLAUDE.md`, `.claude/CLAUDE.md`, and `.claude/rules/` files that aren’t [path-specific](</docs/en/memory#path-specific-rules>). See [What threads pick up from your repositories](</docs/en/claude-projects#what-threads-pick-up-from-your-repositories>). +A cloud thread in a [project](</docs/en/claude-projects>) loads less of the repository configuration in this table. It starts without `.mcp.json` servers or `.claude/settings.json` hooks and permission rules, and it can skip skills, agents, and commands. See [What threads pick up from your repositories](</docs/en/claude-projects#what-threads-pick-up-from-your-repositories>). 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](</docs/en/server-managed-settings>).
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -221,7 +221,7 @@ ### Security proxy -Cloud sessions in Anthropic-hosted environments run behind an HTTP/HTTPS network proxy for security and abuse prevention purposes; in a [self-hosted environment](</docs/en/self-hosted-environments-deploy#default-deny-egress>), outbound traffic leaves through your own network boundary instead. All outbound internet traffic from an Anthropic-hosted session passes through this proxy, which provides: +Cloud sessions in Anthropic-hosted environments run behind an HTTP/HTTPS network proxy for security and abuse prevention purposes. In a [self-hosted environment](</docs/en/self-hosted-environments-deploy#default-deny-egress>), outbound traffic leaves through your own network boundary instead. Outbound internet traffic from an Anthropic-hosted session’s VM passes through this proxy, which provides: * Protection against malicious requests * Rate limiting and abuse prevention @@ -442,7 +442,7 @@ * **Not in a project’s cloud threads** : a cloud thread in a [project](</docs/en/claude-projects#what-threads-pick-up-from-your-repositories>) doesn’t run hooks from a repository’s `.claude/settings.json`, whatever the number of repositories. In an Anthropic-hosted environment, install dependencies for threads with a setup script. In a self-hosted environment, use a hook in the [runner host’s settings](</docs/en/self-hosted-environments-configuration#repository-settings-in-sessions-with-several-repositories>) instead. * **No cloud-only scoping** : hooks run in both local and cloud sessions. To skip local execution, exit early unless the `CLAUDE_CODE_REMOTE` environment variable is `true`, the way the dependency install script does. * **Requires network access** : install commands need to reach package registries. If your environment uses **None** network access, these hooks fail. Under the default **Limited** level with **Allow package managers** checked, the default allowlist covers npm, PyPI, RubyGems, and crates.io. - * **Proxy compatibility** : in Anthropic-hosted environments, all outbound traffic passes through a security proxy, and some package managers don’t work correctly with it; Bun is a known example. In a [self-hosted environment](</docs/en/self-hosted-environments-deploy#default-deny-egress>), outbound traffic goes through your own network boundary instead. + * **Proxy compatibility** : in Anthropic-hosted environments, outbound traffic from the session’s VM passes through a security proxy, and some package managers don’t work correctly with it; Bun is a known example. In a [self-hosted environment](</docs/en/self-hosted-environments-deploy#default-deny-egress>), outbound traffic goes through your own network boundary instead. * **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 skipping work that’s already done, the way the dependency install script does. 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.
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -84,7 +84,7 @@ #### Add a secret -You add secrets one at a time. To change a secret’s hosts or value, delete it and add it again. To add a secret to a shared environment, open it for editing from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>), then continue from step 2 in its **Network secrets** section. If you’re on a Team or Enterprise plan and don’t hold an organization admin role, follow step 1 on your own environment, then fill in the shorter form. +You add secrets one at a time. To change a secret’s hosts or value, delete it and add it again. To add a secret to a shared environment, open it for editing from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>), select its **Network secrets** row, then continue from step 2. If you’re on a Team or Enterprise plan and don’t hold an organization admin role, follow step 1 on your own environment, then fill in the shorter form. 1 @@ -96,7 +96,7 @@ Add the secret -Select **Add secret** , labeled **Add** in admin settings, and fill in the form. Keep the default **Secret type** , **Bearer** , for an API key that travels in a request header, and fill in these fields: +Select **Add secret** and fill in the form. Keep the default **Secret type** , **Bearer** , for an API key that travels in a request header, and fill in these fields: * **Allowed websites** : the API’s hosts, such as `api.example.com`. A leading `*.` matches every subdomain * **Custom headers** : one row for the header that carries the key. The row already has `Authorization` as the **Header name** and `Bearer` as the **Prefix** ; paste the key itself as the **Value**. For a header like `X-Api-Key` that takes the bare value, change the name and clear the prefix @@ -166,7 +166,7 @@ ## Network access -Each environment sets one network access level, which controls the outbound connections its sessions can make. A new environment starts at **Limited** with **Allow package managers** checked, so its sessions reach package registries and other allowlisted domains. To change an environment’s network access, open it for editing and use the **Network access** selector in the dialog. A shared environment opens read-only there, so an Owner changes its network access from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>) instead. The control that opens the selector appears on the app surfaces listed under The Default environment and in the [cloud scheduled task editor](</docs/en/routines#environments-and-network-access>). Personal environments don’t have a separate page in your claude.ai account settings. When you change an Anthropic-hosted environment’s network access, its existing sessions follow the new setting within about a minute, for requests that go through the session’s network allowlist. You don’t need to start a new session. +Each environment sets one network access level, which controls the outbound connections its sessions can make. A new environment starts at **Limited** with **Allow package managers** checked, so its sessions reach package registries and other allowlisted domains. To change an environment’s network access, open it for editing and use the **Network access** selector in the dialog. A shared environment opens read-only there, so an Owner changes its network access from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>) instead. The control that opens the selector appears on the app surfaces listed under The Default environment and in the [cloud scheduled task editor](</docs/en/routines#environments-and-network-access>). When you change an Anthropic-hosted environment’s network access, its existing sessions follow the new setting within about a minute, for requests that go through the session’s network allowlist. You don’t need to start a new session. MCP connectors you enable on a session or scheduled task work without adding their hosts to **Allowed domains** , because connector traffic travels through Anthropic’s servers rather than the session’s network. This relies on the same Anthropic-bound channel noted under [Security and isolation](</docs/en/claude-code-on-the-web#security-and-isolation>). Turn off any connector you don’t need to limit which tools Claude can reach. @@ -250,7 +250,7 @@ Your user `~/.claude/CLAUDE.md`| No| Lives on your machine, not in the repo. See Add personal preferences without committing to the repo Your user `~/.claude/skills/`, `~/.claude/agents/`, `~/.claude/commands/`| No| Live on your machine, not in the repo. Commit them to the repo’s `.claude/` directory instead. Cloud sessions automatically load [skills you enable on claude.ai](</docs/en/skills#skills-in-cowork-and-cloud-sessions>) Plugins enabled only in your user settings| No| User-scoped `enabledPlugins` lives in `~/.claude/settings.json` on your machine -MCP servers you added with `claude mcp add` at the default local scope or the user scope| No| Those write to `~/.claude.json` on your machine, not the repo. Add the server with `claude mcp add --scope project`, which writes the repo’s [`.mcp.json`](</docs/en/mcp#project-scope>), and commit that file. A session with one repository loads it +MCP servers you added with `claude mcp add` at the default local scope or the user scope| No| At those scopes, the command writes to `~/.claude.json` on your machine. Run `claude mcp add --scope project` from the repository root to write the repo’s [`.mcp.json`](</docs/en/mcp#project-scope>), and commit that file. A session with one repository loads it Transport variables in your repo’s `.claude/settings.json` `env` block, such as `NODE_EXTRA_CA_CERTS` and the [mTLS client certificate variables](</docs/en/network-config#mtls-authentication>)| No| The hosting environment manages the session’s API connection, so Claude Code ignores these keys and notes each ignored key in the session’s debug log API keys and tokens for services Claude calls| In an Anthropic-hosted environment, as network secrets| You add the key once on the environment and the agent proxy attaches it to requests for the hosts you list. A key the agent proxy can’t attach stays in an environment variable Interactive auth like AWS SSO| No| Not supported. SSO requires browser-based login that can’t run in a cloud session
modified
Show diff (467 lines)
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -13,11 +13,7 @@ [Remote Control](</docs/en/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 +## The Default environment If you don’t have an environment yet, onboarding sets up the **Default** environment. How depends on where you onboard: @@ -37,11 +33,7 @@ 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 +## 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](<https://claude.ai/code>). To reach that screen, complete [web onboarding](</docs/en/web-quickstart>). For the Desktop app, see [Cloud sessions](</docs/en/desktop#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**. @@ -60,11 +52,7 @@ 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 +### 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. @@ -79,19 +67,11 @@ 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`](</docs/en/claude-code-on-the-web#manage-context>), 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 +### 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 +#### Requirements These requirements decide whether you can add a secret and whether the agent proxy can use it once added: @@ -102,11 +82,7 @@ * **API reachability** : the API accepts connections from the internet, because requests leave from Anthropic’s network * **Encryption keys** : if your organization uses customer-managed encryption keys, you can’t save network secrets -#### - -​ - -Add a secret +#### Add a secret You add secrets one at a time. To change a secret’s hosts or value, delete it and add it again. To add a secret to a shared environment, open it for editing from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>), then continue from step 2 in its **Network secrets** section. If you’re on a Team or Enterprise plan and don’t hold an organization admin role, follow step 1 on your own environment, then fill in the shorter form. @@ -135,30 +111,18 @@ To confirm the secret works, start a session in the environment and ask Claude to call the API, for example with `curl`. The API answers as if the key were in the request, and the key doesn’t appear in the session’s environment variables or in any file. If the list marks a secret **Not sent** instead, the note under it says why and what to do. Two secrets whose hosts overlap without matching exactly get no marker, and the agent proxy sends only one of them. -#### - -​ - -Add a secret without an organization admin role +#### Add a secret without an organization admin role If you’re on a Team or Enterprise plan and don’t hold an organization admin role, the **Add secret** form takes one secret for one host. Select your environment’s **Network secrets** row and then **Add secret**. Fill in these fields and select the form’s **Add secret** button: * **Host** : the one host that gets the secret, such as `api.example.com`. The form doesn’t accept a `*.` wildcard * **Secret type** : **Token** for a key that travels in a request header, or **Username and password**. For a token, paste the key in the **Token** field. For a header other than `Authorization`, such as `X-Api-Key`, change **Header** to its name -#### - -​ - -Which requests get the secret +#### Which requests get the secret The agent proxy attaches a secret to a request when the request’s host matches one you listed on that secret. Sessions can reach those hosts even when the environment’s network access level wouldn’t otherwise allow them, except the hosts that never get the secret. The secret applies in every session that runs in the environment, whoever started it, until you delete it. -#### - -​ - -Requests that never get the secret +#### Requests that never get the secret The agent proxy never attaches a secret you add to these requests: @@ -167,19 +131,11 @@ * **Setup script requests** : Claude Code connects to the agent proxy when it launches, after the setup script has run * **Claude Code’s telemetry export** : Claude Code sends its [telemetry export](</docs/en/monitoring-usage#telemetry-from-cloud-sessions-and-claude-tag>) itself rather than through a command it runs, and that request doesn’t go through the agent proxy -### - -​ - -Select an environment from the CLI +### 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`](</docs/en/claude-code-on-the-web#from-terminal-to-cloud>). The command opens a picker of your existing environments and saves your choice to the `remote.defaultEnvironmentId` key in your [user settings](</docs/en/settings#where-settings-live>), 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](</docs/en/settings#settings-precedence>), such as a repo’s project settings. A [self-hosted environment](</docs/en/self-hosted-environments>) ID, which has the form `ccpool_...`, follows a stricter source rule. See [`remote.defaultEnvironmentId`](</docs/en/settings-reference#remote-defaultenvironmentid>) for the settings layers Claude Code honors it from. `/remote-env` only sets the default: it doesn’t start a session, and it can’t add or edit environments. Manage them from the environment selector. -### - -​ - -Archive an environment +### Archive an environment To archive one of your own environments, open it for editing, then select **Archive environment** and confirm. If the environment is shared with your organization, an Owner archives it from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>) instead, so ask an Owner unless you are one. Archiving affects new sessions, not running ones: @@ -192,11 +148,7 @@ When you no longer need an Anthropic-hosted environment, archive it. Neither the environment dialog nor the **Cloud environments** admin page has an option to delete an Anthropic-hosted environment. If the environment is [self-hosted](</docs/en/self-hosted-environments>), an Owner can delete it from the **Cloud environments** page in admin settings. If you aren’t an Owner, ask one to delete it. -### - -​ - -Organization-shared environments +### Organization-shared environments On Team and Enterprise plans, an Owner can create cloud environments that are shared with every member of the organization. The same role manages everything else on the **Cloud environments** admin page, including [self-hosted environments](</docs/en/self-hosted-environments>); the Admin role can’t open the page. The full list of roles that can open it is the one for [managing server-managed settings](</docs/en/server-managed-settings#access-control>). Shared environments appear in each member’s environment selector under an **Organization** heading, after the member’s own environments under **Personal** , so a team can standardize on one configuration instead of each member recreating it. Selecting a shared environment’s settings icon there opens a read-only summary of its configuration for every member, Owners included. An Owner makes an environment available to the organization in one of two ways: @@ -205,32 +157,20 @@ Owners choose the organization’s default environment separately, at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). To give a shared environment’s sessions a key they can’t read, add a network secret when you edit the environment on the **Cloud environments** page. Don’t include secrets in its variables, because every member’s sessions read them. -### - -​ - -Set the environment a Claude Tag channel uses +### Set the environment a Claude Tag channel uses In [Claude Tag](<https://claude.com/docs/claude-tag/overview>) channels, Claude works as your organization’s shared identity, not as any member, so channel sessions use organization-level environments only, either shared environments or [self-hosted environments](</docs/en/self-hosted-environments>). To give a channel a toolchain that isn’t pre-installed, such as .NET, an Owner can create a shared environment from the **Cloud environments** admin page with a setup script that installs it. Point the channel at an environment in one of two ways: * Set a shared or self-hosted environment as the organization’s default environment at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). * [Pin one to a channel](<https://claude.com/docs/claude-tag/admins/troubleshooting#channel-sessions-use-the-wrong-environment-or-can%E2%80%99t-find-one>) in the Claude Tag admin settings. -## - -​ - -Network access +## Network access Each environment sets one network access level, which controls the outbound connections its sessions can make. A new environment starts at **Limited** with **Allow package managers** checked, so its sessions reach package registries and other allowlisted domains. To change an environment’s network access, open it for editing and use the **Network access** selector in the dialog. A shared environment opens read-only there, so an Owner changes its network access from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>) instead. The control that opens the selector appears on the app surfaces listed under The Default environment and in the [cloud scheduled task editor](</docs/en/routines#environments-and-network-access>). Personal environments don’t have a separate page in your claude.ai account settings. When you change an Anthropic-hosted environment’s network access, its existing sessions follow the new setting within about a minute, for requests that go through the session’s network allowlist. You don’t need to start a new session. MCP connectors you enable on a session or scheduled task work without adding their hosts to **Allowed domains** , because connector traffic travels through Anthropic’s servers rather than the session’s network. This relies on the same Anthropic-bound channel noted under [Security and isolation](</docs/en/claude-code-on-the-web#security-and-isolation>). Turn off any connector you don’t need to limit which tools Claude can reach. -### - -​ - -Access levels +### Access levels The **Network access** field in the environment dialog takes one of three levels: @@ -252,11 +192,7 @@ * **Saved as Trusted** : opens as **Limited** with **Allow package managers** checked * **Saved as Custom** : opens as **Limited** with its **Allowed domains** list and **Allow package managers** as you set them, or as **Full** if the list contained a bare `*` -### - -​ - -Allow specific domains +### Allow specific domains To allow domains that aren’t in the default allowlist, select **Limited** in the environment’s **Network access** selector, then list one domain per line in the **Allowed domains** field. A leading `*.` matches every subdomain. This example allows three hosts an internal project might need. @@ -271,11 +207,7 @@ Each environment has its own allowed-domains list; there’s no organization-level allowlist that admins can push to every member’s environments. No [server-managed setting](</docs/en/server-managed-settings>) adds domains to an environment’s network allowlist either. To give a team one standard list, an Owner can create an organization-shared environment with **Limited** network access and that list. -### - -​ - -GitHub proxy +### GitHub proxy In Anthropic-hosted environments, 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. Sessions in a self-hosted environment authenticate git operations with credentials your deployment provides; [Configure git](</docs/en/self-hosted-environments-deploy#configure-git>) covers the options, including per-session minted credentials and an opt-in to this same proxy. The proxy provides: @@ -287,32 +219,20 @@ Committed files from public repositories arrive through `raw.githubusercontent.com`, which the security proxy handles instead. That domain is on the default allowlist, so those files stay reachable as long as the environment’s network access allows that list. -### - -​ - -Security proxy +### Security proxy Cloud sessions in Anthropic-hosted environments run behind an HTTP/HTTPS network proxy for security and abuse prevention purposes; in a [self-hosted environment](</docs/en/self-hosted-environments-deploy#default-deny-egress>), outbound traffic leaves through your own network boundary instead. All outbound internet traffic from an Anthropic-hosted session passes through this proxy, which provides: * Protection against malicious requests * Rate limiting and abuse prevention -## - -​ - -What’s available in cloud sessions +## What’s available in cloud sessions In Anthropic-hosted environments, each session gets a fresh virtual machine (VM) running Ubuntu 24.04 on x86_64, regardless of your own operating system and CPU architecture, with your repository cloned and common toolchains pre-installed. When a dependency provides precompiled binaries, such as Ruby gems with native extensions or prebuilt Python wheels, use its x86_64 Linux build to match the VM. This section covers the Anthropic-hosted defaults, the built-in GitHub tools, how to run tests and services, the resource limits each VM gets, and the time limits on long-running work. Sessions your organization routes to a [self-hosted environment](</docs/en/self-hosted-environments>) run on your own runners instead, with the tools your runner image provides. -### - -​ - -What carries over from your setup +### What carries over from your setup Of the repository configuration in this table, a cloud thread in a [project](</docs/en/claude-projects>) loads only the repository root’s `CLAUDE.md`, `.claude/CLAUDE.md`, and `.claude/rules/` files that aren’t [path-specific](</docs/en/memory#path-specific-rules>). See [What threads pick up from your repositories](</docs/en/claude-projects#what-threads-pick-up-from-your-repositories>). @@ -337,11 +257,7 @@ To make your own configuration available in cloud sessions, commit it to the repo. Anyone who uses the environment can read its environment variables and setup script. The dialog’s note under **Environment variables** says so and warns against putting secrets there. In an Anthropic-hosted environment, store a key the agent proxy can attach as a network secret instead. -#### - -​ - -Add personal preferences without committing to the repo +#### Add personal preferences without committing to the repo In an Anthropic-hosted environment, add a setup script that writes `~/.claude/CLAUDE.md` for preferences you’d rather not put in a shared repository. Claude Code loads that file as [user instructions](</docs/en/memory#choose-where-to-put-claude-md-files>) in the session. This example sets a commit-message preference: @@ -353,11 +269,7 @@ Put the script on one of your own environments rather than a shared one. Run `/context` in your next cloud session and confirm `/root/.claude/CLAUDE.md` appears under **Memory files**. -### - -​ - -Installed tools +### Installed tools Cloud sessions come with common language runtimes, build tools, and databases pre-installed. The table below summarizes what’s included by category. @@ -378,11 +290,7 @@ ¹ Bun is installed but has known proxy compatibility issues for package fetching. To get the versions of most of the tools in this table, ask Claude to run `check-tools` in a cloud session. It’s a shell command installed on the session VM, not a command you type with `/`; you ask Claude because Claude runs all VM commands for you. For a tool it doesn’t report, such as Ruby, PHP, bun, PostgreSQL, or Redis, ask Claude to run the tool’s own version command, for example `psql --version`. Node.js versions are installed at `/opt/node20`, `/opt/node21`, and `/opt/node22`, with 22 on `PATH` by default. To work with a different version, ask Claude to prepend that version’s `bin` directory, such as `/opt/node20/bin`, to `PATH`. 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 +### 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](</docs/en/claude-code-on-the-web#github-authentication-options>), so your token never enters the container. You can set `GH_TOKEN` or `GITHUB_TOKEN` yourself in environment settings, or leave both unset and let the GitHub proxy authenticate for you: @@ -391,37 +299,21 @@ A token you set is an ordinary environment variable, so anyone who uses the environment can read it; the proxy path keeps the credential out of the environment configuration and the session VM. To check which case applies to your session, ask Claude to run `echo $GH_TOKEN`. GitHub’s [`gh` CLI](<https://cli.github.com>) is pre-installed. If you need a GitHub operation the built-in tools don’t cover, ask Claude to call the REST API with `gh api`. `gh` subcommands that use the REST API, such as `gh workflow list`, work too. The proxy rejects subcommands that use GraphQL, such as `gh pr` and `gh issue`. `gh` reads `GH_TOKEN` automatically, so you don’t need to run `gh auth login`. -### - -​ - -Link output back to the session +### 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 the `CLAUDE_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. To omit the trailer and the PR-body link, set [`attribution.sessionUrl`](</docs/en/settings-reference#attribution-sessionurl>) to `false`. 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: echo "https://claude.ai/code/${CLAUDE_CODE_REMOTE_SESSION_ID/#cse_/session_}" -### - -​ - -Run tests, start services, and add packages +### 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 +#### Run tests Claude runs tests as part of working on a task. Ask for it in your prompt, like “fix the failing tests in `tests/`” 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 +#### 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: @@ -431,19 +323,11 @@ Docker is available for running containerized services. Ask Claude to run `docker compose up` to start your project’s services. Network access to pull images follows your environment’s access level, and the default allowlist includes 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 +#### 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 +### Resource limits Cloud sessions in Anthropic-hosted environments run with approximate resource ceilings that may change over time: @@ -453,11 +337,7 @@ The VM may stop tasks that need significantly more memory, such as large build jobs or memory-intensive tests. For workloads beyond these limits, use [Remote Control](</docs/en/remote-control>) to run Claude Code on your own hardware, or run cloud sessions in a [self-hosted environment](</docs/en/self-hosted-environments>) on compute your organization operates. -### - -​ - -Time limits +### Time limits In Anthropic-hosted environments, these time limits apply to long-running work in a cloud session, such as a build, an install, or a test run. Each entry links to the section that defines the limit. @@ -468,30 +348,18 @@ To raise the command timeouts for an environment’s sessions, add [`BASH_DEFAULT_TIMEOUT_MS` and `BASH_MAX_TIMEOUT_MS`](</docs/en/env-vars#variables>) to its environment variables. Both take milliseconds. For example, `BASH_DEFAULT_TIMEOUT_MS=600000` makes 10 minutes the default. -## - -​ - -Setup scripts +## 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, so `apt install` and most language package managers work. -### - -​ - -Add a setup script +### Add a setup script To add a setup script to your own environment, you can type or paste it, or load a text file such as `setup.sh`. Add or edit the environment and select the **Setup script** row. Enter the script in the box that opens, or select **Choose file** to replace the box’s contents with the text of a file up to 64 KB. Then select **Add environment** or **Save changes**. This example installs [ShellCheck](<https://www.shellcheck.net/>), which isn’t pre-installed. #!/bin/bash apt update && apt install -y shellcheck -### - -​ - -Script requirements +### Script requirements A setup script has four constraints to write around: @@ -500,19 +368,11 @@ * **Network access for installs** : package installs need to reach registries. The default **Limited** level with **Allow package managers** checked covers common package registries including npm, PyPI, RubyGems, and crates.io. With **None** network access, installs fail. * **The environment’s variables aren’t set yet** : the script runs before the session sets the environment’s environment variables. Set any value the script needs in the script itself. -### - -​ - -Environment caching +### Environment caching The setup script runs the first time you start a session in an environment. When setup completes within roughly five minutes, 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. If setup takes longer than roughly five minutes, the environment isn’t cached. 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, a `docker 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. In an Anthropic-hosted environment, the setup script doesn’t run when a session’s VM is restored after being idle, so a change to the script reaches an existing session only when its VM was [reclaimed](</docs/en/claude-code-on-the-web#environment-expired>) and is rebuilt. To apply a change right away, run the commands in the session or start a new session. You don’t need to enable caching or manage snapshots yourself. -### - -​ - -Setup scripts vs. SessionStart hooks +### 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](</docs/en/hooks#sessionstart>) for project setup that should run everywhere, cloud and local, like `npm install`. Setup scripts and SessionStart hooks run in a fixed order when a cloud session starts. The table compares where you configure them, when they run, and where they run. @@ -527,11 +387,7 @@ * **Anthropic-hosted environment** : Claude Code runs hooks from your organization’s [server-managed settings](</docs/en/server-managed-settings>) and, outside a [project](</docs/en/claude-projects#what-threads-pick-up-from-your-repositories>) thread, from the repository. [Claude Tag](<https://claude.com/docs/claude-tag/overview>) sessions don’t receive server-managed settings, so hooks from server-managed settings don’t run there. * **[Self-hosted environment](</docs/en/self-hosted-environments-configuration#permissions-and-tool-approval>)** : Claude Code also runs the hooks the operator seeded from the runner host’s `~/.claude/`, and the hooks in the runner image’s managed settings file when that file is one of the [managed sources Claude Code applies](</docs/en/managed-settings#how-claude-code-combines-managed-sources>). -### - -​ - -Install dependencies with a SessionStart hook +### Install dependencies with a SessionStart hook To install dependencies only in cloud sessions outside a [project](</docs/en/claude-projects#what-threads-pick-up-from-your-repositories>)’s threads, 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: @@ -578,11 +434,7 @@ If `npm install` reads other files, such as a workspace’s `package.json`, an `.npmrc`, or your `postinstall` script’s inputs, add them to the `sha256sum` command that saves the hashes. Otherwise, you keep the old packages after one of those files changes. -#### - -​ - -Limitations in cloud sessions +#### Limitations in cloud sessions SessionStart hooks behave the same in the cloud as locally, with these caveats: @@ -595,11 +447,7 @@ 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 +## Default allowed domains When **Allow package managers** is checked under **Limited** network access, as it is in a new environment, sessions can reach the following domains. Domains marked with `*` indicate wildcard subdomain matching, so `*.gcr.io` allows any subdomain of `gcr.io`. @@ -858,11 +706,7 @@ * *.modelcontextprotocol.io -## - -​ - -Related resources +## Related resources * [Cloud sessions reference](</docs/en/claude-code-on-the-web>): start, manage, and share cloud sessions * [Cloud sessions quickstart](</docs/en/web-quickstart>): connect GitHub and start your first cloud session
modified
Show diff (124 lines)
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -27,7 +27,7 @@ **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. + * **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: @@ -98,7 +98,7 @@ * **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 Admins don’t, which changes what you see in these cases: * **Your own environment** : without an organization admin role, **Add secret** opens a shorter form * **A shared environment** : Owners add and delete its secrets from admin settings. Without an organization admin role, ask an Owner to add the secret, because the environment’s dialog has no **Network secrets** section - * **Environment type** : an Anthropic-hosted cloud environment that already exists. A [self-hosted environment](</docs/en/self-hosted-environments>) doesn’t have network secrets + * **Environment type** : an Anthropic-hosted cloud environment. A [self-hosted environment](</docs/en/self-hosted-environments>) doesn’t have network secrets * **API reachability** : the API accepts connections from the internet, because requests leave from Anthropic’s network * **Encryption keys** : if your organization uses customer-managed encryption keys, you can’t save network secrets @@ -222,7 +222,7 @@ 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. A shared environment opens read-only there, so an Owner changes its network access from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>) instead. The control that opens the selector appears on the app surfaces listed under The Default environment and in the [cloud scheduled task editor](</docs/en/routines#environments-and-network-access>). Personal environments don’t have a separate page in your claude.ai account settings. When you change an Anthropic-hosted environment’s network access, its existing sessions follow the new setting within about a minute, for requests that go through the session’s network allowlist. You don’t need to start a new session. +Each environment sets one network access level, which controls the outbound connections its sessions can make. A new environment starts at **Limited** with **Allow package managers** checked, so its sessions reach package registries and other allowlisted domains. To change an environment’s network access, open it for editing and use the **Network access** selector in the dialog. A shared environment opens read-only there, so an Owner changes its network access from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>) instead. The control that opens the selector appears on the app surfaces listed under The Default environment and in the [cloud scheduled task editor](</docs/en/routines#environments-and-network-access>). Personal environments don’t have a separate page in your claude.ai account settings. When you change an Anthropic-hosted environment’s network access, its existing sessions follow the new setting within about a minute, for requests that go through the session’s network allowlist. You don’t need to start a new session. MCP connectors you enable on a session or scheduled task work without adding their hosts to **Allowed domains** , because connector traffic travels through Anthropic’s servers rather than the session’s network. This relies on the same Anthropic-bound channel noted under [Security and isolation](</docs/en/claude-code-on-the-web#security-and-isolation>). Turn off any connector you don’t need to limit which tools Claude can reach. @@ -232,14 +232,13 @@ Access levels -The **Network access** field in the environment dialog takes one of four levels: +The **Network access** field in the environment dialog takes one of three levels: Level| Outbound connections ---|--- **None**| No outbound network access through the session’s network -**Trusted**| Allowlisted domains only: package registries, GitHub, cloud SDKs +**Limited**| The default allowlist of package registries, GitHub, and cloud SDKs while **Allow package managers** is checked, plus any domains you list. See [what a blocked request looks like](</docs/en/errors#host-not-allowed-in-a-cloud-session>). **Full**| Any domain -**Custom**| Your own allowlist, optionally including the defaults Whichever level you pick, sessions can still reach these, because each one takes a path that doesn’t go through the session’s network allowlist: @@ -248,24 +247,29 @@ * The hosts you listed on the environment’s network secrets, except the hosts that never get the secret * The Anthropic API, for Claude Code’s own requests, even at **None** , as noted under [Security and isolation](</docs/en/claude-code-on-the-web#security-and-isolation>) +An environment saved as **Trusted** or **Custom** keeps reaching the same hosts and opens this way: + + * **Saved as Trusted** : opens as **Limited** with **Allow package managers** checked + * **Saved as Custom** : opens as **Limited** with its **Allowed domains** list and **Allow package managers** as you set them, or as **Full** if the list contained a bare `*` + ### ​ 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. +To allow domains that aren’t in the default allowlist, select **Limited** in the environment’s **Network access** selector, then list one domain per line in the **Allowed domains** field. A leading `*.` matches every subdomain. This example allows three hosts an internal project might need. api.example.com *.internal.example.com registry.example.com -Sessions in this environment can now reach `api.example.com`, any subdomain of `internal.example.com`, and `registry.example.com`, and no other domains through the session’s network. GitHub traffic, MCP connector traffic, and requests to the hosts of the environment’s network secrets, other than the hosts that never get the secret, 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. If your organization uses [artifacts](</docs/en/artifacts#availability>), you don’t need `*.frame.claudeusercontent.com` in the list for sessions to read them. When the list leaves that host out, Claude Code reads artifact content through the session’s connection to Anthropic instead. Keep the host in an allowlist in two situations: +While **Allow package managers** is checked, sessions in this environment reach the default allowlist as well as the domains you list. Clear the checkbox to leave the default allowlist out. GitHub traffic, MCP connector traffic, and requests to the hosts of the environment’s network secrets, other than the hosts that never get the secret, don’t go through this allowlist. If your organization uses [artifacts](</docs/en/artifacts#availability>), you don’t need `*.frame.claudeusercontent.com` in the list for sessions to read them. When the list leaves that host out, Claude Code reads artifact content through the session’s connection to Anthropic instead. Keep the host in an allowlist in two situations: * **Sessions in this environment open another organization’s public artifacts** : Claude Code fetches those from the host directly, so add it to this list. * **You’re configuring the local CLI or a self-hosted runner** : keep the host in that allowlist. See [network access requirements](</docs/en/network-config#network-access-requirements>) and the self-hosted [network requirements](</docs/en/self-hosted-environments-deploy#network-requirements>). -Each environment has its own allowed-domains list; there’s no organization-level allowlist that admins can push to every member’s environments. No [server-managed setting](</docs/en/server-managed-settings>) adds domains to an environment’s network allowlist either. To give a team one standard list, an Owner can create an organization-shared environment with **Custom** network access and that list. +Each environment has its own allowed-domains list; there’s no organization-level allowlist that admins can push to every member’s environments. No [server-managed setting](</docs/en/server-managed-settings>) adds domains to an environment’s network allowlist either. To give a team one standard list, an Owner can create an organization-shared environment with **Limited** network access and that list. ### @@ -281,7 +285,7 @@ * **Repository scope** : the proxy serves GitHub API requests for the repositories attached to the session. An API request for another repository gets a 403 whose message starts with `GitHub access to` and contains `is not enabled for this session`. A source archive you fetch over a `github.com/{owner}/{repo}/archive/` or `codeload.github.com` URL gets that same 403 when the repository isn’t attached, even a public one. * **GraphQL restrictions** : the proxy rejects requests to GitHub’s GraphQL endpoint with a 403 whose message starts with `GitHub GraphQL is not available from Claude Code sessions` and names the REST fallback, `gh api repos/{owner}/{repo}/...`. `gh` subcommands that use GraphQL, such as `gh pr` and `gh issue`, get the same 403. The restriction applies to every request through the proxy regardless of the credentials you supply, so a `GH_TOKEN` you set gets the same 403. Claude can’t reach GitHub APIs that exist only in GraphQL, such as Projects v2, through the proxy. -Committed files from public repositories arrive through `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. +Committed files from public repositories arrive through `raw.githubusercontent.com`, which the security proxy handles instead. That domain is on the default allowlist, so those files stay reachable as long as the environment’s network access allows that list. ### @@ -425,7 +429,7 @@ service redis-server start -Docker is available for running containerized services. Ask Claude to run `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. +Docker is available for running containerized services. Ask Claude to run `docker compose up` to start your project’s services. Network access to pull images follows your environment’s access level, and the default allowlist includes 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. #### @@ -493,7 +497,7 @@ * **Exit zero** : if the script exits non-zero, the session [fails to start](</docs/en/web-quickstart#setup-script-failed>) or starts without whatever the script failed to install. Append `|| true` to non-critical commands so an intermittent install failure doesn’t fail the script. * **Finish within five minutes** : keep the script’s total runtime under roughly five minutes so the environment cache can build. When setup takes longer than that, the environment isn’t cached. Run independent installs in parallel with `&` and `wait`, and move any single download that won’t fit into a SessionStart hook that launches it in the background. If new sessions stall or fail during setup, see [New sessions hang or time out during setup](</docs/en/web-quickstart#new-sessions-hang-or-time-out-during-setup>). - * **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. + * **Network access for installs** : package installs need to reach registries. The default **Limited** level with **Allow package managers** checked covers common package registries including npm, PyPI, RubyGems, and crates.io. With **None** network access, installs fail. * **The environment’s variables aren’t set yet** : the script runs before the session sets the environment’s environment variables. Set any value the script needs in the script itself. ### @@ -585,7 +589,7 @@ * **One repository per session** : in an Anthropic-hosted environment, a session with several repositories doesn’t load hooks from any repository’s `.claude/settings.json`, so a SessionStart hook you define there doesn’t run. Install dependencies for those sessions with a setup script instead. For a self-hosted environment, see [which repository’s settings apply](</docs/en/self-hosted-environments-configuration#repository-settings-in-sessions-with-several-repositories>). * **Not in a project’s cloud threads** : a cloud thread in a [project](</docs/en/claude-projects#what-threads-pick-up-from-your-repositories>) doesn’t run hooks from a repository’s `.claude/settings.json`, whatever the number of repositories. In an Anthropic-hosted environment, install dependencies for threads with a setup script. In a self-hosted environment, use a hook in the [runner host’s settings](</docs/en/self-hosted-environments-configuration#repository-settings-in-sessions-with-several-repositories>) instead. * **No cloud-only scoping** : hooks run in both local and cloud sessions. To skip local execution, exit early unless the `CLAUDE_CODE_REMOTE` environment variable is `true`, the way the dependency install script does. - * **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. + * **Requires network access** : install commands need to reach package registries. If your environment uses **None** network access, these hooks fail. Under the default **Limited** level with **Allow package managers** checked, the default allowlist covers npm, PyPI, RubyGems, and crates.io. * **Proxy compatibility** : in Anthropic-hosted environments, all outbound traffic passes through a security proxy, and some package managers don’t work correctly with it; Bun is a known example. In a [self-hosted environment](</docs/en/self-hosted-environments-deploy#default-deny-egress>), outbound traffic goes through your own network boundary instead. * **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 skipping work that’s already done, the way the dependency install script does. @@ -597,7 +601,7 @@ 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`. +When **Allow package managers** is checked under **Limited** network access, as it is in a new environment, sessions can reach the following domains. Domains marked with `*` indicate wildcard subdomain matching, so `*.gcr.io` allows any subdomain of `gcr.io`. Anthropic services
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -122,9 +122,8 @@ Select **Add secret** , labeled **Add** in admin settings, and fill in the form. Keep the default **Secret type** , **Bearer** , for an API key that travels in a request header, and fill in these fields: - * **Name** : a label for the secret, such as `Internal billing API` * **Allowed websites** : the API’s hosts, such as `api.example.com`. A leading `*.` matches every subdomain - * **Custom headers** : one row for the header that carries the key. The row starts with `Authorization` as the header’s **Name** and `Bearer` as its **Prefix** ; paste the key itself as the **Value**. For a header like `X-Api-Key` that takes the bare value, change the name and clear the prefix + * **Custom headers** : one row for the header that carries the key. The row already has `Authorization` as the **Header name** and `Bearer` as the **Prefix** ; paste the key itself as the **Value**. For a header like `X-Api-Key` that takes the bare value, change the name and clear the prefix For an API that authenticates another way, pick a different **Secret type**. The list is the same one [Claude Tag](<https://claude.com/docs/claude-tag/overview>), the Slack integration for Team and Enterprise plans, offers for [connections](<https://claude.com/docs/claude-tag/admins/add-connections>). @@ -145,8 +144,7 @@ If you’re on a Team or Enterprise plan and don’t hold an organization admin role, the **Add secret** form takes one secret for one host. Select your environment’s **Network secrets** row and then **Add secret**. Fill in these fields and select the form’s **Add secret** button: * **Host** : the one host that gets the secret, such as `api.example.com`. The form doesn’t accept a `*.` wildcard - * **Name** : an optional label for the secret - * **Secret type** : **Token** for a key that travels in a request header, or **Username and password**. For a token, paste the key as the **Value** + * **Secret type** : **Token** for a key that travels in a request header, or **Username and password**. For a token, paste the key in the **Token** field. For a header other than `Authorization`, such as `X-Api-Key`, change **Header** to its name #### @@ -493,7 +491,7 @@ A setup script has four constraints to write around: - * **Exit zero** : if the script exits non-zero, the session fails to start. Append `|| true` to non-critical commands so an intermittent install failure doesn’t block the session. + * **Exit zero** : if the script exits non-zero, the session [fails to start](</docs/en/web-quickstart#setup-script-failed>) or starts without whatever the script failed to install. Append `|| true` to non-critical commands so an intermittent install failure doesn’t fail the script. * **Finish within five minutes** : keep the script’s total runtime under roughly five minutes so the environment cache can build. When setup takes longer than that, the environment isn’t cached. Run independent installs in parallel with `&` and `wait`, and move any single download that won’t fit into a SessionStart hook that launches it in the background. If new sessions stall or fail during setup, see [New sessions hang or time out during setup](</docs/en/web-quickstart#new-sessions-hang-or-time-out-during-setup>). * **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. * **The environment’s variables aren’t set yet** : the script runs before the session sets the environment’s environment variables. Set any value the script needs in the script itself.
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -371,6 +371,7 @@ **C/C++**| GCC, Clang, cmake, ninja, conan **Docker**| docker, dockerd, docker compose **Databases**| PostgreSQL 16, Redis 7.0 +**Browser**| Chrome for Testing at `/usr/bin/google-chrome`, with the `CHROME_PATH` environment variable set to that path **Utilities**| git, gh, jq, yq, ripgrep, tmux, vim, nano ¹ Bun is installed but has known proxy compatibility issues for package fetching. To get the versions of most of the tools in this table, ask Claude to run `check-tools` in a cloud session. It’s a shell command installed on the session VM, not a command you type with `/`; you ask Claude because Claude runs all VM commands for you. For a tool it doesn’t report, such as Ruby, PHP, bun, PostgreSQL, or Redis, ask Claude to run the tool’s own version command, for example `psql --version`. Node.js versions are installed at `/opt/node20`, `/opt/node21`, and `/opt/node22`, with 22 on `PATH` by default. To work with a different version, ask Claude to prepend that version’s `bin` directory, such as `/opt/node20/bin`, to `PATH`. 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.
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -1,4 +1,4 @@ -Cloud environments apply to [cloud sessions](</docs/en/claude-code-on-the-web>), which are available on Pro, Max, and Team plans, and for Enterprise users with [premium seats or Chat + Claude Code seats](<https://support.claude.com/en/articles/11845131-use-claude-code-with-your-team-or-enterprise-plan>). +Cloud environments apply to [cloud sessions](</docs/en/claude-code-on-the-web>), which are available on Pro, Max, Ultra, and Team plans, and for Enterprise users with [premium seats or Chat + Claude Code seats](<https://support.claude.com/en/articles/11845131-use-claude-code-with-your-team-or-enterprise-plan>). Each [cloud session](</docs/en/claude-code-on-the-web>) 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: @@ -22,7 +22,7 @@ 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 and Max** : creates **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](</docs/en/claude-code-on-the-web#quick-setup-for-team-and-enterprise>); keep the form’s defaults and click **Create & finish** to get the same **Default** environment **Default** carries no configuration of its own: @@ -85,7 +85,7 @@ 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, Team, and Enterprise plans. To check whether you can add one yourself, see Requirements. +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. ####
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -11,7 +11,7 @@ Each of these surfaces can also route to a [self-hosted environment](</docs/en/self-hosted-environments>). [Availability and limitations](</docs/en/self-hosted-environments#availability-and-limitations>) covers what Claude can’t use yet when a Claude Tag session runs in one. -[Remote Control](</docs/en/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. Claude Tag channel sessions use organization-level environments only, either shared environments or [self-hosted environments](</docs/en/self-hosted-environments>). +[Remote Control](</docs/en/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. ##
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -95,10 +95,9 @@ These requirements decide whether you can add a secret and whether the agent proxy can use it once added: - * **Role** : on Pro, Max, and Team plans, 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 Admins don’t, which changes what you see in these cases: - * **Your own environment on Enterprise** : with an organization admin role, you add and delete secrets. Without it, the **Network secrets** row opens the secrets list with the note “Only an organization admin can add or delete network secrets” and no **Add secret** or delete button. Ask an Owner to add the secret to a shared environment, then run your sessions there + * **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 Admins don’t, which changes what you see in these cases: + * **Your own environment** : without an organization admin role, **Add secret** opens a shorter form * **A shared environment** : Owners add and delete its secrets from admin settings. Without an organization admin role, ask an Owner to add the secret, because the environment’s dialog has no **Network secrets** section - * **Your own environment on Team** : without an organization admin role, **Add secret** opens a shorter form that takes one host * **Environment type** : an Anthropic-hosted cloud environment that already exists. A [self-hosted environment](</docs/en/self-hosted-environments>) doesn’t have network secrets * **API reachability** : the API accepts connections from the internet, because requests leave from Anthropic’s network * **Encryption keys** : if your organization uses customer-managed encryption keys, you can’t save network secrets @@ -109,7 +108,7 @@ Add a secret -You add secrets one at a time. To change a secret’s hosts or value, delete it and add it again. To add a secret to a shared environment, open it for editing from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>), then continue from step 2 in its **Network secrets** section. If you’re on a Team plan and don’t hold an organization admin role, follow step 1 on your own environment, then fill in the shorter form. +You add secrets one at a time. To change a secret’s hosts or value, delete it and add it again. To add a secret to a shared environment, open it for editing from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>), then continue from step 2 in its **Network secrets** section. If you’re on a Team or Enterprise plan and don’t hold an organization admin role, follow step 1 on your own environment, then fill in the shorter form. 1 @@ -141,9 +140,9 @@ ​ -Add a secret on a Team plan without an organization admin role - -If you’re on a Team plan and don’t hold an organization admin role, the **Add secret** form takes one secret for one host. Select your environment’s **Network secrets** row and then **Add secret**. Fill in these fields and select the form’s **Add secret** button: +Add a secret without an organization admin role + +If you’re on a Team or Enterprise plan and don’t hold an organization admin role, the **Add secret** form takes one secret for one host. Select your environment’s **Network secrets** row and then **Add secret**. Fill in these fields and select the form’s **Add secret** button: * **Host** : the one host that gets the secret, such as `api.example.com`. The form doesn’t accept a `*.` wildcard * **Name** : an optional label for the secret
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -109,7 +109,7 @@ Add a secret -You add secrets one at a time, and you can’t edit a secret after you add it. To change a secret’s hosts or value, delete it and add it again. To add a secret to a shared environment, open it for editing from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>), then continue from step 2 in its **Network secrets** section. If you’re on a Team plan and don’t hold an organization admin role, follow step 1 on your own environment, then fill in the shorter form. +You add secrets one at a time. To change a secret’s hosts or value, delete it and add it again. To add a secret to a shared environment, open it for editing from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>), then continue from step 2 in its **Network secrets** section. If you’re on a Team plan and don’t hold an organization admin role, follow step 1 on your own environment, then fill in the shorter form. 1 @@ -121,7 +121,7 @@ Add the secret -Select **Add secret** and fill in the form. Keep the default **Secret type** , **Bearer** , for an API key that travels in a request header, and fill in these fields: +Select **Add secret** , labeled **Add** in admin settings, and fill in the form. Keep the default **Secret type** , **Bearer** , for an API key that travels in a request header, and fill in these fields: * **Name** : a label for the secret, such as `Internal billing API` * **Allowed websites** : the API’s hosts, such as `api.example.com`. A leading `*.` matches every subdomain @@ -491,11 +491,12 @@ Script requirements -A setup script has three constraints to write around: +A setup script has four constraints to write around: * **Exit zero** : if the script exits non-zero, the session fails to start. Append `|| true` to 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. When setup takes longer than that, the environment isn’t cached. Run independent installs in parallel with `&` and `wait`, and move any single download that won’t fit into a SessionStart hook that launches it in the background. If new sessions stall or fail during setup, see [New sessions hang or time out during setup](</docs/en/web-quickstart#new-sessions-hang-or-time-out-during-setup>). * **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. + * **The environment’s variables aren’t set yet** : the script runs before the session sets the environment’s environment variables. Set any value the script needs in the script itself. ###
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -58,7 +58,7 @@ * **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. -The dialog includes the name, network access level, environment variables, and setup script. To store a key that sessions use without seeing it, see Add network secrets. +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. ### @@ -96,7 +96,7 @@ These requirements decide whether you can add a secret and whether the agent proxy can use it once added: * **Role** : on Pro, Max, and Team plans, 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 Admins don’t, which changes what you see in these cases: - * **Your own environment on Enterprise** : with an organization admin role, you add and delete secrets. Without it, the **Network secrets** section lists the secrets under the note “Only an organization admin can add or delete network secrets”, with no **Add secret** or delete button. Ask an Owner to add the secret to a shared environment, then run your sessions there + * **Your own environment on Enterprise** : with an organization admin role, you add and delete secrets. Without it, the **Network secrets** row opens the secrets list with the note “Only an organization admin can add or delete network secrets” and no **Add secret** or delete button. Ask an Owner to add the secret to a shared environment, then run your sessions there * **A shared environment** : Owners add and delete its secrets from admin settings. Without an organization admin role, ask an Owner to add the secret, because the environment’s dialog has no **Network secrets** section * **Your own environment on Team** : without an organization admin role, **Add secret** opens a shorter form that takes one host * **Environment type** : an Anthropic-hosted cloud environment that already exists. A [self-hosted environment](</docs/en/self-hosted-environments>) doesn’t have network secrets @@ -109,13 +109,13 @@ Add a secret -You add secrets one at a time, and you can’t edit a secret after you add it. To change a secret’s hosts or value, delete it and add it again. To add a secret to a shared environment, open it for editing from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>), then continue step 1 from the **Network secrets** section. If you’re on a Team plan and don’t hold an organization admin role, follow step 1 on your own environment, then fill in the shorter form. +You add secrets one at a time, and you can’t edit a secret after you add it. To change a secret’s hosts or value, delete it and add it again. To add a secret to a shared environment, open it for editing from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>), then continue from step 2 in its **Network secrets** section. If you’re on a Team plan and don’t hold an organization admin role, follow step 1 on your own environment, then fill in the shorter form. 1 Open the environment's network secrets -Open the environment for editing at [claude.ai/code](<https://claude.ai/code>). In the **Edit cloud environment** dialog, find the **Network secrets** section. You see the secrets already on the environment, each with the hosts it applies to. +Open the environment for editing at [claude.ai/code](<https://claude.ai/code>). In the **Edit cloud environment** dialog, select the **Network secrets** row. You see the secrets already on the environment, each with the hosts it applies to. 2 @@ -143,7 +143,7 @@ Add a secret on a Team plan without an organization admin role -If you’re on a Team plan and don’t hold an organization admin role, the **Add secret** form takes one secret for one host. Select **Add secret** in your environment’s **Network secrets** section, fill in these fields, then select the form’s **Add secret** button: +If you’re on a Team plan and don’t hold an organization admin role, the **Add secret** form takes one secret for one host. Select your environment’s **Network secrets** row and then **Add secret**. Fill in these fields and select the form’s **Add secret** button: * **Host** : the one host that gets the secret, such as `api.example.com`. The form doesn’t accept a `*.` wildcard * **Name** : an optional label for the secret @@ -472,7 +472,15 @@ 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, so `apt 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 [ShellCheck](<https://www.shellcheck.net/>), which isn’t pre-installed. +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, so `apt install` and most language package managers work. + +### + +​ + +Add a setup script + +To add a setup script to your own environment, you can type or paste it, or load a text file such as `setup.sh`. Add or edit the environment and select the **Setup script** row. Enter the script in the box that opens, or select **Choose file** to replace the box’s contents with the text of a file up to 64 KB. Then select **Add environment** or **Save changes**. This example installs [ShellCheck](<https://www.shellcheck.net/>), which isn’t pre-installed. #!/bin/bash apt update && apt install -y shellcheck
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -184,7 +184,7 @@ Archive an environment -To archive one of your own environments, open it for editing, select **Archive environment** , and confirm. If the environment is shared with your organization, an Owner archives it from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>) instead, so ask an Owner unless you are one. You can’t delete an environment, only archive it. Archiving affects new sessions, not running ones: +To archive one of your own environments, open it for editing, then select **Archive environment** and confirm. If the environment is shared with your organization, an Owner archives it from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>) instead, so ask an Owner unless you are one. 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. @@ -192,6 +192,8 @@ * No new session can start in an archived environment, on any surface: * **Saved CLI default** : if the environment was your saved CLI default, Claude Code starts CLI cloud sessions in the Anthropic-hosted environment when your list has one. Otherwise, it starts them in the first environment in your list that isn’t a Remote Control bridge environment. * **Configured explicitly** : anything configured with the environment explicitly, such as a [cloud scheduled task](</docs/en/routines#environments-and-network-access>), can’t start new sessions in it. Point it at another environment. + +When you no longer need an Anthropic-hosted environment, archive it. Neither the environment dialog nor the **Cloud environments** admin page has an option to delete an Anthropic-hosted environment. If the environment is [self-hosted](</docs/en/self-hosted-environments>), an Owner can delete it from the **Cloud environments** page in admin settings. If you aren’t an Owner, ask one to delete it. ### @@ -520,7 +522,7 @@ Install dependencies with a SessionStart hook -To install dependencies only in cloud sessions outside a [project](</docs/en/claude-projects#what-threads-pick-up-from-your-repositories>), 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: +To install dependencies only in cloud sessions outside a [project](</docs/en/claude-projects#what-threads-pick-up-from-your-repositories>)’s threads, 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: { "hooks": {
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -310,6 +310,8 @@ ​ What carries over from your setup + +Of the repository configuration in this table, a cloud thread in a [project](</docs/en/claude-projects>) loads only the repository root’s `CLAUDE.md`, `.claude/CLAUDE.md`, and `.claude/rules/` files that aren’t [path-specific](</docs/en/memory#path-specific-rules>). See [What threads pick up from your repositories](</docs/en/claude-projects#what-threads-pick-up-from-your-repositories>). 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](</docs/en/server-managed-settings>). @@ -509,7 +511,7 @@ If you have SessionStart hooks in your user-level `~/.claude/settings.json`, don’t expect them in the cloud. User-level settings stay on your machine. Which other hooks run depends on where the session runs: - * **Anthropic-hosted environment** : Claude Code runs hooks from the repository and from your organization’s [server-managed settings](</docs/en/server-managed-settings>). [Claude Tag](<https://claude.com/docs/claude-tag/overview>) sessions don’t receive server-managed settings, so hooks from server-managed settings don’t run there. + * **Anthropic-hosted environment** : Claude Code runs hooks from your organization’s [server-managed settings](</docs/en/server-managed-settings>) and, outside a [project](</docs/en/claude-projects#what-threads-pick-up-from-your-repositories>) thread, from the repository. [Claude Tag](<https://claude.com/docs/claude-tag/overview>) sessions don’t receive server-managed settings, so hooks from server-managed settings don’t run there. * **[Self-hosted environment](</docs/en/self-hosted-environments-configuration#permissions-and-tool-approval>)** : Claude Code also runs the hooks the operator seeded from the runner host’s `~/.claude/`, and the hooks in the runner image’s managed settings file when that file is one of the [managed sources Claude Code applies](</docs/en/managed-settings#how-claude-code-combines-managed-sources>). ### @@ -518,7 +520,7 @@ 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: +To install dependencies only in cloud sessions outside a [project](</docs/en/claude-projects#what-threads-pick-up-from-your-repositories>), 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: { "hooks": { @@ -572,6 +574,7 @@ SessionStart hooks behave the same in the cloud as locally, with these caveats: * **One repository per session** : in an Anthropic-hosted environment, a session with several repositories doesn’t load hooks from any repository’s `.claude/settings.json`, so a SessionStart hook you define there doesn’t run. Install dependencies for those sessions with a setup script instead. For a self-hosted environment, see [which repository’s settings apply](</docs/en/self-hosted-environments-configuration#repository-settings-in-sessions-with-several-repositories>). + * **Not in a project’s cloud threads** : a cloud thread in a [project](</docs/en/claude-projects#what-threads-pick-up-from-your-repositories>) doesn’t run hooks from a repository’s `.claude/settings.json`, whatever the number of repositories. In an Anthropic-hosted environment, install dependencies for threads with a setup script. In a self-hosted environment, use a hook in the [runner host’s settings](</docs/en/self-hosted-environments-configuration#repository-settings-in-sessions-with-several-repositories>) instead. * **No cloud-only scoping** : hooks run in both local and cloud sessions. To skip local execution, exit early unless the `CLAUDE_CODE_REMOTE` environment variable is `true`, the way the dependency install script does. * **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** : in Anthropic-hosted environments, all outbound traffic passes through a security proxy, and some package managers don’t work correctly with it; Bun is a known example. In a [self-hosted environment](</docs/en/self-hosted-environments-deploy#default-deny-egress>), outbound traffic goes through your own network boundary instead.
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -1,6 +1,15 @@ Cloud environments apply to [cloud sessions](</docs/en/claude-code-on-the-web>), which are available on Pro, Max, and Team plans, and for Enterprise users with [premium seats or Chat + Claude Code seats](<https://support.claude.com/en/articles/11845131-use-claude-code-with-your-team-or-enterprise-plan>). -Each [cloud session](</docs/en/claude-code-on-the-web>) 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](</docs/en/desktop>), the [Claude mobile app](</docs/en/mobile>), your browser at [claude.ai/code](<https://claude.ai/code>), the terminal with [`claude --cloud`](</docs/en/claude-code-on-the-web#from-terminal-to-cloud>), [routines](</docs/en/routines>), and [Claude Tag](<https://claude.com/docs/claude-tag/overview>). Each of these surfaces can also route to a [self-hosted environment](</docs/en/self-hosted-environments>). [Availability and limitations](</docs/en/self-hosted-environments#availability-and-limitations>) covers what Claude can’t use yet when a Claude Tag session runs in one. +Each [cloud session](</docs/en/claude-code-on-the-web>) 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](</docs/en/desktop>) + * The [Claude mobile app](</docs/en/mobile>) + * Your browser at [claude.ai/code](<https://claude.ai/code>) + * The terminal with [`claude --cloud`](</docs/en/claude-code-on-the-web#from-terminal-to-cloud>) + * [Cloud scheduled tasks](</docs/en/routines>) + * [Claude Tag](<https://claude.com/docs/claude-tag/overview>) + +Each of these surfaces can also route to a [self-hosted environment](</docs/en/self-hosted-environments>). [Availability and limitations](</docs/en/self-hosted-environments#availability-and-limitations>) covers what Claude can’t use yet when a Claude Tag session runs in one. [Remote Control](</docs/en/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. Claude Tag channel sessions use organization-level environments only, either shared environments or [self-hosted environments](</docs/en/self-hosted-environments>). @@ -180,7 +189,9 @@ * 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. * Network secrets on the environment stay attached in its running sessions. Delete any you no longer want before you archive. - * No new session can start in an archived environment, on any surface. If the environment was your saved CLI default, Claude Code starts CLI cloud sessions in the Anthropic-hosted environment when your list has one, and otherwise in the first environment in your list that isn’t a Remote Control bridge environment. Anything configured with the environment explicitly, such as a [routine](</docs/en/routines#environments-and-network-access>), can’t start new sessions in it. Point it at another environment. + * No new session can start in an archived environment, on any surface: + * **Saved CLI default** : if the environment was your saved CLI default, Claude Code starts CLI cloud sessions in the Anthropic-hosted environment when your list has one. Otherwise, it starts them in the first environment in your list that isn’t a Remote Control bridge environment. + * **Configured explicitly** : anything configured with the environment explicitly, such as a [cloud scheduled task](</docs/en/routines#environments-and-network-access>), can’t start new sessions in it. Point it at another environment. ### @@ -191,7 +202,7 @@ On Team and Enterprise plans, an Owner can create cloud environments that are shared with every member of the organization. The same role manages everything else on the **Cloud environments** admin page, including [self-hosted environments](</docs/en/self-hosted-environments>); the Admin role can’t open the page. The full list of roles that can open it is the one for [managing server-managed settings](</docs/en/server-managed-settings#access-control>). Shared environments appear in each member’s environment selector under an **Organization** heading, after the member’s own environments under **Personal** , so a team can standardize on one configuration instead of each member recreating it. Selecting a shared environment’s settings icon there opens a read-only summary of its configuration for every member, Owners included. An Owner makes an environment available to the organization in one of two ways: * **Create a shared environment** : use the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>), which is also where Owners edit and archive shared environments. Each one has a name, a network access level, environment variables in `.env` format, and a setup script. - * **Share a personal environment** : open one of your own environments for editing in the environment selector, then share it from the **Who can use it** row. The environment keeps its ID, so sessions and routines that already use it aren’t affected, and every member can then see it and start sessions in it. + * **Share a personal environment** : open one of your own environments for editing in the environment selector, then share it from the **Who can use it** row. The environment keeps its ID, so sessions and scheduled tasks that already use it aren’t affected, and every member can then see it and start sessions in it. Owners choose the organization’s default environment separately, at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). To give a shared environment’s sessions a key they can’t read, add a network secret when you edit the environment on the **Cloud environments** page. Don’t include secrets in its variables, because every member’s sessions read them. @@ -212,9 +223,9 @@ 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. A shared environment opens read-only there, so an Owner changes its network access from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>) instead. The control that opens the selector appears on the app surfaces listed under The Default environment and in the [routine editor](</docs/en/routines#environments-and-network-access>); personal environments don’t have a separate page in your claude.ai account settings. When you change an Anthropic-hosted environment’s network access, its existing sessions follow the new setting within about a minute, for requests that go through the session’s network allowlist. You don’t need to start a new session. - -MCP connectors you enable on a session or routine work without adding their hosts to **Allowed domains** , because connector traffic travels through Anthropic’s servers rather than the session’s network. This relies on the same Anthropic-bound channel noted under [Security and isolation](</docs/en/claude-code-on-the-web#security-and-isolation>). Turn off any connector you don’t need to limit which tools Claude can reach. +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. A shared environment opens read-only there, so an Owner changes its network access from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>) instead. The control that opens the selector appears on the app surfaces listed under The Default environment and in the [cloud scheduled task editor](</docs/en/routines#environments-and-network-access>). Personal environments don’t have a separate page in your claude.ai account settings. When you change an Anthropic-hosted environment’s network access, its existing sessions follow the new setting within about a minute, for requests that go through the session’s network allowlist. You don’t need to start a new session. + +MCP connectors you enable on a session or scheduled task work without adding their hosts to **Allowed domains** , because connector traffic travels through Anthropic’s servers rather than the session’s network. This relies on the same Anthropic-bound channel noted under [Security and isolation](</docs/en/claude-code-on-the-web#security-and-isolation>). Turn off any connector you don’t need to limit which tools Claude can reach. ### @@ -840,7 +851,7 @@ * [Cloud sessions reference](</docs/en/claude-code-on-the-web>): start, manage, and share cloud sessions * [Cloud sessions quickstart](</docs/en/web-quickstart>): connect GitHub and start your first cloud session * [Claude Tag](<https://claude.com/docs/claude-tag/overview>): sessions Claude starts from Slack run in the same environments - * [Routines](</docs/en/routines>): scheduled runs use the same environments and network access levels + * [Cloud scheduled tasks](</docs/en/routines>): scheduled runs use the same environments and network access levels * [Remote Control](</docs/en/remote-control>): run sessions on your own machine’s network and files instead * [Self-hosted environments](</docs/en/self-hosted-environments>): run cloud sessions on your organization’s own infrastructure * [SessionStart hooks](</docs/en/hooks#sessionstart>): repo-committed setup that runs in local and cloud sessions
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -525,7 +525,7 @@ } } -The `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: +The `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. It skips `npm install` while `package.json`, `package-lock.json`, and the script itself are unchanged since the last successful install: #!/bin/bash @@ -533,11 +533,24 @@ exit 0 fi - npm install + cd "$CLAUDE_PROJECT_DIR" || exit 1 + hashes=node_modules/.install_pkgs.sha256 + + if ! sha256sum --check --status "$hashes" 2>/dev/null; then + # Delete the old hashes first, so a failed install runs again next time + rm -f "$hashes" + if npm install; then + sha256sum scripts/install_pkgs.sh package.json package-lock.json > "$hashes" || rm -f "$hashes" + fi + fi + + # pip skips requirements that are already satisfied pip install -r requirements.txt exit 0 -The `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. +The `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. To confirm `npm install` succeeded, start a cloud session and ask Claude to show `node_modules/.install_pkgs.sha256`. The file lists a hash for each of the three files. If the file is missing, ask Claude to run `npm install` and report the error. + +If `npm install` reads other files, such as a workspace’s `package.json`, an `.npmrc`, or your `postinstall` script’s inputs, add them to the `sha256sum` command that saves the hashes. Otherwise, you keep the old packages after one of those files changes. #### @@ -551,7 +564,7 @@ * **No cloud-only scoping** : hooks run in both local and cloud sessions. To skip local execution, exit early unless the `CLAUDE_CODE_REMOTE` environment variable is `true`, the way the dependency install script does. * **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** : in Anthropic-hosted environments, all outbound traffic passes through a security proxy, and some package managers don’t work correctly with it; Bun is a known example. In a [self-hosted environment](</docs/en/self-hosted-environments-deploy#default-deny-egress>), outbound traffic goes through your own network boundary instead. - * **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. + * **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 skipping work that’s already done, the way the dependency install script does. 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.
modified
Show diff (159 lines)
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -1,6 +1,6 @@ Cloud environments apply to [cloud sessions](</docs/en/claude-code-on-the-web>), which are available on Pro, Max, and Team plans, and for Enterprise users with [premium seats or Chat + Claude Code seats](<https://support.claude.com/en/articles/11845131-use-claude-code-with-your-team-or-enterprise-plan>). -Each [cloud session](</docs/en/claude-code-on-the-web>) runs in a cloud environment. You can configure an environment to allow or deny network access, set environment variables for the session, on Pro and Max plans 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](</docs/en/desktop>), the [Claude mobile app](</docs/en/mobile>), your browser at [claude.ai/code](<https://claude.ai/code>), the terminal with [`claude --cloud`](</docs/en/claude-code-on-the-web#from-terminal-to-cloud>), [routines](</docs/en/routines>), and [Claude Tag](<https://claude.com/docs/claude-tag/overview>). Each of these surfaces can also route to a [self-hosted environment](</docs/en/self-hosted-environments>). [Availability and limitations](</docs/en/self-hosted-environments#availability-and-limitations>) covers what Claude can’t use yet when a Claude Tag session runs in one. +Each [cloud session](</docs/en/claude-code-on-the-web>) 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](</docs/en/desktop>), the [Claude mobile app](</docs/en/mobile>), your browser at [claude.ai/code](<https://claude.ai/code>), the terminal with [`claude --cloud`](</docs/en/claude-code-on-the-web#from-terminal-to-cloud>), [routines](</docs/en/routines>), and [Claude Tag](<https://claude.com/docs/claude-tag/overview>). Each of these surfaces can also route to a [self-hosted environment](</docs/en/self-hosted-environments>). [Availability and limitations](</docs/en/self-hosted-environments#availability-and-limitations>) covers what Claude can’t use yet when a Claude Tag session runs in one. [Remote Control](</docs/en/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. Claude Tag channel sessions use organization-level environments only, either shared environments or [self-hosted environments](</docs/en/self-hosted-environments>). @@ -34,19 +34,22 @@ Configure your environment -Create, edit, and archive environments from the environment selector, which you reach at [claude.ai/code](<https://claude.ai/code>) after [web onboarding](</docs/en/web-quickstart>), or from the prompt box in the [Desktop app](</docs/en/desktop#cloud-sessions>). Environments you create are personal to your account; shared environments created by an Owner appear in the same selector. See Installed tools for what’s available without any configuration. +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](<https://claude.ai/code>). To reach that screen, complete [web onboarding](</docs/en/web-quickstart>). For the Desktop app, see [Cloud sessions](</docs/en/desktop#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 [claude.ai/code](<https://claude.ai/code>), select the cloud icon showing the current environment’s name, in the row above the message box. There’s no settings page or direct URL for the selector. +On the new-session screen, select the first control in the row under the message box. 2 Add or edit an environment -Select **Cloud** to list your environments. Then select **Add cloud environment** , or hover over an existing environment and select the settings icon that appears on the right.The dialog includes the name, network access level, environment variables, and setup script. When you edit an existing cloud environment on a Pro or Max plan, the dialog also includes network secrets. + * **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. + +The dialog includes the name, network access level, environment variables, and setup script. To store a key that sessions use without seeing it, see Add network secrets. ### @@ -65,7 +68,7 @@ * **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](</docs/en/claude-code-on-the-web#environment-expired>), 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`](</docs/en/claude-code-on-the-web#manage-context>), 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. On Pro and Max plans, 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. +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`](</docs/en/claude-code-on-the-web#manage-context>), 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. ### @@ -73,7 +76,7 @@ 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 and Max plans. They aren’t available on Team or Enterprise plans yet, so the **Network secrets** section doesn’t appear in the environment dialog on those plans. +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, Team, and Enterprise plans. To check whether you can add one yourself, see Requirements. #### @@ -83,9 +86,10 @@ These requirements decide whether you can add a secret and whether the agent proxy can use it once added: - * **Role** : an organization admin role in your claude.ai organization - * On Team and Enterprise, Owners hold it and Admins don’t - * On Pro and Max, you hold it in your own organization + * **Role** : on Pro, Max, and Team plans, 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 Admins don’t, which changes what you see in these cases: + * **Your own environment on Enterprise** : with an organization admin role, you add and delete secrets. Without it, the **Network secrets** section lists the secrets under the note “Only an organization admin can add or delete network secrets”, with no **Add secret** or delete button. Ask an Owner to add the secret to a shared environment, then run your sessions there + * **A shared environment** : Owners add and delete its secrets from admin settings. Without an organization admin role, ask an Owner to add the secret, because the environment’s dialog has no **Network secrets** section + * **Your own environment on Team** : without an organization admin role, **Add secret** opens a shorter form that takes one host * **Environment type** : an Anthropic-hosted cloud environment that already exists. A [self-hosted environment](</docs/en/self-hosted-environments>) doesn’t have network secrets * **API reachability** : the API accepts connections from the internet, because requests leave from Anthropic’s network * **Encryption keys** : if your organization uses customer-managed encryption keys, you can’t save network secrets @@ -96,33 +100,45 @@ Add a secret -You add secrets one at a time, and you can’t edit a secret after you add it. To change a secret’s hosts or value, delete it and add it again. +You add secrets one at a time, and you can’t edit a secret after you add it. To change a secret’s hosts or value, delete it and add it again. To add a secret to a shared environment, open it for editing from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>), then continue step 1 from the **Network secrets** section. If you’re on a Team plan and don’t hold an organization admin role, follow step 1 on your own environment, then fill in the shorter form. 1 Open the environment's network secrets -Open the environment for editing at [claude.ai/code](<https://claude.ai/code>). In the **Edit environment** dialog, find the **Network secrets** section. You see the secrets already on the environment, each with the hosts it applies to. +Open the environment for editing at [claude.ai/code](<https://claude.ai/code>). In the **Edit cloud environment** dialog, find the **Network secrets** section. You see the secrets already on the environment, each with the hosts it applies to. 2 Add the secret -Select **Add secret** and fill in the form. Keep the default **Credential type** , **Bearer** , for an API key that travels in a request header, and fill in these fields: +Select **Add secret** and fill in the form. Keep the default **Secret type** , **Bearer** , for an API key that travels in a request header, and fill in these fields: * **Name** : a label for the secret, such as `Internal billing API` * **Allowed websites** : the API’s hosts, such as `api.example.com`. A leading `*.` matches every subdomain * **Custom headers** : one row for the header that carries the key. The row starts with `Authorization` as the header’s **Name** and `Bearer` as its **Prefix** ; paste the key itself as the **Value**. For a header like `X-Api-Key` that takes the bare value, change the name and clear the prefix -For an API that authenticates another way, pick a different **Credential type**. The list is the same one [Claude Tag](<https://claude.com/docs/claude-tag/overview>), the Slack integration for Team and Enterprise plans, offers for [connections](<https://claude.com/docs/claude-tag/admins/add-connections>). +For an API that authenticates another way, pick a different **Secret type**. The list is the same one [Claude Tag](<https://claude.com/docs/claude-tag/overview>), the Slack integration for Team and Enterprise plans, offers for [connections](<https://claude.com/docs/claude-tag/admins/add-connections>). 3 Save the secret -Select **Connect**. The secret appears in the list with its hosts, saved without the dialog’s **Save changes** button. You can’t view the value again after saving. +Select **Add**. The secret appears in the list with its hosts, saved without the dialog’s **Save changes** button. You can’t view the value again after saving. To confirm the secret works, start a session in the environment and ask Claude to call the API, for example with `curl`. The API answers as if the key were in the request, and the key doesn’t appear in the session’s environment variables or in any file. If the list marks a secret **Not sent** instead, the note under it says why and what to do. Two secrets whose hosts overlap without matching exactly get no marker, and the agent proxy sends only one of them. + +#### + +​ + +Add a secret on a Team plan without an organization admin role + +If you’re on a Team plan and don’t hold an organization admin role, the **Add secret** form takes one secret for one host. Select **Add secret** in your environment’s **Network secrets** section, fill in these fields, then select the form’s **Add secret** button: + + * **Host** : the one host that gets the secret, such as `api.example.com`. The form doesn’t accept a `*.` wildcard + * **Name** : an optional label for the secret + * **Secret type** : **Token** for a key that travels in a request header, or **Username and password**. For a token, paste the key as the **Value** #### @@ -159,7 +175,7 @@ Archive an environment -To archive one of your own environments, open it for editing and select **Archive**. An Owner archives a shared environment from the **Cloud environments** page in admin settings. You can’t delete an environment, only archive it. Archiving affects new sessions, not running ones: +To archive one of your own environments, open it for editing, select **Archive environment** , and confirm. If the environment is shared with your organization, an Owner archives it from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>) instead, so ask an Owner unless you are one. 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. @@ -177,7 +193,7 @@ * **Create a shared environment** : use the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>), which is also where Owners edit and archive shared environments. Each one has a name, a network access level, environment variables in `.env` format, and a setup script. * **Share a personal environment** : open one of your own environments for editing in the environment selector, then share it from the **Who can use it** row. The environment keeps its ID, so sessions and routines that already use it aren’t affected, and every member can then see it and start sessions in it. -Owners choose the organization’s default environment separately, at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). Every member’s sessions in a shared environment read its variables, so don’t include secrets in them. Network secrets, which give sessions a key they can’t read, aren’t available on Team or Enterprise plans yet. +Owners choose the organization’s default environment separately, at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). To give a shared environment’s sessions a key they can’t read, add a network secret when you edit the environment on the **Cloud environments** page. Don’t include secrets in its variables, because every member’s sessions read them. ### @@ -196,7 +212,7 @@ 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. A shared environment opens read-only there, so an Owner changes its network access from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>) instead. The cloud icon that opens the selector appears on the app surfaces listed under The Default environment and in the [routine editor](</docs/en/routines#environments-and-network-access>); personal environments don’t have a separate page in your claude.ai account settings. When you change an Anthropic-hosted environment’s network access, its existing sessions follow the new setting within about a minute, for requests that go through the session’s network allowlist. You don’t need to start a new session. +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. A shared environment opens read-only there, so an Owner changes its network access from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>) instead. The control that opens the selector appears on the app surfaces listed under The Default environment and in the [routine editor](</docs/en/routines#environments-and-network-access>); personal environments don’t have a separate page in your claude.ai account settings. When you change an Anthropic-hosted environment’s network access, its existing sessions follow the new setting within about a minute, for requests that go through the session’s network allowlist. You don’t need to start a new session. MCP connectors you enable on a session or routine work without adding their hosts to **Allowed domains** , because connector traffic travels through Anthropic’s servers rather than the session’s network. This relies on the same Anthropic-bound channel noted under [Security and isolation](</docs/en/claude-code-on-the-web#security-and-isolation>). Turn off any connector you don’t need to limit which tools Claude can reach. @@ -300,10 +316,10 @@ Plugins enabled only in your user settings| No| User-scoped `enabledPlugins` lives in `~/.claude/settings.json` on your machine MCP servers you added with `claude mcp add` at the default local scope or the user scope| No| Those write to `~/.claude.json` on your machine, not the repo. Add the server with `claude mcp add --scope project`, which writes the repo’s [`.mcp.json`](</docs/en/mcp#project-scope>), and commit that file. A session with one repository loads it Transport variables in your repo’s `.claude/settings.json` `env` block, such as `NODE_EXTRA_CA_CERTS` and the [mTLS client certificate variables](</docs/en/network-config#mtls-authentication>)| No| The hosting environment manages the session’s API connection, so Claude Code ignores these keys and notes each ignored key in the session’s debug log -API keys and tokens for services Claude calls| On Pro and Max plans, as network secrets| You add the key once on the environment and the agent proxy attaches it to requests for the hosts you list. A key the agent proxy can’t attach, or any key on a Team or Enterprise plan, stays in an environment variable +API keys and tokens for services Claude calls| In an Anthropic-hosted environment, as network secrets| You add the key once on the environment and the agent proxy attaches it to requests for the hosts you list. A key the agent proxy can’t attach stays in an environment variable Interactive auth like AWS SSO| No| Not supported. SSO requires browser-based login that can’t run in a cloud session -To make your own configuration available in cloud sessions, commit it to the repo. Anyone who uses the environment can read its environment variables and setup script. The dialog’s note under **Environment variables** says so and warns against putting secrets there. On Pro and Max plans, store a key the agent proxy can attach as a network secret instead. +To make your own configuration available in cloud sessions, commit it to the repo. Anyone who uses the environment can read its environment variables and setup script. The dialog’s note under **Environment variables** says so and warns against putting secrets there. In an Anthropic-hosted environment, store a key the agent proxy can attach as a network secret instead. ####
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -252,7 +252,7 @@ * **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 `gh` under the `proxy-injected` placeholder, go out with your real credentials substituted. * **Push restrictions** : the proxy rejects branch deletions and pushes of anything other than a branch, such as a tag. It doesn’t limit which branches a push can update. To do that, use branch protection rules or rulesets on GitHub. - * **Repository scope** : the proxy serves GitHub API requests for the repositories attached to the session. An API request for another repository gets a 403 whose message starts with `GitHub access to` and contains `is not enabled for this session`. + * **Repository scope** : the proxy serves GitHub API requests for the repositories attached to the session. An API request for another repository gets a 403 whose message starts with `GitHub access to` and contains `is not enabled for this session`. A source archive you fetch over a `github.com/{owner}/{repo}/archive/` or `codeload.github.com` URL gets that same 403 when the repository isn’t attached, even a public one. * **GraphQL restrictions** : the proxy rejects requests to GitHub’s GraphQL endpoint with a 403 whose message starts with `GitHub GraphQL is not available from Claude Code sessions` and names the REST fallback, `gh api repos/{owner}/{repo}/...`. `gh` subcommands that use GraphQL, such as `gh pr` and `gh issue`, get the same 403. The restriction applies to every request through the proxy regardless of the credentials you supply, so a `GH_TOKEN` you set gets the same 403. Claude can’t reach GitHub APIs that exist only in GraphQL, such as Projects v2, through the proxy. Committed files from public repositories arrive through `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.
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -296,7 +296,7 @@ Plugins and marketplaces declared in your repo’s `.claude/settings.json`| No| A cloud session doesn’t install the plugins a repository turns on under [`enabledPlugins`](</docs/en/settings-reference#enabledplugins>), including ones from the marketplaces it lists under [`extraKnownMarketplaces`](</docs/en/settings-reference#extraknownmarketplaces>) Your organization’s [server-managed settings](</docs/en/server-managed-settings>)| Yes, except in [Claude Tag](<https://claude.com/docs/claude-tag/overview>) sessions| Fetched from Anthropic’s servers when the session starts. See [Surface coverage](</docs/en/model-config#surface-coverage>) for how `availableModels` is enforced in cloud sessions. Settings deployed to your device through MDM or managed settings files don’t apply, because the session runs on an Anthropic-managed VM; in a [self-hosted environment](</docs/en/self-hosted-environments>), sessions also read the managed settings file in the runner image, per [how Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) Your user `~/.claude/CLAUDE.md`| No| Lives on your machine, not in the repo. See Add personal preferences without committing to the repo -Your user `~/.claude/skills/`, `~/.claude/agents/`, `~/.claude/commands/`| No| Live on your machine, not in the repo. Commit them to the repo’s `.claude/` directory instead. Cloud sessions automatically load skills you enable on claude.ai +Your user `~/.claude/skills/`, `~/.claude/agents/`, `~/.claude/commands/`| No| Live on your machine, not in the repo. Commit them to the repo’s `.claude/` directory instead. Cloud sessions automatically load [skills you enable on claude.ai](</docs/en/skills#skills-in-cowork-and-cloud-sessions>) Plugins enabled only in your user settings| No| User-scoped `enabledPlugins` lives in `~/.claude/settings.json` on your machine MCP servers you added with `claude mcp add` at the default local scope or the user scope| No| Those write to `~/.claude.json` on your machine, not the repo. Add the server with `claude mcp add --scope project`, which writes the repo’s [`.mcp.json`](</docs/en/mcp#project-scope>), and commit that file. A session with one repository loads it Transport variables in your repo’s `.claude/settings.json` `env` block, such as `NODE_EXTRA_CA_CERTS` and the [mTLS client certificate variables](</docs/en/network-config#mtls-authentication>)| No| The hosting environment manages the session’s API connection, so Claude Code ignores these keys and notes each ignored key in the session’s debug log
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -289,8 +289,8 @@ | Available in cloud sessions| Why ---|---|--- Your repo’s `CLAUDE.md`| Yes| Part of the clone -Your repo’s `.claude/settings.json` hooks and permission rules| Yes, in a session with one repository| Part of the clone. A session with several repositories, including a [project](</docs/en/claude-projects#what-threads-pick-up-from-your-repositories>) thread, starts above the clones and doesn’t read them -Your repo’s `.mcp.json` MCP servers| Yes, in a session with one repository| Part of the clone, found from the session’s working directory +Your repo’s `.claude/settings.json` hooks and permission rules| Yes, in a session with one repository| Part of the clone. For a session with several repositories, see [which settings it reads](</docs/en/settings#settings-in-cloud-sessions>) +Your repo’s `.mcp.json` MCP servers| Yes, in a session with one repository| Part of the clone, found from the session’s working directory. For a self-hosted environment, see [which repository’s settings apply](</docs/en/self-hosted-environments-configuration#repository-settings-in-sessions-with-several-repositories>) Your repo’s `.claude/rules/`| Yes| Part of the clone Your repo’s `.claude/skills/`, `.claude/agents/`, `.claude/commands/`| Yes| Part of the clone Plugins and marketplaces declared in your repo’s `.claude/settings.json`| No| A cloud session doesn’t install the plugins a repository turns on under [`enabledPlugins`](</docs/en/settings-reference#enabledplugins>), including ones from the marketplaces it lists under [`extraKnownMarketplaces`](</docs/en/settings-reference#extraknownmarketplaces>) @@ -531,7 +531,7 @@ SessionStart hooks behave the same in the cloud as locally, with these caveats: - * **One repository per session** : a session with several repositories doesn’t load hooks from any repository’s `.claude/settings.json`, so a SessionStart hook you define there doesn’t run. Install dependencies for those sessions with a setup script instead. + * **One repository per session** : in an Anthropic-hosted environment, a session with several repositories doesn’t load hooks from any repository’s `.claude/settings.json`, so a SessionStart hook you define there doesn’t run. Install dependencies for those sessions with a setup script instead. For a self-hosted environment, see [which repository’s settings apply](</docs/en/self-hosted-environments-configuration#repository-settings-in-sessions-with-several-repositories>). * **No cloud-only scoping** : hooks run in both local and cloud sessions. To skip local execution, exit early unless the `CLAUDE_CODE_REMOTE` environment variable is `true`, the way the dependency install script does. * **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** : in Anthropic-hosted environments, all outbound traffic passes through a security proxy, and some package managers don’t work correctly with it; Bun is a known example. In a [self-hosted environment](</docs/en/self-hosted-environments-deploy#default-deny-egress>), outbound traffic goes through your own network boundary instead.
modified
Show diff (242 lines)
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -1,6 +1,6 @@ Cloud environments apply to [cloud sessions](</docs/en/claude-code-on-the-web>), which are available on Pro, Max, and Team plans, and for Enterprise users with [premium seats or Chat + Claude Code seats](<https://support.claude.com/en/articles/11845131-use-claude-code-with-your-team-or-enterprise-plan>). -Each [cloud session](</docs/en/claude-code-on-the-web>) runs in a cloud environment. You can configure an environment to allow or deny network access, set environment variables for the session, on Pro and Max plans store API credentials 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](</docs/en/desktop>), the [Claude mobile app](</docs/en/mobile>), your browser at [claude.ai/code](<https://claude.ai/code>), the terminal with [`claude --cloud`](</docs/en/claude-code-on-the-web#from-terminal-to-cloud>), [routines](</docs/en/routines>), and [Claude Tag](<https://claude.com/docs/claude-tag/overview>). Each of these surfaces can also route to a [self-hosted environment](</docs/en/self-hosted-environments>). [Availability and limitations](</docs/en/self-hosted-environments#availability-and-limitations>) covers what Claude can’t use yet when a Claude Tag session runs in one. +Each [cloud session](</docs/en/claude-code-on-the-web>) runs in a cloud environment. You can configure an environment to allow or deny network access, set environment variables for the session, on Pro and Max plans 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](</docs/en/desktop>), the [Claude mobile app](</docs/en/mobile>), your browser at [claude.ai/code](<https://claude.ai/code>), the terminal with [`claude --cloud`](</docs/en/claude-code-on-the-web#from-terminal-to-cloud>), [routines](</docs/en/routines>), and [Claude Tag](<https://claude.com/docs/claude-tag/overview>). Each of these surfaces can also route to a [self-hosted environment](</docs/en/self-hosted-environments>). [Availability and limitations](</docs/en/self-hosted-environments#availability-and-limitations>) covers what Claude can’t use yet when a Claude Tag session runs in one. [Remote Control](</docs/en/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. Claude Tag channel sessions use organization-level environments only, either shared environments or [self-hosted environments](</docs/en/self-hosted-environments>). @@ -46,7 +46,7 @@ Add or edit an environment -Select **Cloud** to list your environments. Then select **Add cloud environment** , or hover over an existing environment and select the settings icon that appears on the right.The dialog includes the name, network access level, environment variables, and setup script. When you edit an existing cloud environment on a Pro or Max plan, the dialog also includes API credentials. +Select **Cloud** to list your environments. Then select **Add cloud environment** , or hover over an existing environment and select the settings icon that appears on the right.The dialog includes the name, network access level, environment variables, and setup script. When you edit an existing cloud environment on a Pro or Max plan, the dialog also includes network secrets. ### @@ -65,15 +65,15 @@ * **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](</docs/en/claude-code-on-the-web#environment-expired>), 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`](</docs/en/claude-code-on-the-web#manage-context>), 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. On Pro and Max plans, use an API credential instead for a key the agent proxy can attach to a request. The requests that never get a credential are listed there. - -### - -​ - -Add API credentials - -An API credential 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. The key never reaches Claude, the commands it runs, or the session’s environment variables. API credentials are available on Pro and Max plans. They aren’t available on Team or Enterprise plans yet, so the **API credentials** section doesn’t appear in the environment dialog on those plans. +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`](</docs/en/claude-code-on-the-web#manage-context>), 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. On Pro and Max plans, 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 and Max plans. They aren’t available on Team or Enterprise plans yet, so the **Network secrets** section doesn’t appear in the environment dialog on those plans. #### @@ -81,36 +81,36 @@ Requirements -Two of these decide whether you can add a credential, and two decide whether the agent proxy can use it once added: +These requirements decide whether you can add a secret and whether the agent proxy can use it once added: * **Role** : an organization admin role in your claude.ai organization * On Team and Enterprise, Owners hold it and Admins don’t * On Pro and Max, you hold it in your own organization - * **Environment type** : an Anthropic-hosted cloud environment that already exists. A [self-hosted environment](</docs/en/self-hosted-environments>) doesn’t have API credentials + * **Environment type** : an Anthropic-hosted cloud environment that already exists. A [self-hosted environment](</docs/en/self-hosted-environments>) doesn’t have network secrets * **API reachability** : the API accepts connections from the internet, because requests leave from Anthropic’s network - * **Encryption keys** : if your organization uses customer-managed encryption keys, you can’t save credentials + * **Encryption keys** : if your organization uses customer-managed encryption keys, you can’t save network secrets #### ​ -Add a credential - -You add credentials one at a time, and you can’t edit a credential after you add it. To change a credential’s hosts or value, delete it and add it again. +Add a secret + +You add secrets one at a time, and you can’t edit a secret after you add it. To change a secret’s hosts or value, delete it and add it again. 1 -Open the environment's API credentials - -Open the environment for editing at [claude.ai/code](<https://claude.ai/code>). In the **Edit environment** dialog, find the **API credentials** section. You see the credentials already on the environment, each with the hosts it applies to. +Open the environment's network secrets + +Open the environment for editing at [claude.ai/code](<https://claude.ai/code>). In the **Edit environment** dialog, find the **Network secrets** section. You see the secrets already on the environment, each with the hosts it applies to. 2 -Add the credential - -Select **Add credential** and fill in the form. Keep the default **Credential type** , **Bearer** , for an API key that travels in a request header, and fill in these fields: - - * **Name** : a label for the credential, such as `Internal billing API` +Add the secret + +Select **Add secret** and fill in the form. Keep the default **Credential type** , **Bearer** , for an API key that travels in a request header, and fill in these fields: + + * **Name** : a label for the secret, such as `Internal billing API` * **Allowed websites** : the API’s hosts, such as `api.example.com`. A leading `*.` matches every subdomain * **Custom headers** : one row for the header that carries the key. The row starts with `Authorization` as the header’s **Name** and `Bearer` as its **Prefix** ; paste the key itself as the **Value**. For a header like `X-Api-Key` that takes the bare value, change the name and clear the prefix @@ -118,29 +118,29 @@ 3 -Save the credential - -Select **Connect**. The credential appears in the list with its hosts, saved without the dialog’s **Save changes** button. You can’t view the value again after saving. - -To confirm the credential works, start a session in the environment and ask Claude to call the API, for example with `curl`. The API answers as if the key were in the request, and the key doesn’t appear in the session’s environment variables or in any file. If the list marks a credential **Not sent** instead, the note under it says why and what to do. Two credentials whose hosts overlap without matching exactly get no marker, and the agent proxy sends only one of them. +Save the secret + +Select **Connect**. The secret appears in the list with its hosts, saved without the dialog’s **Save changes** button. You can’t view the value again after saving. + +To confirm the secret works, start a session in the environment and ask Claude to call the API, for example with `curl`. The API answers as if the key were in the request, and the key doesn’t appear in the session’s environment variables or in any file. If the list marks a secret **Not sent** instead, the note under it says why and what to do. Two secrets whose hosts overlap without matching exactly get no marker, and the agent proxy sends only one of them. #### ​ -Which requests get the credential - -The agent proxy attaches a credential to a request when the request’s host matches one you listed on that credential. Sessions can reach those hosts even when the environment’s network access level wouldn’t otherwise allow them, except the hosts that never get the credential. The credential applies in every session that runs in the environment, whoever started it, until you delete it. +Which requests get the secret + +The agent proxy attaches a secret to a request when the request’s host matches one you listed on that secret. Sessions can reach those hosts even when the environment’s network access level wouldn’t otherwise allow them, except the hosts that never get the secret. The secret applies in every session that runs in the environment, whoever started it, until you delete it. #### ​ -Requests that never get the credential - -The agent proxy never attaches a credential you add to these requests: - - * **GitHub** : the GitHub proxy authenticates requests to GitHub instead, so you don’t need an API credential for it +Requests that never get the secret + +The agent proxy never attaches a secret you add to these requests: + + * **GitHub** : the GitHub proxy authenticates requests to GitHub instead, so you don’t need a network secret for it * **The Anthropic API and public package registries** : `api.anthropic.com`, `registry.npmjs.org`, `jsr.io`, `npm.jsr.io`, `pypi.org`, `files.pythonhosted.org`, `index.crates.io`, and `proxy.golang.org` * **Setup script requests** : Claude Code connects to the agent proxy when it launches, after the setup script has run * **Claude Code’s telemetry export** : Claude Code sends its [telemetry export](</docs/en/monitoring-usage#telemetry-from-cloud-sessions-and-claude-tag>) itself rather than through a command it runs, and that request doesn’t go through the agent proxy @@ -163,7 +163,7 @@ * 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. - * API credentials on the environment stay attached in its running sessions. Delete any you no longer want before you archive. + * Network secrets on the environment stay attached in its running sessions. Delete any you no longer want before you archive. * No new session can start in an archived environment, on any surface. If the environment was your saved CLI default, Claude Code starts CLI cloud sessions in the Anthropic-hosted environment when your list has one, and otherwise in the first environment in your list that isn’t a Remote Control bridge environment. Anything configured with the environment explicitly, such as a [routine](</docs/en/routines#environments-and-network-access>), can’t start new sessions in it. Point it at another environment. ### @@ -177,7 +177,7 @@ * **Create a shared environment** : use the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>), which is also where Owners edit and archive shared environments. Each one has a name, a network access level, environment variables in `.env` format, and a setup script. * **Share a personal environment** : open one of your own environments for editing in the environment selector, then share it from the **Who can use it** row. The environment keeps its ID, so sessions and routines that already use it aren’t affected, and every member can then see it and start sessions in it. -Owners choose the organization’s default environment separately, at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). Every member’s sessions in a shared environment read its variables, so don’t include secrets in them. API credentials, which give sessions a key they can’t read, aren’t available on Team or Enterprise plans yet. +Owners choose the organization’s default environment separately, at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). Every member’s sessions in a shared environment read its variables, so don’t include secrets in them. Network secrets, which give sessions a key they can’t read, aren’t available on Team or Enterprise plans yet. ### @@ -219,7 +219,7 @@ * GitHub, through its separate proxy * MCP connectors you enable, whose traffic travels through Anthropic’s servers - * The hosts you listed on the environment’s API credentials, except the hosts that never get the credential + * The hosts you listed on the environment’s network secrets, except the hosts that never get the secret * The Anthropic API, for Claude Code’s own requests, even at **None** , as noted under [Security and isolation](</docs/en/claude-code-on-the-web#security-and-isolation>) ### @@ -234,7 +234,7 @@ *.internal.example.com registry.example.com -Sessions in this environment can now reach `api.example.com`, any subdomain of `internal.example.com`, and `registry.example.com`, and no other domains through the session’s network. GitHub traffic, MCP connector traffic, and requests to the hosts of the environment’s API credentials, other than the hosts that never get the credential, 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. If your organization uses [artifacts](</docs/en/artifacts#availability>), you don’t need `*.frame.claudeusercontent.com` in the list for sessions to read them. When the list leaves that host out, Claude Code reads artifact content through the session’s connection to Anthropic instead. Keep the host in an allowlist in two situations: +Sessions in this environment can now reach `api.example.com`, any subdomain of `internal.example.com`, and `registry.example.com`, and no other domains through the session’s network. GitHub traffic, MCP connector traffic, and requests to the hosts of the environment’s network secrets, other than the hosts that never get the secret, 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. If your organization uses [artifacts](</docs/en/artifacts#availability>), you don’t need `*.frame.claudeusercontent.com` in the list for sessions to read them. When the list leaves that host out, Claude Code reads artifact content through the session’s connection to Anthropic instead. Keep the host in an allowlist in two situations: * **Sessions in this environment open another organization’s public artifacts** : Claude Code fetches those from the host directly, so add it to this list. * **You’re configuring the local CLI or a self-hosted runner** : keep the host in that allowlist. See [network access requirements](</docs/en/network-config#network-access-requirements>) and the self-hosted [network requirements](</docs/en/self-hosted-environments-deploy#network-requirements>). @@ -252,8 +252,8 @@ * **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 `gh` under the `proxy-injected` placeholder, go out with your real credentials substituted. * **Push restrictions** : the proxy rejects branch deletions and pushes of anything other than a branch, such as a tag. It doesn’t limit which branches a push can update. To do that, use branch protection rules or rulesets on GitHub. - * **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. - * **GraphQL restrictions** : the proxy serves only a pinned set of GraphQL operations for pull-request workflows. The proxy rejects everything else on the GraphQL endpoint with a 403 that says `This GraphQL query is not enabled for this session` and names the REST fallback, `gh api repos/{owner}/{repo}/...`. The restriction applies to every request through the proxy regardless of the credentials you supply, so a `GH_TOKEN` you set gets the same 403. Claude can’t reach GitHub APIs that exist only in GraphQL, such as Projects v2, through the proxy. + * **Repository scope** : the proxy serves GitHub API requests for the repositories attached to the session. An API request for another repository gets a 403 whose message starts with `GitHub access to` and contains `is not enabled for this session`. + * **GraphQL restrictions** : the proxy rejects requests to GitHub’s GraphQL endpoint with a 403 whose message starts with `GitHub GraphQL is not available from Claude Code sessions` and names the REST fallback, `gh api repos/{owner}/{repo}/...`. `gh` subcommands that use GraphQL, such as `gh pr` and `gh issue`, get the same 403. The restriction applies to every request through the proxy regardless of the credentials you supply, so a `GH_TOKEN` you set gets the same 403. Claude can’t reach GitHub APIs that exist only in GraphQL, such as Projects v2, through the proxy. Committed files from public repositories arrive through `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. @@ -267,8 +267,6 @@ * Protection against malicious requests * Rate limiting and abuse prevention - * Content filtering for enhanced security - * A DNS-level audit trail of requested hostnames ## @@ -297,15 +295,31 @@ Your repo’s `.claude/skills/`, `.claude/agents/`, `.claude/commands/`| Yes| Part of the clone Plugins and marketplaces declared in your repo’s `.claude/settings.json`| No| A cloud session doesn’t install the plugins a repository turns on under [`enabledPlugins`](</docs/en/settings-reference#enabledplugins>), including ones from the marketplaces it lists under [`extraKnownMarketplaces`](</docs/en/settings-reference#extraknownmarketplaces>) Your organization’s [server-managed settings](</docs/en/server-managed-settings>)| Yes, except in [Claude Tag](<https://claude.com/docs/claude-tag/overview>) sessions| Fetched from Anthropic’s servers when the session starts. See [Surface coverage](</docs/en/model-config#surface-coverage>) for how `availableModels` is enforced in cloud sessions. Settings deployed to your device through MDM or managed settings files don’t apply, because the session runs on an Anthropic-managed VM; in a [self-hosted environment](</docs/en/self-hosted-environments>), sessions also read the managed settings file in the runner image, per [how Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) -Your user `~/.claude/CLAUDE.md`| No| Lives on your machine, not in the repo +Your user `~/.claude/CLAUDE.md`| No| Lives on your machine, not in the repo. See Add personal preferences without committing to the repo Your user `~/.claude/skills/`, `~/.claude/agents/`, `~/.claude/commands/`| No| Live on your machine, not in the repo. Commit them to the repo’s `.claude/` directory instead. Cloud sessions automatically load skills you enable on claude.ai Plugins enabled only in your user settings| No| User-scoped `enabledPlugins` lives in `~/.claude/settings.json` on your machine MCP servers you added with `claude mcp add` at the default local scope or the user scope| No| Those write to `~/.claude.json` on your machine, not the repo. Add the server with `claude mcp add --scope project`, which writes the repo’s [`.mcp.json`](</docs/en/mcp#project-scope>), and commit that file. A session with one repository loads it Transport variables in your repo’s `.claude/settings.json` `env` block, such as `NODE_EXTRA_CA_CERTS` and the [mTLS client certificate variables](</docs/en/network-config#mtls-authentication>)| No| The hosting environment manages the session’s API connection, so Claude Code ignores these keys and notes each ignored key in the session’s debug log -API keys and tokens for services Claude calls| On Pro and Max plans, as API credentials| You add the key once on the environment and the agent proxy attaches it to requests for the hosts you list. A key the agent proxy can’t attach, or any key on a Team or Enterprise plan, stays in an environment variable +API keys and tokens for services Claude calls| On Pro and Max plans, as network secrets| You add the key once on the environment and the agent proxy attaches it to requests for the hosts you list. A key the agent proxy can’t attach, or any key on a Team or Enterprise plan, stays in an environment variable Interactive auth like AWS SSO| No| Not supported. SSO requires browser-based login that can’t run in a cloud session -To make your own configuration available in cloud sessions, commit it to the repo. Anyone who uses the environment can read its environment variables and setup script. The dialog’s note under **Environment variables** says so and warns against putting secrets there. On Pro and Max plans, store a key the agent proxy can attach as an API credential instead. +To make your own configuration available in cloud sessions, commit it to the repo. Anyone who uses the environment can read its environment variables and setup script. The dialog’s note under **Environment variables** says so and warns against putting secrets there. On Pro and Max plans, store a key the agent proxy can attach as a network secret instead. + +#### + +​ + +Add personal preferences without committing to the repo + +In an Anthropic-hosted environment, add a setup script that writes `~/.claude/CLAUDE.md` for preferences you’d rather not put in a shared repository. Claude Code loads that file as [user instructions](</docs/en/memory#choose-where-to-put-claude-md-files>) in the session. This example sets a commit-message preference: + + #!/bin/bash + mkdir -p ~/.claude + cat > ~/.claude/CLAUDE.md <<'EOF' + Use conventional commit messages. + EOF + +Put the script on one of your own environments rather than a shared one. Run `/context` in your next cloud session and confirm `/root/.claude/CLAUDE.md` appears under **Memory files**. ### @@ -340,9 +354,9 @@ 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](</docs/en/claude-code-on-the-web#github-authentication-options>), so your token never enters the container. You can set `GH_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 [`gh` CLI](<https://cli.github.com>) 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-injected` in the commands Claude runs, and the proxy substitutes your real credentials on outbound GitHub requests. `gh` works without a token of your own, but a script that reads `GITHUB_TOKEN` directly gets the placeholder, not a usable token. - -A token you set is an ordinary environment variable, so anyone who uses the environment can read it; the proxy path keeps the credential out of the environment configuration and the session VM. To check which case applies to your session, ask Claude to run `echo $GH_TOKEN`. GitHub’s [`gh` CLI](<https://cli.github.com>) is pre-installed. If you need a `gh` command the built-in tools don’t cover, like `gh release` or `gh workflow run`, ask Claude to run it. `gh` reads `GH_TOKEN` automatically, so you don’t need to run `gh auth login`. + * If you set neither and the GitHub proxy is handling authentication for your session, both variables read as the placeholder string `proxy-injected` in the commands Claude runs, and the proxy substitutes your real credentials on outbound GitHub requests. `gh api` calls for attached repositories work without a token of your own, but a script that reads `GITHUB_TOKEN` directly gets the placeholder, not a usable token. + +A token you set is an ordinary environment variable, so anyone who uses the environment can read it; the proxy path keeps the credential out of the environment configuration and the session VM. To check which case applies to your session, ask Claude to run `echo $GH_TOKEN`. GitHub’s [`gh` CLI](<https://cli.github.com>) is pre-installed. If you need a GitHub operation the built-in tools don’t cover, ask Claude to call the REST API with `gh api`. `gh` subcommands that use the REST API, such as `gh workflow list`, work too. The proxy rejects subcommands that use GraphQL, such as `gh pr` and `gh issue`. `gh` reads `GH_TOKEN` automatically, so you don’t need to run `gh auth login`. ###
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -14,7 +14,7 @@ * **CLI flows such as`/web-setup`**: create **Default** for you * **Web onboarding on Pro and Max** : creates **Default** for you - * **Web onboarding on Team and Enterprise** : shows a **Create your first cloud environment** form unless an Owner has turned on [Quick web setup](</docs/en/claude-code-on-the-web#quick-web-setup-for-team-and-enterprise>); keep the form’s defaults and click **Create & finish** to get the same **Default** environment + * **Web onboarding on Team and Enterprise** : shows a **Create your first cloud environment** form unless an Owner has turned on [Quick setup](</docs/en/claude-code-on-the-web#quick-setup-for-team-and-enterprise>); keep the form’s defaults and click **Create & finish** to get the same **Default** environment **Default** carries no configuration of its own:
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -14,7 +14,7 @@ * **CLI flows such as`/web-setup`**: create **Default** for you * **Web onboarding on Pro and Max** : creates **Default** for you - * **Web onboarding on Team and Enterprise** : shows a **Create your first cloud environment** form unless an Owner has turned on [Quick web setup](</docs/en/claude-code-on-the-web#github-authentication-options>); keep the form’s defaults and click **Create & finish** to get the same **Default** environment + * **Web onboarding on Team and Enterprise** : shows a **Create your first cloud environment** form unless an Owner has turned on [Quick web setup](</docs/en/claude-code-on-the-web#quick-web-setup-for-team-and-enterprise>); keep the form’s defaults and click **Create & finish** to get the same **Default** environment **Default** carries no configuration of its own:
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -96,13 +96,13 @@ Add a credential -You add credentials one at a time from the editor of an environment that already exists. The dialog for a new environment doesn’t offer them. There’s no edit, either. To change a credential’s hosts or value, delete it and add it again. +You add credentials one at a time, and you can’t edit a credential after you add it. To change a credential’s hosts or value, delete it and add it again. 1 Open the environment's API credentials -Open the environment for editing at [claude.ai/code](<https://claude.ai/code>). In the **Edit cloud environment** dialog, find **API credentials** below **Environment variables**. You see the credentials already on the environment, each with the hosts it applies to. +Open the environment for editing at [claude.ai/code](<https://claude.ai/code>). In the **Edit environment** dialog, find the **API credentials** section. You see the credentials already on the environment, each with the hosts it applies to. 2
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -46,7 +46,7 @@ Add or edit an environment -Select **Add cloud environment** , or hover over an existing environment and select the settings icon that appears on the right. The dialog includes the name, network access level, environment variables, and setup script. When you edit an existing cloud environment on a Pro or Max plan, the dialog also includes API credentials. +Select **Cloud** to list your environments. Then select **Add cloud environment** , or hover over an existing environment and select the settings icon that appears on the right.The dialog includes the name, network access level, environment variables, and setup script. When you edit an existing cloud environment on a Pro or Max plan, the dialog also includes API credentials. ### @@ -86,7 +86,6 @@ * **Role** : an organization admin role in your claude.ai organization * On Team and Enterprise, Owners hold it and Admins don’t * On Pro and Max, you hold it in your own organization - * Without it, you see a note instead of the credential list, on your own environments too. Ask an Owner to add the credential to a shared environment and run your sessions there * **Environment type** : an Anthropic-hosted cloud environment that already exists. A [self-hosted environment](</docs/en/self-hosted-environments>) doesn’t have API credentials * **API reachability** : the API accepts connections from the internet, because requests leave from Anthropic’s network * **Encryption keys** : if your organization uses customer-managed encryption keys, you can’t save credentials @@ -103,7 +102,7 @@ Open the environment's API credentials -Open the environment for editing at [claude.ai/code](<https://claude.ai/code>). In the **Update cloud environment** dialog, find **API credentials** below **Environment variables**. You see the credentials already on the environment, each with the hosts it applies to. +Open the environment for editing at [claude.ai/code](<https://claude.ai/code>). In the **Edit cloud environment** dialog, find **API credentials** below **Environment variables**. You see the credentials already on the environment, each with the hosts it applies to. 2 @@ -252,7 +251,7 @@ * **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 `gh` under the `proxy-injected` placeholder, go out with your real credentials substituted. - * **Push protection** : `git push` works only against the session’s current working branch; cloning, fetching, and PR operations work normally. + * **Push restrictions** : the proxy rejects branch deletions and pushes of anything other than a branch, such as a tag. It doesn’t limit which branches a push can update. To do that, use branch protection rules or rulesets on GitHub. * **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. * **GraphQL restrictions** : the proxy serves only a pinned set of GraphQL operations for pull-request workflows. The proxy rejects everything else on the GraphQL endpoint with a 403 that says `This GraphQL query is not enabled for this session` and names the REST fallback, `gh api repos/{owner}/{repo}/...`. The restriction applies to every request through the proxy regardless of the credentials you supply, so a `GH_TOKEN` you set gets the same 403. Claude can’t reach GitHub APIs that exist only in GraphQL, such as Projects v2, through the proxy.
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -60,7 +60,12 @@ LOG_LEVEL=debug DATABASE_URL=postgres://localhost:5432/myapp -Each session copies the environment’s values once, at startup, into ordinary environment variables that any command Claude runs can read, except `OTEL_*` variables. Claude Code uses those for its own [telemetry export](</docs/en/monitoring-usage#telemetry-from-cloud-sessions-and-claude-tag>) and doesn’t pass them to the commands it runs. Because running sessions don’t re-read the configuration, editing or adding variables affects sessions you start afterward; sessions already running keep the values they started with. A cloud session also sets some variables itself when it starts. For [`CLAUDE_AUTOCOMPACT_PCT_OVERRIDE`](</docs/en/claude-code-on-the-web#manage-context>), 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. On Pro and Max plans, use an API credential instead for a key the agent proxy can attach to a request. The requests that never get a credential are listed there. +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](</docs/en/monitoring-usage#telemetry-from-cloud-sessions-and-claude-tag>) 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](</docs/en/claude-code-on-the-web#environment-expired>), 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`](</docs/en/claude-code-on-the-web#manage-context>), 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. On Pro and Max plans, use an API credential instead for a key the agent proxy can attach to a request. The requests that never get a credential are listed there. ### @@ -192,7 +197,7 @@ 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. A shared environment opens read-only there, so an Owner changes its network access from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>) instead. The cloud icon that opens the selector appears on the app surfaces listed under The Default environment and in the [routine editor](</docs/en/routines#environments-and-network-access>); personal environments don’t have a separate page in your claude.ai account settings. +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. A shared environment opens read-only there, so an Owner changes its network access from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>) instead. The cloud icon that opens the selector appears on the app surfaces listed under The Default environment and in the [routine editor](</docs/en/routines#environments-and-network-access>); personal environments don’t have a separate page in your claude.ai account settings. When you change an Anthropic-hosted environment’s network access, its existing sessions follow the new setting within about a minute, for requests that go through the session’s network allowlist. You don’t need to start a new session. MCP connectors you enable on a session or routine work without adding their hosts to **Allowed domains** , because connector traffic travels through Anthropic’s servers rather than the session’s network. This relies on the same Anthropic-bound channel noted under [Security and isolation](</docs/en/claude-code-on-the-web#security-and-isolation>). Turn off any connector you don’t need to limit which tools Claude can reach. @@ -410,10 +415,10 @@ In Anthropic-hosted environments, these time limits apply to long-running work in a cloud session, such as a build, an install, or a test run. Each entry links to the section that defines the limit. - * **Commands Claude runs** : a cloud environment doesn’t set its own command timeout, so the Bash tool’s defaults apply. Claude waits 2 minutes for a command by default and can ask for up to 10 minutes. When a command reaches its [timeout](</docs/en/tools-reference#timeout-and-output-limits>), Claude Code [moves it to the background](</docs/en/tools-reference#background-commands>) instead of stopping it, unless the command starts with `sleep`. + * **Commands Claude runs** : a cloud environment doesn’t set its own command timeout, so the Bash tool’s defaults apply. Claude waits 2 minutes for a foreground command by default and can ask for up to 10 minutes. When a command reaches its [timeout](</docs/en/tools-reference#timeout-and-output-limits>), Claude Code [moves it to the background](</docs/en/tools-reference#foreground-commands-that-move-to-the-background>) instead of stopping it, unless the command starts with `sleep`. A command moved this way can keep running for up to 30 more minutes before Claude Code stops it at its [background time limit](</docs/en/tools-reference#time-limit-for-background-commands>). Setting `BASH_DEFAULT_TIMEOUT_MS` above `1800000` milliseconds lengthens that limit as well as the foreground default. * **SessionStart hooks** : Claude Code cancels a `command` hook after 600 seconds unless you set [`timeout`](</docs/en/hooks#common-fields>), in seconds, on the hook entry. Claude Code doesn’t enforce the timeout on a hook you run with [`async: true`](</docs/en/hooks#run-hooks-in-the-background>). * **Setup script** : a script that takes longer than roughly five minutes isn’t cached. Script requirements covers how to stay under that. - * **Idle sessions** : a session stops after a period of inactivity and its VM is reclaimed. [Environment expired](</docs/en/claude-code-on-the-web#environment-expired>) covers what counts as inactive and how to reopen the session. + * **Idle sessions** : after a few minutes without activity, a session’s VM pauses with its files saved, and a paused VM can later be reclaimed. Set environment variables describes what a session picks up in each case, and [Environment expired](</docs/en/claude-code-on-the-web#environment-expired>) covers how to reopen a session whose VM was reclaimed. To raise the command timeouts for an environment’s sessions, add [`BASH_DEFAULT_TIMEOUT_MS` and `BASH_MAX_TIMEOUT_MS`](</docs/en/env-vars#variables>) to its environment variables. Both take milliseconds. For example, `BASH_DEFAULT_TIMEOUT_MS=600000` makes 10 minutes the default. @@ -446,7 +451,7 @@ Environment caching -The setup script runs the first time you start a session in an environment. When setup completes within roughly five minutes, 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. If setup takes longer than roughly five minutes, the environment isn’t cached. 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, a `docker 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. +The setup script runs the first time you start a session in an environment. When setup completes within roughly five minutes, 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. If setup takes longer than roughly five minutes, the environment isn’t cached. 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, a `docker 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. In an Anthropic-hosted environment, the setup script doesn’t run when a session’s VM is restored after being idle, so a change to the script reaches an existing session only when its VM was [reclaimed](</docs/en/claude-code-on-the-web#environment-expired>) and is rebuilt. To apply a change right away, run the commands in the session or start a new session. You don’t need to enable caching or manage snapshots yourself. ###
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -536,6 +536,10 @@ * platform.claude.com * code.claude.com * claude.ai + * claude.com + * support.claude.com + * anthropic.com + * [www.anthropic.com](<http://www.anthropic.com>) Version control @@ -566,6 +570,7 @@ * hub.docker.com * [www.docker.com](<http://www.docker.com>) * production.cloudflare.docker.com + * production.cloudfront.docker.com * download.docker.com * gcr.io * *.gcr.io
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -60,7 +60,7 @@ LOG_LEVEL=debug DATABASE_URL=postgres://localhost:5432/myapp -Each session copies the environment’s values once, at startup, into ordinary environment variables that any command Claude runs can read. Because running sessions don’t re-read the configuration, editing or adding variables affects sessions you start afterward; sessions already running keep the values they started with. A cloud session also sets some variables itself when it starts. For [`CLAUDE_AUTOCOMPACT_PCT_OVERRIDE`](</docs/en/claude-code-on-the-web#manage-context>), 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. On Pro and Max plans, use an API credential instead for a key the agent proxy can attach to a request. The requests that never get a credential are listed there. +Each session copies the environment’s values once, at startup, into ordinary environment variables that any command Claude runs can read, except `OTEL_*` variables. Claude Code uses those for its own [telemetry export](</docs/en/monitoring-usage#telemetry-from-cloud-sessions-and-claude-tag>) and doesn’t pass them to the commands it runs. Because running sessions don’t re-read the configuration, editing or adding variables affects sessions you start afterward; sessions already running keep the values they started with. A cloud session also sets some variables itself when it starts. For [`CLAUDE_AUTOCOMPACT_PCT_OVERRIDE`](</docs/en/claude-code-on-the-web#manage-context>), 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. On Pro and Max plans, use an API credential instead for a key the agent proxy can attach to a request. The requests that never get a credential are listed there. ### @@ -139,6 +139,7 @@ * **GitHub** : the GitHub proxy authenticates requests to GitHub instead, so you don’t need an API credential for it * **The Anthropic API and public package registries** : `api.anthropic.com`, `registry.npmjs.org`, `jsr.io`, `npm.jsr.io`, `pypi.org`, `files.pythonhosted.org`, `index.crates.io`, and `proxy.golang.org` * **Setup script requests** : Claude Code connects to the agent proxy when it launches, after the setup script has run + * **Claude Code’s telemetry export** : Claude Code sends its [telemetry export](</docs/en/monitoring-usage#telemetry-from-cloud-sessions-and-claude-tag>) itself rather than through a command it runs, and that request doesn’t go through the agent proxy ### @@ -234,7 +235,7 @@ * **Sessions in this environment open another organization’s public artifacts** : Claude Code fetches those from the host directly, so add it to this list. * **You’re configuring the local CLI or a self-hosted runner** : keep the host in that allowlist. See [network access requirements](</docs/en/network-config#network-access-requirements>) and the self-hosted [network requirements](</docs/en/self-hosted-environments-deploy#network-requirements>). -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](</docs/en/server-managed-settings>) still apply inside cloud sessions, but none of them adds domains to the environment’s network allowlist. To give a team one standard list, an Owner can create an organization-shared environment with **Custom** network access and that list. +Each environment has its own allowed-domains list; there’s no organization-level allowlist that admins can push to every member’s environments. No [server-managed setting](</docs/en/server-managed-settings>) adds domains to an environment’s network allowlist either. To give a team one standard list, an Owner can create an organization-shared environment with **Custom** network access and that list. ### @@ -291,7 +292,7 @@ Your repo’s `.claude/rules/`| Yes| Part of the clone Your repo’s `.claude/skills/`, `.claude/agents/`, `.claude/commands/`| Yes| Part of the clone Plugins and marketplaces declared in your repo’s `.claude/settings.json`| No| A cloud session doesn’t install the plugins a repository turns on under [`enabledPlugins`](</docs/en/settings-reference#enabledplugins>), including ones from the marketplaces it lists under [`extraKnownMarketplaces`](</docs/en/settings-reference#extraknownmarketplaces>) -Your organization’s [server-managed settings](</docs/en/server-managed-settings>)| Yes| Fetched from Anthropic’s servers when the session starts. See [Surface coverage](</docs/en/model-config#surface-coverage>) for how `availableModels` is enforced in cloud sessions. Settings deployed to your device through MDM or managed settings files don’t apply, because the session runs on an Anthropic-managed VM; in a [self-hosted environment](</docs/en/self-hosted-environments>), sessions also read the managed settings file in the runner image, per [how Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) +Your organization’s [server-managed settings](</docs/en/server-managed-settings>)| Yes, except in [Claude Tag](<https://claude.com/docs/claude-tag/overview>) sessions| Fetched from Anthropic’s servers when the session starts. See [Surface coverage](</docs/en/model-config#surface-coverage>) for how `availableModels` is enforced in cloud sessions. Settings deployed to your device through MDM or managed settings files don’t apply, because the session runs on an Anthropic-managed VM; in a [self-hosted environment](</docs/en/self-hosted-environments>), sessions also read the managed settings file in the runner image, per [how Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) Your user `~/.claude/CLAUDE.md`| No| Lives on your machine, not in the repo Your user `~/.claude/skills/`, `~/.claude/agents/`, `~/.claude/commands/`| No| Live on your machine, not in the repo. Commit them to the repo’s `.claude/` directory instead. Cloud sessions automatically load skills you enable on claude.ai Plugins enabled only in your user settings| No| User-scoped `enabledPlugins` lives in `~/.claude/settings.json` on your machine @@ -463,7 +464,7 @@ If you have SessionStart hooks in your user-level `~/.claude/settings.json`, don’t expect them in the cloud. User-level settings stay on your machine. Which other hooks run depends on where the session runs: - * **Anthropic-hosted environment** : Claude Code runs hooks from the repository and from your organization’s [server-managed settings](</docs/en/server-managed-settings>). + * **Anthropic-hosted environment** : Claude Code runs hooks from the repository and from your organization’s [server-managed settings](</docs/en/server-managed-settings>). [Claude Tag](<https://claude.com/docs/claude-tag/overview>) sessions don’t receive server-managed settings, so hooks from server-managed settings don’t run there. * **[Self-hosted environment](</docs/en/self-hosted-environments-configuration#permissions-and-tool-approval>)** : Claude Code also runs the hooks the operator seeded from the runner host’s `~/.claude/`, and the hooks in the runner image’s managed settings file when that file is one of the [managed sources Claude Code applies](</docs/en/managed-settings#how-claude-code-combines-managed-sources>). ### @@ -791,4 +792,4 @@ * [Remote Control](</docs/en/remote-control>): run sessions on your own machine’s network and files instead * [Self-hosted environments](</docs/en/self-hosted-environments>): run cloud sessions on your organization’s own infrastructure * [SessionStart hooks](</docs/en/hooks#sessionstart>): repo-committed setup that runs in local and cloud sessions - * [Server-managed settings](</docs/en/server-managed-settings>): organization policy that reaches cloud sessions + * [Server-managed settings](</docs/en/server-managed-settings>): organization policy delivered from the admin console
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -271,7 +271,7 @@ What’s available in cloud sessions -In Anthropic-hosted environments, each session gets a fresh virtual machine (VM) running Ubuntu 24.04 on x86_64, regardless of your own operating system and CPU architecture, with your repository cloned and common toolchains pre-installed. When a dependency provides precompiled binaries, such as Ruby gems with native extensions or prebuilt Python wheels, use its x86_64 Linux build to match the VM. This section covers the Anthropic-hosted defaults, the built-in GitHub tools, how to run tests and services, and the resource limits each VM gets. +In Anthropic-hosted environments, each session gets a fresh virtual machine (VM) running Ubuntu 24.04 on x86_64, regardless of your own operating system and CPU architecture, with your repository cloned and common toolchains pre-installed. When a dependency provides precompiled binaries, such as Ruby gems with native extensions or prebuilt Python wheels, use its x86_64 Linux build to match the VM. This section covers the Anthropic-hosted defaults, the built-in GitHub tools, how to run tests and services, the resource limits each VM gets, and the time limits on long-running work. Sessions your organization routes to a [self-hosted environment](</docs/en/self-hosted-environments>) run on your own runners instead, with the tools your runner image provides. @@ -401,6 +401,21 @@ The VM may stop tasks that need significantly more memory, such as large build jobs or memory-intensive tests. For workloads beyond these limits, use [Remote Control](</docs/en/remote-control>) to run Claude Code on your own hardware, or run cloud sessions in a [self-hosted environment](</docs/en/self-hosted-environments>) on compute your organization operates. +### + +​ + +Time limits + +In Anthropic-hosted environments, these time limits apply to long-running work in a cloud session, such as a build, an install, or a test run. Each entry links to the section that defines the limit. + + * **Commands Claude runs** : a cloud environment doesn’t set its own command timeout, so the Bash tool’s defaults apply. Claude waits 2 minutes for a command by default and can ask for up to 10 minutes. When a command reaches its [timeout](</docs/en/tools-reference#timeout-and-output-limits>), Claude Code [moves it to the background](</docs/en/tools-reference#background-commands>) instead of stopping it, unless the command starts with `sleep`. + * **SessionStart hooks** : Claude Code cancels a `command` hook after 600 seconds unless you set [`timeout`](</docs/en/hooks#common-fields>), in seconds, on the hook entry. Claude Code doesn’t enforce the timeout on a hook you run with [`async: true`](</docs/en/hooks#run-hooks-in-the-background>). + * **Setup script** : a script that takes longer than roughly five minutes isn’t cached. Script requirements covers how to stay under that. + * **Idle sessions** : a session stops after a period of inactivity and its VM is reclaimed. [Environment expired](</docs/en/claude-code-on-the-web#environment-expired>) covers what counts as inactive and how to reopen the session. + +To raise the command timeouts for an environment’s sessions, add [`BASH_DEFAULT_TIMEOUT_MS` and `BASH_MAX_TIMEOUT_MS`](</docs/en/env-vars#variables>) to its environment variables. Both take milliseconds. For example, `BASH_DEFAULT_TIMEOUT_MS=600000` makes 10 minutes the default. + ## ​ @@ -421,7 +436,7 @@ A setup script has three constraints to write around: * **Exit zero** : if the script exits non-zero, the session fails to start. Append `|| true` to 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 `&` and `wait`, and move any single download that won’t fit into a SessionStart hook that launches it in the background. + * **Finish within five minutes** : keep the script’s total runtime under roughly five minutes so the environment cache can build. When setup takes longer than that, the environment isn’t cached. Run independent installs in parallel with `&` and `wait`, and move any single download that won’t fit into a SessionStart hook that launches it in the background. If new sessions stall or fail during setup, see [New sessions hang or time out during setup](</docs/en/web-quickstart#new-sessions-hang-or-time-out-during-setup>). * **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. ### @@ -430,7 +445,7 @@ 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, a `docker 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. +The setup script runs the first time you start a session in an environment. When setup completes within roughly five minutes, 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. If setup takes longer than roughly five minutes, the environment isn’t cached. 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, a `docker 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. ###
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -290,11 +290,11 @@ Your repo’s `.mcp.json` MCP servers| Yes, in a session with one repository| Part of the clone, found from the session’s working directory Your repo’s `.claude/rules/`| Yes| Part of the clone Your repo’s `.claude/skills/`, `.claude/agents/`, `.claude/commands/`| Yes| Part of the clone -Plugins and marketplaces declared in your repo’s `.claude/settings.json`| No| A cloud session doesn’t install the plugins a repository turns on under [`enabledPlugins`](</docs/en/settings-reference#enabledplugins>), including ones from the marketplaces it lists under [`extraKnownMarketplaces`](</docs/en/settings-reference#extraknownmarketplaces>). Enable the plugin for your claude.ai account instead, so Claude Code loads it as a [synced plugin](</docs/en/plugins-reference#synced-plugins>) +Plugins and marketplaces declared in your repo’s `.claude/settings.json`| No| A cloud session doesn’t install the plugins a repository turns on under [`enabledPlugins`](</docs/en/settings-reference#enabledplugins>), including ones from the marketplaces it lists under [`extraKnownMarketplaces`](</docs/en/settings-reference#extraknownmarketplaces>) Your organization’s [server-managed settings](</docs/en/server-managed-settings>)| Yes| Fetched from Anthropic’s servers when the session starts. See [Surface coverage](</docs/en/model-config#surface-coverage>) for how `availableModels` is enforced in cloud sessions. Settings deployed to your device through MDM or managed settings files don’t apply, because the session runs on an Anthropic-managed VM; in a [self-hosted environment](</docs/en/self-hosted-environments>), sessions also read the managed settings file in the runner image, per [how Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) Your user `~/.claude/CLAUDE.md`| No| Lives on your machine, not in the repo Your user `~/.claude/skills/`, `~/.claude/agents/`, `~/.claude/commands/`| No| Live on your machine, not in the repo. Commit them to the repo’s `.claude/` directory instead. Cloud sessions automatically load skills you enable on claude.ai -Plugins enabled only in your user settings| No| User-scoped `enabledPlugins` lives in `~/.claude/settings.json` on your machine. Enable them for your claude.ai account instead, so Claude Code loads them as [synced plugins](</docs/en/plugins-reference#synced-plugins>) +Plugins enabled only in your user settings| No| User-scoped `enabledPlugins` lives in `~/.claude/settings.json` on your machine MCP servers you added with `claude mcp add` at the default local scope or the user scope| No| Those write to `~/.claude.json` on your machine, not the repo. Add the server with `claude mcp add --scope project`, which writes the repo’s [`.mcp.json`](</docs/en/mcp#project-scope>), and commit that file. A session with one repository loads it Transport variables in your repo’s `.claude/settings.json` `env` block, such as `NODE_EXTRA_CA_CERTS` and the [mTLS client certificate variables](</docs/en/network-config#mtls-authentication>)| No| The hosting environment manages the session’s API connection, so Claude Code ignores these keys and notes each ignored key in the session’s debug log API keys and tokens for services Claude calls| On Pro and Max plans, as API credentials| You add the key once on the environment and the agent proxy attaches it to requests for the hosts you list. A key the agent proxy can’t attach, or any key on a Team or Enterprise plan, stays in an environment variable
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -1,4 +1,4 @@ -Cloud environments apply to [cloud sessions](</docs/en/claude-code-on-the-web>), which are in research preview for Pro, Max, and Team users, and for Enterprise users with [premium seats or Chat + Claude Code seats](<https://support.claude.com/en/articles/11845131-use-claude-code-with-your-team-or-enterprise-plan>). +Cloud environments apply to [cloud sessions](</docs/en/claude-code-on-the-web>), which are available on Pro, Max, and Team plans, and for Enterprise users with [premium seats or Chat + Claude Code seats](<https://support.claude.com/en/articles/11845131-use-claude-code-with-your-team-or-enterprise-plan>). Each [cloud session](</docs/en/claude-code-on-the-web>) runs in a cloud environment. You can configure an environment to allow or deny network access, set environment variables for the session, on Pro and Max plans store API credentials 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](</docs/en/desktop>), the [Claude mobile app](</docs/en/mobile>), your browser at [claude.ai/code](<https://claude.ai/code>), the terminal with [`claude --cloud`](</docs/en/claude-code-on-the-web#from-terminal-to-cloud>), [routines](</docs/en/routines>), and [Claude Tag](<https://claude.com/docs/claude-tag/overview>). Each of these surfaces can also route to a [self-hosted environment](</docs/en/self-hosted-environments>). [Availability and limitations](</docs/en/self-hosted-environments#availability-and-limitations>) covers what Claude can’t use yet when a Claude Tag session runs in one.
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -290,11 +290,11 @@ Your repo’s `.mcp.json` MCP servers| Yes, in a session with one repository| Part of the clone, found from the session’s working directory Your repo’s `.claude/rules/`| Yes| Part of the clone Your repo’s `.claude/skills/`, `.claude/agents/`, `.claude/commands/`| Yes| Part of the clone -Plugins declared in `.claude/settings.json`| Yes| Installed at session start from the [marketplace](</docs/en/plugin-marketplaces>) you declared. Requires network access to reach the marketplace source +Plugins and marketplaces declared in your repo’s `.claude/settings.json`| No| A cloud session doesn’t install the plugins a repository turns on under [`enabledPlugins`](</docs/en/settings-reference#enabledplugins>), including ones from the marketplaces it lists under [`extraKnownMarketplaces`](</docs/en/settings-reference#extraknownmarketplaces>). Enable the plugin for your claude.ai account instead, so Claude Code loads it as a [synced plugin](</docs/en/plugins-reference#synced-plugins>) Your organization’s [server-managed settings](</docs/en/server-managed-settings>)| Yes| Fetched from Anthropic’s servers when the session starts. See [Surface coverage](</docs/en/model-config#surface-coverage>) for how `availableModels` is enforced in cloud sessions. Settings deployed to your device through MDM or managed settings files don’t apply, because the session runs on an Anthropic-managed VM; in a [self-hosted environment](</docs/en/self-hosted-environments>), sessions also read the managed settings file in the runner image, per [how Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) Your user `~/.claude/CLAUDE.md`| No| Lives on your machine, not in the repo Your user `~/.claude/skills/`, `~/.claude/agents/`, `~/.claude/commands/`| No| Live on your machine, not in the repo. Commit them to the repo’s `.claude/` directory instead. Cloud sessions automatically load skills you enable on claude.ai -Plugins enabled only in your user settings| No| User-scoped `enabledPlugins` lives in `~/.claude/settings.json`. Declare them in the repo’s `.claude/settings.json` instead, or enable them for your claude.ai account so Claude Code loads them as [synced plugins](</docs/en/plugins-reference#synced-plugins>) +Plugins enabled only in your user settings| No| User-scoped `enabledPlugins` lives in `~/.claude/settings.json` on your machine. Enable them for your claude.ai account instead, so Claude Code loads them as [synced plugins](</docs/en/plugins-reference#synced-plugins>) MCP servers you added with `claude mcp add` at the default local scope or the user scope| No| Those write to `~/.claude.json` on your machine, not the repo. Add the server with `claude mcp add --scope project`, which writes the repo’s [`.mcp.json`](</docs/en/mcp#project-scope>), and commit that file. A session with one repository loads it Transport variables in your repo’s `.claude/settings.json` `env` block, such as `NODE_EXTRA_CA_CERTS` and the [mTLS client certificate variables](</docs/en/network-config#mtls-authentication>)| No| The hosting environment manages the session’s API connection, so Claude Code ignores these keys and notes each ignored key in the session’s debug log API keys and tokens for services Claude calls| On Pro and Max plans, as API credentials| You add the key once on the environment and the agent proxy attaches it to requests for the hosts you list. A key the agent proxy can’t attach, or any key on a Team or Enterprise plan, stays in an environment variable
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -154,7 +154,7 @@ 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: +To archive one of your own environments, open it for editing and select **Archive**. An Owner archives a shared environment from the **Cloud environments** page in admin settings. 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. @@ -167,7 +167,12 @@ Organization-shared environments -On Team and Enterprise plans, an Owner can create cloud environments that are shared with every member of the organization. The same role manages everything else on the **Cloud environments** admin page, including [self-hosted environments](</docs/en/self-hosted-environments>); the Admin role can’t open the page. The full list of roles that can open it is the one for [managing server-managed settings](</docs/en/server-managed-settings#access-control>). 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](<https://claude.ai/admin-settings>). A shared environment also opens from the environment selector at [claude.ai/code](<https://claude.ai/code>): an Owner can edit it there. Other members see it read-only. Each shared environment has a name, a network access level, environment variables in `.env` format, and a setup script. Owners choose the organization’s default environment separately, at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). Every member’s sessions in a shared environment read its variables, so don’t include secrets in them. API credentials, which give sessions a key they can’t read, aren’t available on Team or Enterprise plans yet. +On Team and Enterprise plans, an Owner can create cloud environments that are shared with every member of the organization. The same role manages everything else on the **Cloud environments** admin page, including [self-hosted environments](</docs/en/self-hosted-environments>); the Admin role can’t open the page. The full list of roles that can open it is the one for [managing server-managed settings](</docs/en/server-managed-settings#access-control>). Shared environments appear in each member’s environment selector under an **Organization** heading, after the member’s own environments under **Personal** , so a team can standardize on one configuration instead of each member recreating it. Selecting a shared environment’s settings icon there opens a read-only summary of its configuration for every member, Owners included. An Owner makes an environment available to the organization in one of two ways: + + * **Create a shared environment** : use the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>), which is also where Owners edit and archive shared environments. Each one has a name, a network access level, environment variables in `.env` format, and a setup script. + * **Share a personal environment** : open one of your own environments for editing in the environment selector, then share it from the **Who can use it** row. The environment keeps its ID, so sessions and routines that already use it aren’t affected, and every member can then see it and start sessions in it. + +Owners choose the organization’s default environment separately, at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). Every member’s sessions in a shared environment read its variables, so don’t include secrets in them. API credentials, which give sessions a key they can’t read, aren’t available on Team or Enterprise plans yet. ### @@ -186,7 +191,7 @@ 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](</docs/en/routines#environments-and-network-access>); personal environments don’t have a separate page in your claude.ai account settings. +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. A shared environment opens read-only there, so an Owner changes its network access from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>) instead. The cloud icon that opens the selector appears on the app surfaces listed under The Default environment and in the [routine editor](</docs/en/routines#environments-and-network-access>); personal environments don’t have a separate page in your claude.ai account settings. MCP connectors you enable on a session or routine work without adding their hosts to **Allowed domains** , because connector traffic travels through Anthropic’s servers rather than the session’s network. This relies on the same Anthropic-bound channel noted under [Security and isolation](</docs/en/claude-code-on-the-web#security-and-isolation>). Turn off any connector you don’t need to limit which tools Claude can reach. @@ -340,7 +345,7 @@ 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 the `CLAUDE_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. To omit the trailer and the PR-body link, set [`attribution.sessionUrl`](</docs/en/settings-reference#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: +Each cloud session has a transcript URL on claude.ai, and the session can read its own ID from the `CLAUDE_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. To omit the trailer and the PR-body link, set [`attribution.sessionUrl`](</docs/en/settings-reference#attribution-sessionurl>) to `false`. 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: echo "https://claude.ai/code/${CLAUDE_CODE_REMOTE_SESSION_ID/#cse_/session_}"
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -23,7 +23,7 @@ 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 use the environment shown in the selector. An organization default set by an Owner fills the selection when you haven’t picked one. + * 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](</docs/en/claude-projects#project-settings-reference>) 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](</docs/en/remote-control>) registers to represent your own machine rather than a cloud environment. For a [self-hosted environment](</docs/en/self-hosted-environments>), passing `--environment <environment-id>` with its `ccpool_` ID [when you dispatch a session](</docs/en/self-hosted-environments-testing#run-the-test-loop>) 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. @@ -188,7 +188,7 @@ 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](</docs/en/routines#environments-and-network-access>); personal environments don’t have a separate page in your claude.ai account settings. -MCP connectors you enable on a session or routine work without adding their hosts to **Allowed domains** , because connector traffic travels through Anthropic’s servers rather than the session’s network. You configure connectors per session or per routine; remove any you don’t need to limit which tools Claude can reach. This relies on the same Anthropic-bound channel noted under [Security and isolation](</docs/en/claude-code-on-the-web#security-and-isolation>). +MCP connectors you enable on a session or routine work without adding their hosts to **Allowed domains** , because connector traffic travels through Anthropic’s servers rather than the session’s network. This relies on the same Anthropic-bound channel noted under [Security and isolation](</docs/en/claude-code-on-the-web#security-and-isolation>). Turn off any connector you don’t need to limit which tools Claude can reach. ### @@ -229,7 +229,7 @@ * **Sessions in this environment open another organization’s public artifacts** : Claude Code fetches those from the host directly, so add it to this list. * **You’re configuring the local CLI or a self-hosted runner** : keep the host in that allowlist. See [network access requirements](</docs/en/network-config#network-access-requirements>) and the self-hosted [network requirements](</docs/en/self-hosted-environments-deploy#network-requirements>). -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](</docs/en/server-managed-settings>) still apply inside cloud sessions, but none of them adds domains to the environment’s network allowlist. +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](</docs/en/server-managed-settings>) still apply inside cloud sessions, but none of them adds domains to the environment’s network allowlist. To give a team one standard list, an Owner can create an organization-shared environment with **Custom** network access and that list. ### @@ -281,8 +281,8 @@ | Available in cloud sessions| Why ---|---|--- Your repo’s `CLAUDE.md`| Yes| Part of the clone -Your repo’s `.claude/settings.json` hooks| Yes| Part of the clone -Your repo’s `.mcp.json` MCP servers| Yes| Part of the clone +Your repo’s `.claude/settings.json` hooks and permission rules| Yes, in a session with one repository| Part of the clone. A session with several repositories, including a [project](</docs/en/claude-projects#what-threads-pick-up-from-your-repositories>) thread, starts above the clones and doesn’t read them +Your repo’s `.mcp.json` MCP servers| Yes, in a session with one repository| Part of the clone, found from the session’s working directory Your repo’s `.claude/rules/`| Yes| Part of the clone Your repo’s `.claude/skills/`, `.claude/agents/`, `.claude/commands/`| Yes| Part of the clone Plugins declared in `.claude/settings.json`| Yes| Installed at session start from the [marketplace](</docs/en/plugin-marketplaces>) you declared. Requires network access to reach the marketplace source @@ -290,7 +290,7 @@ Your user `~/.claude/CLAUDE.md`| No| Lives on your machine, not in the repo Your user `~/.claude/skills/`, `~/.claude/agents/`, `~/.claude/commands/`| No| Live on your machine, not in the repo. Commit them to the repo’s `.claude/` directory instead. Cloud sessions automatically load skills you enable on claude.ai Plugins enabled only in your user settings| No| User-scoped `enabledPlugins` lives in `~/.claude/settings.json`. Declare them in the repo’s `.claude/settings.json` instead, or enable them for your claude.ai account so Claude Code loads them as [synced plugins](</docs/en/plugins-reference#synced-plugins>) -MCP servers you added with `claude mcp add` at the default local scope or the user scope| No| Those write to `~/.claude.json` on your machine, not the repo. Add the server with `claude mcp add --scope project`, which writes the repo’s [`.mcp.json`](</docs/en/mcp#project-scope>), and commit that file +MCP servers you added with `claude mcp add` at the default local scope or the user scope| No| Those write to `~/.claude.json` on your machine, not the repo. Add the server with `claude mcp add --scope project`, which writes the repo’s [`.mcp.json`](</docs/en/mcp#project-scope>), and commit that file. A session with one repository loads it Transport variables in your repo’s `.claude/settings.json` `env` block, such as `NODE_EXTRA_CA_CERTS` and the [mTLS client certificate variables](</docs/en/network-config#mtls-authentication>)| No| The hosting environment manages the session’s API connection, so Claude Code ignores these keys and notes each ignored key in the session’s debug log API keys and tokens for services Claude calls| On Pro and Max plans, as API credentials| You add the key once on the environment and the agent proxy attaches it to requests for the hosts you list. A key the agent proxy can’t attach, or any key on a Team or Enterprise plan, stays in an environment variable Interactive auth like AWS SSO| No| Not supported. SSO requires browser-based login that can’t run in a cloud session @@ -492,6 +492,7 @@ SessionStart hooks behave the same in the cloud as locally, with these caveats: + * **One repository per session** : a session with several repositories doesn’t load hooks from any repository’s `.claude/settings.json`, so a SessionStart hook you define there doesn’t run. Install dependencies for those sessions with a setup script instead. * **No cloud-only scoping** : hooks run in both local and cloud sessions. To skip local execution, exit early unless the `CLAUDE_CODE_REMOTE` environment variable is `true`, the way the dependency install script does. * **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** : in Anthropic-hosted environments, all outbound traffic passes through a security proxy, and some package managers don’t work correctly with it; Bun is a known example. In a [self-hosted environment](</docs/en/self-hosted-environments-deploy#default-deny-egress>), outbound traffic goes through your own network boundary instead.
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -340,7 +340,7 @@ 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 the `CLAUDE_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`](</docs/en/settings-reference#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: +Each cloud session has a transcript URL on claude.ai, and the session can read its own ID from the `CLAUDE_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. To omit the trailer and the PR-body link, set [`attribution.sessionUrl`](</docs/en/settings-reference#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: echo "https://claude.ai/code/${CLAUDE_CODE_REMOTE_SESSION_ID/#cse_/session_}"
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -1,6 +1,6 @@ -Cloud environments require [Claude Code on the web](</docs/en/claude-code-on-the-web>), which is in research preview for Pro, Max, and Team users, and for Enterprise users with [premium seats or Chat + Claude Code seats](<https://support.claude.com/en/articles/11845131-use-claude-code-with-your-team-or-enterprise-plan>). - -Each [cloud session](</docs/en/claude-code-on-the-web>) runs in a cloud environment. You can configure an environment to allow or deny network access, set environment variables for the session, on Pro and Max plans store API credentials 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: [Claude Code on the web](</docs/en/claude-code-on-the-web>), the terminal with [`claude --cloud`](</docs/en/claude-code-on-the-web#from-terminal-to-web>), [Claude Tag](<https://claude.com/docs/claude-tag/overview>), [routines](</docs/en/routines>), the [Claude mobile app](</docs/en/mobile>), and the [Desktop app](</docs/en/desktop>). Each of these surfaces can also route to a [self-hosted environment](</docs/en/self-hosted-environments>). [Availability and limitations](</docs/en/self-hosted-environments#availability-and-limitations>) covers what Claude can’t use yet when a Claude Tag session runs in one. +Cloud environments apply to [cloud sessions](</docs/en/claude-code-on-the-web>), which are in research preview for Pro, Max, and Team users, and for Enterprise users with [premium seats or Chat + Claude Code seats](<https://support.claude.com/en/articles/11845131-use-claude-code-with-your-team-or-enterprise-plan>). + +Each [cloud session](</docs/en/claude-code-on-the-web>) runs in a cloud environment. You can configure an environment to allow or deny network access, set environment variables for the session, on Pro and Max plans store API credentials 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](</docs/en/desktop>), the [Claude mobile app](</docs/en/mobile>), your browser at [claude.ai/code](<https://claude.ai/code>), the terminal with [`claude --cloud`](</docs/en/claude-code-on-the-web#from-terminal-to-cloud>), [routines](</docs/en/routines>), and [Claude Tag](<https://claude.com/docs/claude-tag/overview>). Each of these surfaces can also route to a [self-hosted environment](</docs/en/self-hosted-environments>). [Availability and limitations](</docs/en/self-hosted-environments#availability-and-limitations>) covers what Claude can’t use yet when a Claude Tag session runs in one. [Remote Control](</docs/en/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. Claude Tag channel sessions use organization-level environments only, either shared environments or [self-hosted environments](</docs/en/self-hosted-environments>). @@ -23,7 +23,7 @@ With only **Default** available, every session runs in it. When you have more than one environment, sessions choose one per surface: - * On the web, the Desktop app, and the mobile app, sessions use the environment shown in the selector. An organization default set by an Owner fills the selection when you haven’t picked one. + * In the Desktop app, the mobile app, and at claude.ai/code, sessions use the environment shown in the selector. An organization default set by an Owner fills the selection when you haven’t picked one. * 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](</docs/en/remote-control>) registers to represent your own machine rather than a cloud environment. For a [self-hosted environment](</docs/en/self-hosted-environments>), passing `--environment <environment-id>` with its `ccpool_` ID [when you dispatch a session](</docs/en/self-hosted-environments-testing#run-the-test-loop>) 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. @@ -60,7 +60,7 @@ LOG_LEVEL=debug DATABASE_URL=postgres://localhost:5432/myapp -Each session copies the environment’s values once, at startup, into ordinary environment variables that any command Claude runs can read. Because running sessions don’t re-read the configuration, editing or adding variables affects sessions you start afterward; sessions already running keep the values they started with. Claude Code on the web also sets some variables itself when it starts a session. For [`CLAUDE_AUTOCOMPACT_PCT_OVERRIDE`](</docs/en/claude-code-on-the-web#manage-context>), the value Claude Code on the web sets overrides one you add here, so adding that key here has no effect. Anyone who uses the environment can read the values. On Pro and Max plans, use an API credential instead for a key the agent proxy can attach to a request. The requests that never get a credential are listed there. +Each session copies the environment’s values once, at startup, into ordinary environment variables that any command Claude runs can read. Because running sessions don’t re-read the configuration, editing or adding variables affects sessions you start afterward; sessions already running keep the values they started with. A cloud session also sets some variables itself when it starts. For [`CLAUDE_AUTOCOMPACT_PCT_OVERRIDE`](</docs/en/claude-code-on-the-web#manage-context>), 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. On Pro and Max plans, use an API credential instead for a key the agent proxy can attach to a request. The requests that never get a credential are listed there. ### @@ -146,7 +146,7 @@ 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`](</docs/en/claude-code-on-the-web#from-terminal-to-web>). The command opens a picker of your existing environments and saves your choice to the `remote.defaultEnvironmentId` key in your [user settings](</docs/en/settings#where-settings-live>), 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](</docs/en/settings#settings-precedence>), such as a repo’s project settings. A [self-hosted environment](</docs/en/self-hosted-environments>) ID, which has the form `ccpool_...`, follows a stricter source rule. See [`remote.defaultEnvironmentId`](</docs/en/settings-reference#remote-defaultenvironmentid>) for the settings layers Claude Code honors it from. `/remote-env` only sets the default: it doesn’t start a session, and it can’t add or edit environments. Manage them from the environment selector. +Run `/remote-env` in your terminal to choose the default environment for cloud sessions you create from the CLI, such as [`claude --cloud`](</docs/en/claude-code-on-the-web#from-terminal-to-cloud>). The command opens a picker of your existing environments and saves your choice to the `remote.defaultEnvironmentId` key in your [user settings](</docs/en/settings#where-settings-live>), 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](</docs/en/settings#settings-precedence>), such as a repo’s project settings. A [self-hosted environment](</docs/en/self-hosted-environments>) ID, which has the form `ccpool_...`, follows a stricter source rule. See [`remote.defaultEnvironmentId`](</docs/en/settings-reference#remote-defaultenvironmentid>) for the settings layers Claude Code honors it from. `/remote-env` only sets the default: it doesn’t start a session, and it can’t add or edit environments. Manage them from the environment selector. ### @@ -319,7 +319,7 @@ **Databases**| PostgreSQL 16, Redis 7.0 **Utilities**| git, gh, jq, yq, ripgrep, tmux, vim, nano -¹ Bun is installed but has known proxy compatibility issues for package fetching. To get the versions of most of the tools in this table, ask Claude to run `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. For a tool it doesn’t report, such as Ruby, PHP, bun, PostgreSQL, or Redis, ask Claude to run the tool’s own version command, for example `psql --version`. Node.js versions are installed at `/opt/node20`, `/opt/node21`, and `/opt/node22`, with 22 on `PATH` by default. To work with a different version, ask Claude to prepend that version’s `bin` directory, such as `/opt/node20/bin`, to `PATH`. 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. +¹ Bun is installed but has known proxy compatibility issues for package fetching. To get the versions of most of the tools in this table, ask Claude to run `check-tools` in a cloud session. It’s a shell command installed on the session VM, not a command you type with `/`; you ask Claude because Claude runs all VM commands for you. For a tool it doesn’t report, such as Ruby, PHP, bun, PostgreSQL, or Redis, ask Claude to run the tool’s own version command, for example `psql --version`. Node.js versions are installed at `/opt/node20`, `/opt/node21`, and `/opt/node22`, with 22 on `PATH` by default. To work with a different version, ask Claude to prepend that version’s `bin` directory, such as `/opt/node20/bin`, to `PATH`. 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. ### @@ -492,7 +492,7 @@ 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_REMOTE` environment variable as shown above. + * **No cloud-only scoping** : hooks run in both local and cloud sessions. To skip local execution, exit early unless the `CLAUDE_CODE_REMOTE` environment variable is `true`, the way the dependency install script does. * **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** : in Anthropic-hosted environments, all outbound traffic passes through a security proxy, and some package managers don’t work correctly with it; Bun is a known example. In a [self-hosted environment](</docs/en/self-hosted-environments-deploy#default-deny-egress>), outbound traffic goes through your own network boundary instead. * **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. @@ -763,8 +763,8 @@ Related resources - * [Claude Code on the web](</docs/en/claude-code-on-the-web>): start, manage, and share cloud sessions - * [Web quickstart](</docs/en/web-quickstart>): connect GitHub and start your first cloud session + * [Cloud sessions reference](</docs/en/claude-code-on-the-web>): start, manage, and share cloud sessions + * [Cloud sessions quickstart](</docs/en/web-quickstart>): connect GitHub and start your first cloud session * [Claude Tag](<https://claude.com/docs/claude-tag/overview>): sessions Claude starts from Slack run in the same environments * [Routines](</docs/en/routines>): scheduled runs use the same environments and network access levels * [Remote Control](</docs/en/remote-control>): run sessions on your own machine’s network and files instead
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -510,7 +510,6 @@ Anthropic services * api.anthropic.com - * statsig.anthropic.com * docs.claude.com * platform.claude.com * code.claude.com @@ -582,6 +581,7 @@ * [www.java.net](<http://www.java.net>) * download.oracle.com * yum.oracle.com + * *.r2.cloudflarestorage.com JavaScript and Node package managers @@ -592,6 +592,8 @@ * npmjs.org * yarnpkg.com * registry.yarnpkg.com + * jsr.io + * npm.jsr.io Python package managers @@ -646,11 +648,13 @@ * central.maven.org * repo1.maven.org * repo.maven.apache.org + * maven.google.com * jcenter.bintray.com * gradle.org * [www.gradle.org](<http://www.gradle.org>) * services.gradle.org * plugins.gradle.org + * plugins-artifacts.gradle.org * kotlinlang.org * [www.kotlinlang.org](<http://www.kotlinlang.org>) * spring.io @@ -728,14 +732,7 @@ Cloud services and monitoring - * statsig.com - * [www.statsig.com](<http://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
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -34,7 +34,7 @@ Configure your environment -Create, edit, and archive environments from the environment selector at [claude.ai/code](<https://claude.ai/code>), which you reach after [web onboarding](</docs/en/web-quickstart>). Environments you create are personal to your account; shared environments created by an Owner appear in the same selector. See Installed tools for what’s available without any configuration. +Create, edit, and archive environments from the environment selector, which you reach at [claude.ai/code](<https://claude.ai/code>) after [web onboarding](</docs/en/web-quickstart>), or from the prompt box in the [Desktop app](</docs/en/desktop#cloud-sessions>). Environments you create are personal to your account; shared environments created by an Owner appear in the same selector. See Installed tools for what’s available without any configuration. 1 @@ -126,7 +126,7 @@ Which requests get the credential -The agent proxy attaches a credential to a request when the request’s host matches one you listed on that credential. Sessions can reach those hosts even when the environment’s network access level wouldn’t otherwise allow them, except the hosts the agent proxy skips. The credential applies in every session that runs in the environment, whoever started it, until you delete it. +The agent proxy attaches a credential to a request when the request’s host matches one you listed on that credential. Sessions can reach those hosts even when the environment’s network access level wouldn’t otherwise allow them, except the hosts that never get the credential. The credential applies in every session that runs in the environment, whoever started it, until you delete it. #### @@ -137,7 +137,7 @@ The agent proxy never attaches a credential you add to these requests: * **GitHub** : the GitHub proxy authenticates requests to GitHub instead, so you don’t need an API credential for it - * **The Anthropic API and public package registries** : requests to `api.anthropic.com`, `registry.npmjs.org`, `jsr.io`, `npm.jsr.io`, `pypi.org`, `files.pythonhosted.org`, `index.crates.io`, and `proxy.golang.org` don’t go through the agent proxy + * **The Anthropic API and public package registries** : `api.anthropic.com`, `registry.npmjs.org`, `jsr.io`, `npm.jsr.io`, `pypi.org`, `files.pythonhosted.org`, `index.crates.io`, and `proxy.golang.org` * **Setup script requests** : Claude Code connects to the agent proxy when it launches, after the setup script has run ### @@ -146,7 +146,7 @@ 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`](</docs/en/claude-code-on-the-web#from-terminal-to-web>). The command opens a picker of your existing environments and saves your choice to the `remote.defaultEnvironmentId` key in your [user settings](</docs/en/settings#where-settings-live>), 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](</docs/en/settings#settings-precedence>), such as a repo’s project settings. A [self-hosted environment](</docs/en/self-hosted-environments>) ID, which has the form `ccpool_...`, follows a stricter source rule. See [`remote.defaultEnvironmentId`](</docs/en/settings-reference#remote-defaultenvironmentid>) for the settings layers Claude Code honors it from. `/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](<https://claude.ai/code>). +Run `/remote-env` in your terminal to choose the default environment for cloud sessions you create from the CLI, such as [`claude --cloud`](</docs/en/claude-code-on-the-web#from-terminal-to-web>). The command opens a picker of your existing environments and saves your choice to the `remote.defaultEnvironmentId` key in your [user settings](</docs/en/settings#where-settings-live>), 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](</docs/en/settings#settings-precedence>), such as a repo’s project settings. A [self-hosted environment](</docs/en/self-hosted-environments>) ID, which has the form `ccpool_...`, follows a stricter source rule. See [`remote.defaultEnvironmentId`](</docs/en/settings-reference#remote-defaultenvironmentid>) for the settings layers Claude Code honors it from. `/remote-env` only sets the default: it doesn’t start a session, and it can’t add or edit environments. Manage them from the environment selector. ### @@ -209,7 +209,7 @@ * GitHub, through its separate proxy * MCP connectors you enable, whose traffic travels through Anthropic’s servers - * The hosts you listed on the environment’s API credentials, except the hosts the agent proxy skips + * The hosts you listed on the environment’s API credentials, except the hosts that never get the credential * The Anthropic API, for Claude Code’s own requests, even at **None** , as noted under [Security and isolation](</docs/en/claude-code-on-the-web#security-and-isolation>) ### @@ -224,7 +224,7 @@ *.internal.example.com registry.example.com -Sessions in this environment can now reach `api.example.com`, any subdomain of `internal.example.com`, and `registry.example.com`, and no other domains through the session’s network. GitHub traffic, MCP connector traffic, and requests to the hosts of the environment’s API credentials, other than the hosts the agent proxy skips, 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. If your organization uses [artifacts](</docs/en/artifacts#availability>), you don’t need `*.frame.claudeusercontent.com` in the list for sessions to read them. When the list leaves that host out, Claude Code reads artifact content through the session’s connection to Anthropic instead. Keep the host in an allowlist in two situations: +Sessions in this environment can now reach `api.example.com`, any subdomain of `internal.example.com`, and `registry.example.com`, and no other domains through the session’s network. GitHub traffic, MCP connector traffic, and requests to the hosts of the environment’s API credentials, other than the hosts that never get the credential, 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. If your organization uses [artifacts](</docs/en/artifacts#availability>), you don’t need `*.frame.claudeusercontent.com` in the list for sessions to read them. When the list leaves that host out, Claude Code reads artifact content through the session’s connection to Anthropic instead. Keep the host in an allowlist in two situations: * **Sessions in this environment open another organization’s public artifacts** : Claude Code fetches those from the host directly, so add it to this list. * **You’re configuring the local CLI or a self-hosted runner** : keep the host in that allowlist. See [network access requirements](</docs/en/network-config#network-access-requirements>) and the self-hosted [network requirements](</docs/en/self-hosted-environments-deploy#network-requirements>).
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -433,10 +433,7 @@ 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](</docs/en/hooks#sessionstart>) for project setup that should run everywhere, cloud and local, like `npm install`. Setup scripts and SessionStart hooks run in a fixed order when a cloud session starts: - - 1. The setup script runs first, before Claude Code launches, and only when no cached environment exists. - 2. Claude Code launches and runs your SessionStart hooks, as it does at the start of every session, local or cloud. +Use a setup script to provision the VM itself: toolchains and CLI tools that aren’t pre-installed. Use a [SessionStart hook](</docs/en/hooks#sessionstart>) for project setup that should run everywhere, cloud and local, like `npm install`. Setup scripts and SessionStart hooks run in a fixed order when a cloud session starts. The table compares where you configure them, when they run, and where they run. | Setup scripts| SessionStart hooks ---|---|---
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -224,7 +224,12 @@ *.internal.example.com registry.example.com -Sessions in this environment can now reach `api.example.com`, any subdomain of `internal.example.com`, and `registry.example.com`, and no other domains through the session’s network. GitHub traffic, MCP connector traffic, and requests to the hosts of the environment’s API credentials, other than the hosts the agent proxy skips, 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. If sessions in the environment work with [artifacts](</docs/en/artifacts>), include `*.frame.claudeusercontent.com` in your list. Claude Code fetches artifact content from that host. If you leave it out, Claude can’t read artifacts in sessions that run in the environment. 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](</docs/en/server-managed-settings>) still apply inside cloud sessions, but none of them adds domains to the environment’s network allowlist. +Sessions in this environment can now reach `api.example.com`, any subdomain of `internal.example.com`, and `registry.example.com`, and no other domains through the session’s network. GitHub traffic, MCP connector traffic, and requests to the hosts of the environment’s API credentials, other than the hosts the agent proxy skips, 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. If your organization uses [artifacts](</docs/en/artifacts#availability>), you don’t need `*.frame.claudeusercontent.com` in the list for sessions to read them. When the list leaves that host out, Claude Code reads artifact content through the session’s connection to Anthropic instead. Keep the host in an allowlist in two situations: + + * **Sessions in this environment open another organization’s public artifacts** : Claude Code fetches those from the host directly, so add it to this list. + * **You’re configuring the local CLI or a self-hosted runner** : keep the host in that allowlist. See [network access requirements](</docs/en/network-config#network-access-requirements>) and the self-hosted [network requirements](</docs/en/self-hosted-environments-deploy#network-requirements>). + +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](</docs/en/server-managed-settings>) still apply inside cloud sessions, but none of them adds domains to the environment’s network allowlist. ###
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -1,6 +1,6 @@ Cloud environments require [Claude Code on the web](</docs/en/claude-code-on-the-web>), which is in research preview for Pro, Max, and Team users, and for Enterprise users with [premium seats or Chat + Claude Code seats](<https://support.claude.com/en/articles/11845131-use-claude-code-with-your-team-or-enterprise-plan>). -Each [cloud session](</docs/en/claude-code-on-the-web>) runs in a cloud environment. You can configure an environment to allow or deny network access, set environment variables for the session, store API credentials 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: [Claude Code on the web](</docs/en/claude-code-on-the-web>), the terminal with [`claude --cloud`](</docs/en/claude-code-on-the-web#from-terminal-to-web>), [Claude Tag](<https://claude.com/docs/claude-tag/overview>), [routines](</docs/en/routines>), the [Claude mobile app](</docs/en/mobile>), and the [Desktop app](</docs/en/desktop>). Each of these surfaces can also route to a [self-hosted environment](</docs/en/self-hosted-environments>). [Availability and limitations](</docs/en/self-hosted-environments#availability-and-limitations>) covers what Claude can’t use yet when a Claude Tag session runs in one. +Each [cloud session](</docs/en/claude-code-on-the-web>) runs in a cloud environment. You can configure an environment to allow or deny network access, set environment variables for the session, on Pro and Max plans store API credentials 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: [Claude Code on the web](</docs/en/claude-code-on-the-web>), the terminal with [`claude --cloud`](</docs/en/claude-code-on-the-web#from-terminal-to-web>), [Claude Tag](<https://claude.com/docs/claude-tag/overview>), [routines](</docs/en/routines>), the [Claude mobile app](</docs/en/mobile>), and the [Desktop app](</docs/en/desktop>). Each of these surfaces can also route to a [self-hosted environment](</docs/en/self-hosted-environments>). [Availability and limitations](</docs/en/self-hosted-environments#availability-and-limitations>) covers what Claude can’t use yet when a Claude Tag session runs in one. [Remote Control](</docs/en/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. Claude Tag channel sessions use organization-level environments only, either shared environments or [self-hosted environments](</docs/en/self-hosted-environments>). @@ -46,7 +46,7 @@ Add or edit an environment -Select **Add cloud environment** , or hover over an existing environment and select the settings icon that appears on the right. The dialog includes the name, network access level, environment variables, and setup script. When you edit an existing cloud environment, the dialog also includes API credentials. +Select **Add cloud environment** , or hover over an existing environment and select the settings icon that appears on the right. The dialog includes the name, network access level, environment variables, and setup script. When you edit an existing cloud environment on a Pro or Max plan, the dialog also includes API credentials. ### @@ -60,7 +60,7 @@ LOG_LEVEL=debug DATABASE_URL=postgres://localhost:5432/myapp -Each session copies the environment’s values once, at startup, into ordinary environment variables that any command Claude runs can read. Because running sessions don’t re-read the configuration, editing or adding variables affects sessions you start afterward; sessions already running keep the values they started with. Claude Code on the web also sets some variables itself when it starts a session. For [`CLAUDE_AUTOCOMPACT_PCT_OVERRIDE`](</docs/en/claude-code-on-the-web#manage-context>), the value Claude Code on the web sets overrides one you add here, so adding that key here has no effect. Anyone who uses the environment can read the values. For a key the agent proxy can attach to a request, use an API credential instead. The requests that never get a credential are listed there. +Each session copies the environment’s values once, at startup, into ordinary environment variables that any command Claude runs can read. Because running sessions don’t re-read the configuration, editing or adding variables affects sessions you start afterward; sessions already running keep the values they started with. Claude Code on the web also sets some variables itself when it starts a session. For [`CLAUDE_AUTOCOMPACT_PCT_OVERRIDE`](</docs/en/claude-code-on-the-web#manage-context>), the value Claude Code on the web sets overrides one you add here, so adding that key here has no effect. Anyone who uses the environment can read the values. On Pro and Max plans, use an API credential instead for a key the agent proxy can attach to a request. The requests that never get a credential are listed there. ### @@ -68,7 +68,7 @@ Add API credentials -An API credential 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. The key never reaches Claude, the commands it runs, or the session’s environment variables. +An API credential 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. The key never reaches Claude, the commands it runs, or the session’s environment variables. API credentials are available on Pro and Max plans. They aren’t available on Team or Enterprise plans yet, so the **API credentials** section doesn’t appear in the environment dialog on those plans. #### @@ -167,7 +167,7 @@ Organization-shared environments -On Team and Enterprise plans, an Owner can create cloud environments that are shared with every member of the organization. The same role manages everything else on the **Cloud environments** admin page, including [self-hosted environments](</docs/en/self-hosted-environments>); the Admin role can’t open the page. The full list of roles that can open it is the one for [managing server-managed settings](</docs/en/server-managed-settings#access-control>). 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](<https://claude.ai/admin-settings>). A shared environment also opens from the environment selector at [claude.ai/code](<https://claude.ai/code>): an Owner can edit it there, and that dialog is where API credentials are added. Other members see it read-only. Each shared environment has a name, a network access level, environment variables in `.env` format, and a setup script. Owners choose the organization’s default environment separately, at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). Every member’s sessions in a shared environment read its variables, so don’t include secrets in them. To give those sessions a key they can’t read, add an API credential from that dialog. +On Team and Enterprise plans, an Owner can create cloud environments that are shared with every member of the organization. The same role manages everything else on the **Cloud environments** admin page, including [self-hosted environments](</docs/en/self-hosted-environments>); the Admin role can’t open the page. The full list of roles that can open it is the one for [managing server-managed settings](</docs/en/server-managed-settings#access-control>). 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](<https://claude.ai/admin-settings>). A shared environment also opens from the environment selector at [claude.ai/code](<https://claude.ai/code>): an Owner can edit it there. Other members see it read-only. Each shared environment has a name, a network access level, environment variables in `.env` format, and a setup script. Owners choose the organization’s default environment separately, at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). Every member’s sessions in a shared environment read its variables, so don’t include secrets in them. API credentials, which give sessions a key they can’t read, aren’t available on Team or Enterprise plans yet. ### @@ -287,10 +287,10 @@ Plugins enabled only in your user settings| No| User-scoped `enabledPlugins` lives in `~/.claude/settings.json`. Declare them in the repo’s `.claude/settings.json` instead, or enable them for your claude.ai account so Claude Code loads them as [synced plugins](</docs/en/plugins-reference#synced-plugins>) MCP servers you added with `claude mcp add` at the default local scope or the user scope| No| Those write to `~/.claude.json` on your machine, not the repo. Add the server with `claude mcp add --scope project`, which writes the repo’s [`.mcp.json`](</docs/en/mcp#project-scope>), and commit that file Transport variables in your repo’s `.claude/settings.json` `env` block, such as `NODE_EXTRA_CA_CERTS` and the [mTLS client certificate variables](</docs/en/network-config#mtls-authentication>)| No| The hosting environment manages the session’s API connection, so Claude Code ignores these keys and notes each ignored key in the session’s debug log -API keys and tokens for services Claude calls| Yes, as API credentials| You add the key once on the environment and the agent proxy attaches it to requests for the hosts you list. A key the agent proxy can’t attach stays in an environment variable +API keys and tokens for services Claude calls| On Pro and Max plans, as API credentials| You add the key once on the environment and the agent proxy attaches it to requests for the hosts you list. A key the agent proxy can’t attach, or any key on a Team or Enterprise plan, stays in an environment variable Interactive auth like AWS SSO| No| Not supported. SSO requires browser-based login that can’t run in a cloud session -To make your own configuration available in cloud sessions, commit it to the repo. Anyone who uses the environment can read its environment variables and setup script. The dialog’s note under **Environment variables** says so and warns against putting secrets there. Store a key the agent proxy can attach as an API credential instead. +To make your own configuration available in cloud sessions, commit it to the repo. Anyone who uses the environment can read its environment variables and setup script. The dialog’s note under **Environment variables** says so and warns against putting secrets there. On Pro and Max plans, store a key the agent proxy can attach as an API credential instead. ###
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -78,7 +78,8 @@ Two of these decide whether you can add a credential, and two decide whether the agent proxy can use it once added: - * **Role** : an organization admin role in your claude.ai organization, which Admins and Owners hold + * **Role** : an organization admin role in your claude.ai organization + * On Team and Enterprise, Owners hold it and Admins don’t * On Pro and Max, you hold it in your own organization * Without it, you see a note instead of the credential list, on your own environments too. Ask an Owner to add the credential to a shared environment and run your sessions there * **Environment type** : an Anthropic-hosted cloud environment that already exists. A [self-hosted environment](</docs/en/self-hosted-environments>) doesn’t have API credentials @@ -166,7 +167,7 @@ Organization-shared environments -On Team and Enterprise plans, an Owner can create cloud environments that are shared with every member of the organization. The same role manages everything else on the **Cloud environments** admin page, including [self-hosted environments](</docs/en/self-hosted-environments>); the Admin role can’t open the page. The full list of roles that can open it is the one for [managing server-managed settings](</docs/en/server-managed-settings#access-control>). 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](<https://claude.ai/admin-settings>). A shared environment also opens from the environment selector at [claude.ai/code](<https://claude.ai/code>): an Admin or Owner can edit it there, and that dialog is where API credentials are added. Other members see it read-only. Each shared environment has a name, a network access level, environment variables in `.env` format, and a setup script. Owners choose the organization’s default environment separately, at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). Every member’s sessions in a shared environment read its variables, so don’t include secrets in them. To give those sessions a key they can’t read, add an API credential from that dialog. +On Team and Enterprise plans, an Owner can create cloud environments that are shared with every member of the organization. The same role manages everything else on the **Cloud environments** admin page, including [self-hosted environments](</docs/en/self-hosted-environments>); the Admin role can’t open the page. The full list of roles that can open it is the one for [managing server-managed settings](</docs/en/server-managed-settings#access-control>). 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](<https://claude.ai/admin-settings>). A shared environment also opens from the environment selector at [claude.ai/code](<https://claude.ai/code>): an Owner can edit it there, and that dialog is where API credentials are added. Other members see it read-only. Each shared environment has a name, a network access level, environment variables in `.env` format, and a setup script. Owners choose the organization’s default environment separately, at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). Every member’s sessions in a shared environment read its variables, so don’t include secrets in them. To give those sessions a key they can’t read, add an API credential from that dialog. ###
modified
Show diff (175 lines)
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -1,6 +1,6 @@ Cloud environments require [Claude Code on the web](</docs/en/claude-code-on-the-web>), which is in research preview for Pro, Max, and Team users, and for Enterprise users with [premium seats or Chat + Claude Code seats](<https://support.claude.com/en/articles/11845131-use-claude-code-with-your-team-or-enterprise-plan>). -Each [cloud session](</docs/en/claude-code-on-the-web>) runs in a cloud environment. You can configure an environment to allow or deny network access, set environment variables for the session, and run a setup script before Claude starts working. The same environments apply wherever you start a cloud session: [Claude Code on the web](</docs/en/claude-code-on-the-web>), the terminal with [`claude --cloud`](</docs/en/claude-code-on-the-web#from-terminal-to-web>), [Claude Tag](<https://claude.com/docs/claude-tag/overview>), [routines](</docs/en/routines>), the [Claude mobile app](</docs/en/mobile>), and the [Desktop app](</docs/en/desktop>). Each of these surfaces can also route to a [self-hosted environment](</docs/en/self-hosted-environments>). [Availability and limitations](</docs/en/self-hosted-environments#availability-and-limitations>) covers what Claude can’t use yet when a Claude Tag session runs in one. +Each [cloud session](</docs/en/claude-code-on-the-web>) runs in a cloud environment. You can configure an environment to allow or deny network access, set environment variables for the session, store API credentials 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: [Claude Code on the web](</docs/en/claude-code-on-the-web>), the terminal with [`claude --cloud`](</docs/en/claude-code-on-the-web#from-terminal-to-web>), [Claude Tag](<https://claude.com/docs/claude-tag/overview>), [routines](</docs/en/routines>), the [Claude mobile app](</docs/en/mobile>), and the [Desktop app](</docs/en/desktop>). Each of these surfaces can also route to a [self-hosted environment](</docs/en/self-hosted-environments>). [Availability and limitations](</docs/en/self-hosted-environments#availability-and-limitations>) covers what Claude can’t use yet when a Claude Tag session runs in one. [Remote Control](</docs/en/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. Claude Tag channel sessions use organization-level environments only, either shared environments or [self-hosted environments](</docs/en/self-hosted-environments>). @@ -46,7 +46,7 @@ Add or edit an environment -Select **Add cloud environment** , or hover over an existing environment and select the settings icon that appears on the right. The dialog includes the name, network access level, environment variables, and setup script. +Select **Add cloud environment** , or hover over an existing environment and select the settings icon that appears on the right. The dialog includes the name, network access level, environment variables, and setup script. When you edit an existing cloud environment, the dialog also includes API credentials. ### @@ -60,7 +60,84 @@ LOG_LEVEL=debug DATABASE_URL=postgres://localhost:5432/myapp -Each session copies the environment’s values once, at startup, into ordinary environment variables that any command Claude runs can read. Because running sessions don’t re-read the configuration, editing or adding variables affects sessions you start afterward; sessions already running keep the values they started with. Claude Code on the web also sets some variables itself when it starts a session. For [`CLAUDE_AUTOCOMPACT_PCT_OVERRIDE`](</docs/en/claude-code-on-the-web#manage-context>), the value Claude Code on the web sets overrides one you add here, so adding that key here has no effect. Anyone who uses the environment can read the values, and cloud environments have no dedicated secrets store, so don’t add API keys or other credentials. If a session needs a credential anyway, see What carries over from your setup. +Each session copies the environment’s values once, at startup, into ordinary environment variables that any command Claude runs can read. Because running sessions don’t re-read the configuration, editing or adding variables affects sessions you start afterward; sessions already running keep the values they started with. Claude Code on the web also sets some variables itself when it starts a session. For [`CLAUDE_AUTOCOMPACT_PCT_OVERRIDE`](</docs/en/claude-code-on-the-web#manage-context>), the value Claude Code on the web sets overrides one you add here, so adding that key here has no effect. Anyone who uses the environment can read the values. For a key the agent proxy can attach to a request, use an API credential instead. The requests that never get a credential are listed there. + +### + +​ + +Add API credentials + +An API credential 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. The key never reaches Claude, the commands it runs, or the session’s environment variables. + +#### + +​ + +Requirements + +Two of these decide whether you can add a credential, and two decide whether the agent proxy can use it once added: + + * **Role** : an organization admin role in your claude.ai organization, which Admins and Owners hold + * On Pro and Max, you hold it in your own organization + * Without it, you see a note instead of the credential list, on your own environments too. Ask an Owner to add the credential to a shared environment and run your sessions there + * **Environment type** : an Anthropic-hosted cloud environment that already exists. A [self-hosted environment](</docs/en/self-hosted-environments>) doesn’t have API credentials + * **API reachability** : the API accepts connections from the internet, because requests leave from Anthropic’s network + * **Encryption keys** : if your organization uses customer-managed encryption keys, you can’t save credentials + +#### + +​ + +Add a credential + +You add credentials one at a time from the editor of an environment that already exists. The dialog for a new environment doesn’t offer them. There’s no edit, either. To change a credential’s hosts or value, delete it and add it again. + +1 + +Open the environment's API credentials + +Open the environment for editing at [claude.ai/code](<https://claude.ai/code>). In the **Update cloud environment** dialog, find **API credentials** below **Environment variables**. You see the credentials already on the environment, each with the hosts it applies to. + +2 + +Add the credential + +Select **Add credential** and fill in the form. Keep the default **Credential type** , **Bearer** , for an API key that travels in a request header, and fill in these fields: + + * **Name** : a label for the credential, such as `Internal billing API` + * **Allowed websites** : the API’s hosts, such as `api.example.com`. A leading `*.` matches every subdomain + * **Custom headers** : one row for the header that carries the key. The row starts with `Authorization` as the header’s **Name** and `Bearer` as its **Prefix** ; paste the key itself as the **Value**. For a header like `X-Api-Key` that takes the bare value, change the name and clear the prefix + +For an API that authenticates another way, pick a different **Credential type**. The list is the same one [Claude Tag](<https://claude.com/docs/claude-tag/overview>), the Slack integration for Team and Enterprise plans, offers for [connections](<https://claude.com/docs/claude-tag/admins/add-connections>). + +3 + +Save the credential + +Select **Connect**. The credential appears in the list with its hosts, saved without the dialog’s **Save changes** button. You can’t view the value again after saving. + +To confirm the credential works, start a session in the environment and ask Claude to call the API, for example with `curl`. The API answers as if the key were in the request, and the key doesn’t appear in the session’s environment variables or in any file. If the list marks a credential **Not sent** instead, the note under it says why and what to do. Two credentials whose hosts overlap without matching exactly get no marker, and the agent proxy sends only one of them. + +#### + +​ + +Which requests get the credential + +The agent proxy attaches a credential to a request when the request’s host matches one you listed on that credential. Sessions can reach those hosts even when the environment’s network access level wouldn’t otherwise allow them, except the hosts the agent proxy skips. The credential applies in every session that runs in the environment, whoever started it, until you delete it. + +#### + +​ + +Requests that never get the credential + +The agent proxy never attaches a credential you add to these requests: + + * **GitHub** : the GitHub proxy authenticates requests to GitHub instead, so you don’t need an API credential for it + * **The Anthropic API and public package registries** : requests to `api.anthropic.com`, `registry.npmjs.org`, `jsr.io`, `npm.jsr.io`, `pypi.org`, `files.pythonhosted.org`, `index.crates.io`, and `proxy.golang.org` don’t go through the agent proxy + * **Setup script requests** : Claude Code connects to the agent proxy when it launches, after the setup script has run ### @@ -80,6 +157,7 @@ * 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. + * API credentials on the environment stay attached in its running sessions. Delete any you no longer want before you archive. * No new session can start in an archived environment, on any surface. If the environment was your saved CLI default, Claude Code starts CLI cloud sessions in the Anthropic-hosted environment when your list has one, and otherwise in the first environment in your list that isn’t a Remote Control bridge environment. Anything configured with the environment explicitly, such as a [routine](</docs/en/routines#environments-and-network-access>), can’t start new sessions in it. Point it at another environment. ### @@ -88,7 +166,15 @@ Organization-shared environments -On Team and Enterprise plans, an Owner can create cloud environments that are shared with every member of the organization. The same role manages everything else on the **Cloud environments** admin page, including [self-hosted environments](</docs/en/self-hosted-environments>); the Admin role can’t open the page. The full list of roles that can open it is the one for [managing server-managed settings](</docs/en/server-managed-settings#access-control>). 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](<https://claude.ai/admin-settings>). Each shared environment has a name, a network access level, environment variables in `.env` format, and a setup script. Owners choose the organization’s default environment separately, at [claude.ai/admin-settings/claude-code](<https://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. In [Claude Tag](<https://claude.com/docs/claude-tag/overview>) channels, Claude works as your organization’s shared identity, not as any member, so channel sessions use organization-level environments only, either shared environments or [self-hosted environments](</docs/en/self-hosted-environments>). You can set the environment a channel uses in two ways: +On Team and Enterprise plans, an Owner can create cloud environments that are shared with every member of the organization. The same role manages everything else on the **Cloud environments** admin page, including [self-hosted environments](</docs/en/self-hosted-environments>); the Admin role can’t open the page. The full list of roles that can open it is the one for [managing server-managed settings](</docs/en/server-managed-settings#access-control>). 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](<https://claude.ai/admin-settings>). A shared environment also opens from the environment selector at [claude.ai/code](<https://claude.ai/code>): an Admin or Owner can edit it there, and that dialog is where API credentials are added. Other members see it read-only. Each shared environment has a name, a network access level, environment variables in `.env` format, and a setup script. Owners choose the organization’s default environment separately, at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). Every member’s sessions in a shared environment read its variables, so don’t include secrets in them. To give those sessions a key they can’t read, add an API credential from that dialog. + +### + +​ + +Set the environment a Claude Tag channel uses + +In [Claude Tag](<https://claude.com/docs/claude-tag/overview>) channels, Claude works as your organization’s shared identity, not as any member, so channel sessions use organization-level environments only, either shared environments or [self-hosted environments](</docs/en/self-hosted-environments>). To give a channel a toolchain that isn’t pre-installed, such as .NET, an Owner can create a shared environment from the **Cloud environments** admin page with a setup script that installs it. Point the channel at an environment in one of two ways: * Set a shared or self-hosted environment as the organization’s default environment at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). * [Pin one to a channel](<https://claude.com/docs/claude-tag/admins/troubleshooting#channel-sessions-use-the-wrong-environment-or-can%E2%80%99t-find-one>) in the Claude Tag admin settings. @@ -118,7 +204,12 @@ **Full**| Any domain **Custom**| Your own allowlist, optionally including the defaults -GitHub operations use a separate proxy that is independent of this setting, and Claude Code’s connection to the Anthropic API still works at **None** , as noted under [Security and isolation](</docs/en/claude-code-on-the-web#security-and-isolation>). +Whichever level you pick, sessions can still reach these, because each one takes a path that doesn’t go through the session’s network allowlist: + + * GitHub, through its separate proxy + * MCP connectors you enable, whose traffic travels through Anthropic’s servers + * The hosts you listed on the environment’s API credentials, except the hosts the agent proxy skips + * The Anthropic API, for Claude Code’s own requests, even at **None** , as noted under [Security and isolation](</docs/en/claude-code-on-the-web#security-and-isolation>) ### @@ -132,7 +223,7 @@ *.internal.example.com registry.example.com -Sessions in this environment can now reach `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. If sessions in the environment work with [artifacts](</docs/en/artifacts>), include `*.frame.claudeusercontent.com` in your list. Claude Code fetches artifact content from that host. If you leave it out, Claude can’t read artifacts in sessions that run in the environment. 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](</docs/en/server-managed-settings>) still apply inside cloud sessions, but none of them adds domains to the environment’s network allowlist. +Sessions in this environment can now reach `api.example.com`, any subdomain of `internal.example.com`, and `registry.example.com`, and no other domains through the session’s network. GitHub traffic, MCP connector traffic, and requests to the hosts of the environment’s API credentials, other than the hosts the agent proxy skips, 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. If sessions in the environment work with [artifacts](</docs/en/artifacts>), include `*.frame.claudeusercontent.com` in your list. Claude Code fetches artifact content from that host. If you leave it out, Claude can’t read artifacts in sessions that run in the environment. 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](</docs/en/server-managed-settings>) still apply inside cloud sessions, but none of them adds domains to the environment’s network allowlist. ### @@ -195,10 +286,10 @@ Plugins enabled only in your user settings| No| User-scoped `enabledPlugins` lives in `~/.claude/settings.json`. Declare them in the repo’s `.claude/settings.json` instead, or enable them for your claude.ai account so Claude Code loads them as [synced plugins](</docs/en/plugins-reference#synced-plugins>) MCP servers you added with `claude mcp add` at the default local scope or the user scope| No| Those write to `~/.claude.json` on your machine, not the repo. Add the server with `claude mcp add --scope project`, which writes the repo’s [`.mcp.json`](</docs/en/mcp#project-scope>), and commit that file Transport variables in your repo’s `.claude/settings.json` `env` block, such as `NODE_EXTRA_CA_CERTS` and the [mTLS client certificate variables](</docs/en/network-config#mtls-authentication>)| No| The hosting environment manages the session’s API connection, so Claude Code ignores these keys and notes each ignored key in the session’s debug log -Static API tokens and credentials| No| No dedicated secrets store exists yet. See below +API keys and tokens for services Claude calls| Yes, as API credentials| You add the key once on the environment and the agent proxy attaches it to requests for the hosts you list. A key the agent proxy can’t attach stays in an environment variable Interactive auth like AWS SSO| No| Not supported. SSO requires browser-based login that can’t run in a cloud session -To make your own configuration available in cloud sessions, commit it to the repo. A dedicated secrets store is not yet available, and the dialog warns against adding secrets or credentials: environment variables and setup scripts live in the environment configuration, where anyone who uses the environment can read them. If a session needs a credential anyway, add it with that visibility in mind. +To make your own configuration available in cloud sessions, commit it to the repo. Anyone who uses the environment can read its environment variables and setup script. The dialog’s note under **Environment variables** says so and warns against putting secrets there. Store a key the agent proxy can attach as an API credential instead. ### @@ -343,7 +434,7 @@ | Setup scripts| SessionStart hooks ---|---|--- -**Where you configure them**| The environment dialog at [claude.ai/code](<https://claude.ai/code>), or the **Cloud environments** admin page for shared environments| A [settings file](</docs/en/settings#where-settings-live>) such as your repo’s `.claude/settings.json`; see What carries over from your setup for which files reach a cloud session +**Where you configure them**| The environment dialog at [claude.ai/code](<https://claude.ai/code>), plus the **Cloud environments** admin page for shared environments| A [settings file](</docs/en/settings#where-settings-live>) such as your repo’s `.claude/settings.json`; see What carries over from your setup for which files reach a cloud session **When they run**| Before Claude Code launches, skipped when a cached environment exists| After Claude Code launches, on every session including resumed **Where they run**| Cloud sessions only| Local and cloud sessions
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -24,7 +24,7 @@ With only **Default** available, every session runs in it. When you have more than one environment, sessions choose one per surface: * On the web, the Desktop app, and the mobile app, sessions use the environment shown in the selector. An organization default set by an Owner fills the selection when you haven’t picked one. - * From the CLI, sessions use your `/remote-env` pick, or fall back to your first available cloud environment. For a [self-hosted environment](</docs/en/self-hosted-environments>), passing `--environment <environment-id>` with its `ccpool_` ID [when you dispatch a session](</docs/en/self-hosted-environments-testing#run-the-test-loop>) overrides both for that invocation. The flag rejects Anthropic-hosted `env_` IDs, so use `/remote-env` to target those. The flag requires Claude Code v2.1.224 or later. + * 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](</docs/en/remote-control>) registers to represent your own machine rather than a cloud environment. For a [self-hosted environment](</docs/en/self-hosted-environments>), passing `--environment <environment-id>` with its `ccpool_` ID [when you dispatch a session](</docs/en/self-hosted-environments-testing#run-the-test-loop>) 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. @@ -80,7 +80,7 @@ * 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](</docs/en/routines#environments-and-network-access>), can’t start new sessions in it; point it at another environment. + * No new session can start in an archived environment, on any surface. If the environment was your saved CLI default, Claude Code starts CLI cloud sessions in the Anthropic-hosted environment when your list has one, and otherwise in the first environment in your list that isn’t a Remote Control bridge environment. Anything configured with the environment explicitly, such as a [routine](</docs/en/routines#environments-and-network-access>), can’t start new sessions in it. Point it at another environment. ###
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -1,8 +1,8 @@ Cloud environments require [Claude Code on the web](</docs/en/claude-code-on-the-web>), which is in research preview for Pro, Max, and Team users, and for Enterprise users with [premium seats or Chat + Claude Code seats](<https://support.claude.com/en/articles/11845131-use-claude-code-with-your-team-or-enterprise-plan>). -Each [cloud session](</docs/en/claude-code-on-the-web>) runs in a cloud environment. You can configure an environment to allow or deny network access, set environment variables for the session, and run a setup script before Claude starts working. The same environments apply wherever you start a cloud session: [Claude Code on the web](</docs/en/claude-code-on-the-web>), the terminal with [`claude --cloud`](</docs/en/claude-code-on-the-web#from-terminal-to-web>), [Claude Tag](<https://claude.com/docs/claude-tag/overview>), [routines](</docs/en/routines>), the [Claude mobile app](</docs/en/mobile>), and the [Desktop app](</docs/en/desktop>). Claude Tag sessions can’t run in [self-hosted environments](</docs/en/self-hosted-environments>) yet; the other surfaces can route to any environment. - -[Remote Control](</docs/en/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. Claude Tag channel sessions use shared environments only. +Each [cloud session](</docs/en/claude-code-on-the-web>) runs in a cloud environment. You can configure an environment to allow or deny network access, set environment variables for the session, and run a setup script before Claude starts working. The same environments apply wherever you start a cloud session: [Claude Code on the web](</docs/en/claude-code-on-the-web>), the terminal with [`claude --cloud`](</docs/en/claude-code-on-the-web#from-terminal-to-web>), [Claude Tag](<https://claude.com/docs/claude-tag/overview>), [routines](</docs/en/routines>), the [Claude mobile app](</docs/en/mobile>), and the [Desktop app](</docs/en/desktop>). Each of these surfaces can also route to a [self-hosted environment](</docs/en/self-hosted-environments>). [Availability and limitations](</docs/en/self-hosted-environments#availability-and-limitations>) covers what Claude can’t use yet when a Claude Tag session runs in one. + +[Remote Control](</docs/en/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. Claude Tag channel sessions use organization-level environments only, either shared environments or [self-hosted environments](</docs/en/self-hosted-environments>). ## @@ -88,9 +88,9 @@ Organization-shared environments -On Team and Enterprise plans, an Owner can create cloud environments that are shared with every member of the organization. The same role manages everything else on the **Cloud environments** admin page, including [self-hosted environments](</docs/en/self-hosted-environments>); the Admin role can’t open the page. The full list of roles that can open it is the one for [managing server-managed settings](</docs/en/server-managed-settings#access-control>). 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](<https://claude.ai/admin-settings>). Each shared environment has a name, a network access level, environment variables in `.env` format, and a setup script. Owners choose the organization’s default environment separately, at [claude.ai/admin-settings/claude-code](<https://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. In [Claude Tag](<https://claude.com/docs/claude-tag/overview>) channels, Claude works as your organization’s shared identity, not as any member, so channel sessions use shared environments only. You can set the environment a channel uses in two ways: - - * Set a shared environment as the organization’s default environment at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). +On Team and Enterprise plans, an Owner can create cloud environments that are shared with every member of the organization. The same role manages everything else on the **Cloud environments** admin page, including [self-hosted environments](</docs/en/self-hosted-environments>); the Admin role can’t open the page. The full list of roles that can open it is the one for [managing server-managed settings](</docs/en/server-managed-settings#access-control>). 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](<https://claude.ai/admin-settings>). Each shared environment has a name, a network access level, environment variables in `.env` format, and a setup script. Owners choose the organization’s default environment separately, at [claude.ai/admin-settings/claude-code](<https://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. In [Claude Tag](<https://claude.com/docs/claude-tag/overview>) channels, Claude works as your organization’s shared identity, not as any member, so channel sessions use organization-level environments only, either shared environments or [self-hosted environments](</docs/en/self-hosted-environments>). You can set the environment a channel uses in two ways: + + * Set a shared or self-hosted environment as the organization’s default environment at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). * [Pin one to a channel](<https://claude.com/docs/claude-tag/admins/troubleshooting#channel-sessions-use-the-wrong-environment-or-can%E2%80%99t-find-one>) in the Claude Tag admin settings. ## @@ -189,7 +189,7 @@ Your repo’s `.claude/rules/`| Yes| Part of the clone Your repo’s `.claude/skills/`, `.claude/agents/`, `.claude/commands/`| Yes| Part of the clone Plugins declared in `.claude/settings.json`| Yes| Installed at session start from the [marketplace](</docs/en/plugin-marketplaces>) you declared. Requires network access to reach the marketplace source -Your organization’s [server-managed settings](</docs/en/server-managed-settings>)| Yes| Fetched from Anthropic’s servers when the session starts. See [Surface coverage](</docs/en/model-config#surface-coverage>) for how `availableModels` is enforced in cloud sessions. Settings deployed to your device through MDM or managed settings files don’t apply, because the session runs on an Anthropic-managed VM; in a [self-hosted environment](</docs/en/self-hosted-environments>), sessions read the managed settings file in the runner image only when server-managed settings deliver no keys, per [settings precedence](</docs/en/server-managed-settings#settings-precedence>), apart from the [keys Claude Code reads from every admin source](</docs/en/managed-settings#keys-read-from-every-admin-source>) +Your organization’s [server-managed settings](</docs/en/server-managed-settings>)| Yes| Fetched from Anthropic’s servers when the session starts. See [Surface coverage](</docs/en/model-config#surface-coverage>) for how `availableModels` is enforced in cloud sessions. Settings deployed to your device through MDM or managed settings files don’t apply, because the session runs on an Anthropic-managed VM; in a [self-hosted environment](</docs/en/self-hosted-environments>), sessions also read the managed settings file in the runner image, per [how Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) Your user `~/.claude/CLAUDE.md`| No| Lives on your machine, not in the repo Your user `~/.claude/skills/`, `~/.claude/agents/`, `~/.claude/commands/`| No| Live on your machine, not in the repo. Commit them to the repo’s `.claude/` directory instead. Cloud sessions automatically load skills you enable on claude.ai Plugins enabled only in your user settings| No| User-scoped `enabledPlugins` lives in `~/.claude/settings.json`. Declare them in the repo’s `.claude/settings.json` instead, or enable them for your claude.ai account so Claude Code loads them as [synced plugins](</docs/en/plugins-reference#synced-plugins>) @@ -347,7 +347,10 @@ **When they run**| Before Claude Code launches, skipped when a cached environment exists| After Claude Code launches, on every session including resumed **Where they run**| Cloud sessions only| Local and cloud sessions -If you have SessionStart hooks in your user-level `~/.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](</docs/en/server-managed-settings>). In a [self-hosted environment](</docs/en/self-hosted-environments-configuration#permissions-and-tool-approval>), Claude Code also runs the hooks the operator seeded from the runner host’s `~/.claude/`, and it runs the hooks in the runner image’s managed settings file when neither [server-managed settings nor an MDM-delivered Claude Code policy](</docs/en/settings#precedence-within-the-managed-tier>) supplies the managed tier. +If you have SessionStart hooks in your user-level `~/.claude/settings.json`, don’t expect them in the cloud. User-level settings stay on your machine. Which other hooks run depends on where the session runs: + + * **Anthropic-hosted environment** : Claude Code runs hooks from the repository and from your organization’s [server-managed settings](</docs/en/server-managed-settings>). + * **[Self-hosted environment](</docs/en/self-hosted-environments-configuration#permissions-and-tool-approval>)** : Claude Code also runs the hooks the operator seeded from the runner host’s `~/.claude/`, and the hooks in the runner image’s managed settings file when that file is one of the [managed sources Claude Code applies](</docs/en/managed-settings#how-claude-code-combines-managed-sources>). ### @@ -671,7 +674,7 @@ * [Claude Code on the web](</docs/en/claude-code-on-the-web>): start, manage, and share cloud sessions * [Web quickstart](</docs/en/web-quickstart>): connect GitHub and start your first cloud session - * [Claude Tag](<https://claude.com/docs/claude-tag/overview>): sessions Claude starts from Slack run in the same Anthropic-hosted environments + * [Claude Tag](<https://claude.com/docs/claude-tag/overview>): sessions Claude starts from Slack run in the same environments * [Routines](</docs/en/routines>): scheduled runs use the same environments and network access levels * [Remote Control](</docs/en/remote-control>): run sessions on your own machine’s network and files instead * [Self-hosted environments](</docs/en/self-hosted-environments>): run cloud sessions on your organization’s own infrastructure
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -10,7 +10,13 @@ The Default environment -If you don’t have an environment yet, onboarding sets up the **Default** environment for you, whether you connect through [the web](</docs/en/web-quickstart#connect-github>) 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: +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 and Max** : creates **Default** for you + * **Web onboarding on Team and Enterprise** : shows a **Create your first cloud environment** form unless an Owner has turned on [Quick web setup](</docs/en/claude-code-on-the-web#github-authentication-options>); keep the form’s defaults and click **Create & finish** 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.
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -341,7 +341,7 @@ **When they run**| Before Claude Code launches, skipped when a cached environment exists| After Claude Code launches, on every session including resumed **Where they run**| Cloud sessions only| Local and cloud sessions -If you have SessionStart hooks in your user-level `~/.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](</docs/en/server-managed-settings>); sessions in a [self-hosted environment](</docs/en/self-hosted-environments-configuration#permissions-and-tool-approval>) also run hooks the operator seeded from the runner host’s `~/.claude/`. +If you have SessionStart hooks in your user-level `~/.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](</docs/en/server-managed-settings>). In a [self-hosted environment](</docs/en/self-hosted-environments-configuration#permissions-and-tool-approval>), Claude Code also runs the hooks the operator seeded from the runner host’s `~/.claude/`, and it runs the hooks in the runner image’s managed settings file when neither [server-managed settings nor an MDM-delivered Claude Code policy](</docs/en/settings#precedence-within-the-managed-tier>) supplies the managed tier. ###
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -17,7 +17,7 @@ With only **Default** available, every session runs in it. When you have more than one environment, sessions choose one per surface: - * 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. + * On the web, the Desktop app, and the mobile app, sessions use the environment shown in the selector. An organization default set by an Owner fills the selection when you haven’t picked one. * From the CLI, sessions use your `/remote-env` pick, or fall back to your first available cloud environment. For a [self-hosted environment](</docs/en/self-hosted-environments>), passing `--environment <environment-id>` with its `ccpool_` ID [when you dispatch a session](</docs/en/self-hosted-environments-testing#run-the-test-loop>) overrides both for that invocation. The flag rejects Anthropic-hosted `env_` IDs, 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. @@ -28,7 +28,7 @@ Configure your environment -Create, edit, and archive environments from the environment selector at [claude.ai/code](<https://claude.ai/code>), which you reach after [web onboarding](</docs/en/web-quickstart>). 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. +Create, edit, and archive environments from the environment selector at [claude.ai/code](<https://claude.ai/code>), which you reach after [web onboarding](</docs/en/web-quickstart>). Environments you create are personal to your account; shared environments created by an Owner appear in the same selector. See Installed tools for what’s available without any configuration. 1 @@ -82,7 +82,7 @@ Organization-shared environments -Owners and admins on Team and Enterprise plans can create cloud environments that are shared with every member of the organization; the same roles manage everything else on the **Cloud environments** admin page, including [self-hosted environments](</docs/en/self-hosted-environments>). 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](<https://claude.ai/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](<https://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. In [Claude Tag](<https://claude.com/docs/claude-tag/overview>) channels, Claude works as your organization’s shared identity, not as any member, so channel sessions use shared environments only. You can set the environment a channel uses in two ways: +On Team and Enterprise plans, an Owner can create cloud environments that are shared with every member of the organization. The same role manages everything else on the **Cloud environments** admin page, including [self-hosted environments](</docs/en/self-hosted-environments>); the Admin role can’t open the page. The full list of roles that can open it is the one for [managing server-managed settings](</docs/en/server-managed-settings#access-control>). 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](<https://claude.ai/admin-settings>). Each shared environment has a name, a network access level, environment variables in `.env` format, and a setup script. Owners choose the organization’s default environment separately, at [claude.ai/admin-settings/claude-code](<https://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. In [Claude Tag](<https://claude.com/docs/claude-tag/overview>) channels, Claude works as your organization’s shared identity, not as any member, so channel sessions use shared environments only. You can set the environment a channel uses in two ways: * Set a shared environment as the organization’s default environment at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). * [Pin one to a channel](<https://claude.com/docs/claude-tag/admins/troubleshooting#channel-sessions-use-the-wrong-environment-or-can%E2%80%99t-find-one>) in the Claude Tag admin settings. @@ -183,10 +183,10 @@ Your repo’s `.claude/rules/`| Yes| Part of the clone Your repo’s `.claude/skills/`, `.claude/agents/`, `.claude/commands/`| Yes| Part of the clone Plugins declared in `.claude/settings.json`| Yes| Installed at session start from the [marketplace](</docs/en/plugin-marketplaces>) you declared. Requires network access to reach the marketplace source -Your organization’s [server-managed settings](</docs/en/server-managed-settings>)| Yes| Fetched from Anthropic’s servers when the session starts. See [Surface coverage](</docs/en/model-config#surface-coverage>) for how `availableModels` is enforced in cloud sessions. Settings deployed to your device through MDM or managed settings files don’t apply, because the session runs on an Anthropic-managed VM; in a [self-hosted environment](</docs/en/self-hosted-environments>), sessions read the managed settings file in the runner image only when server-managed settings deliver no keys, per [settings precedence](</docs/en/server-managed-settings#settings-precedence>) +Your organization’s [server-managed settings](</docs/en/server-managed-settings>)| Yes| Fetched from Anthropic’s servers when the session starts. See [Surface coverage](</docs/en/model-config#surface-coverage>) for how `availableModels` is enforced in cloud sessions. Settings deployed to your device through MDM or managed settings files don’t apply, because the session runs on an Anthropic-managed VM; in a [self-hosted environment](</docs/en/self-hosted-environments>), sessions read the managed settings file in the runner image only when server-managed settings deliver no keys, per [settings precedence](</docs/en/server-managed-settings#settings-precedence>), apart from the [keys Claude Code reads from every admin source](</docs/en/managed-settings#keys-read-from-every-admin-source>) Your user `~/.claude/CLAUDE.md`| No| Lives on your machine, not in the repo Your user `~/.claude/skills/`, `~/.claude/agents/`, `~/.claude/commands/`| No| Live on your machine, not in the repo. Commit them to the repo’s `.claude/` directory instead. Cloud sessions automatically load skills you enable on claude.ai -Plugins enabled only in your user settings| No| User-scoped `enabledPlugins` lives in `~/.claude/settings.json`. Declare them in the repo’s `.claude/settings.json` instead +Plugins enabled only in your user settings| No| User-scoped `enabledPlugins` lives in `~/.claude/settings.json`. Declare them in the repo’s `.claude/settings.json` instead, or enable them for your claude.ai account so Claude Code loads them as [synced plugins](</docs/en/plugins-reference#synced-plugins>) MCP servers you added with `claude mcp add` at the default local scope or the user scope| No| Those write to `~/.claude.json` on your machine, not the repo. Add the server with `claude mcp add --scope project`, which writes the repo’s [`.mcp.json`](</docs/en/mcp#project-scope>), and commit that file Transport variables in your repo’s `.claude/settings.json` `env` block, such as `NODE_EXTRA_CA_CERTS` and the [mTLS client certificate variables](</docs/en/network-config#mtls-authentication>)| No| The hosting environment manages the session’s API connection, so Claude Code ignores these keys and notes each ignored key in the session’s debug log Static API tokens and credentials| No| No dedicated secrets store exists yet. See below
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -10,7 +10,7 @@ The Default environment -Onboarding sets up the **Default** environment for you, whether you connect through [the web](</docs/en/web-quickstart#connect-github>) 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: +If you don’t have an environment yet, onboarding sets up the **Default** environment for you, whether you connect through [the web](</docs/en/web-quickstart#connect-github>) 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. @@ -62,7 +62,7 @@ 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`](</docs/en/claude-code-on-the-web#from-terminal-to-web>). The command opens a picker of your existing environments and saves your choice to the `remote.defaultEnvironmentId` key in your [user settings](</docs/en/settings#settings-files>), 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](</docs/en/settings#settings-precedence>), such as a repo’s project settings. A [self-hosted environment](</docs/en/self-hosted-environments>) ID, which has the form `ccpool_...`, follows a stricter source rule. See [`remote.defaultEnvironmentId`](</docs/en/settings#available-settings>) for the settings layers Claude Code honors it from. `/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](<https://claude.ai/code>). +Run `/remote-env` in your terminal to choose the default environment for cloud sessions you create from the CLI, such as [`claude --cloud`](</docs/en/claude-code-on-the-web#from-terminal-to-web>). The command opens a picker of your existing environments and saves your choice to the `remote.defaultEnvironmentId` key in your [user settings](</docs/en/settings#where-settings-live>), 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](</docs/en/settings#settings-precedence>), such as a repo’s project settings. A [self-hosted environment](</docs/en/self-hosted-environments>) ID, which has the form `ccpool_...`, follows a stricter source rule. See [`remote.defaultEnvironmentId`](</docs/en/settings-reference#remote-defaultenvironmentid>) for the settings layers Claude Code honors it from. `/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](<https://claude.ai/code>). ### @@ -207,16 +207,16 @@ **Python**| Python 3.x with pip, poetry, uv, black, mypy, pytest, ruff **Node.js**| 20, 21, and 22, with npm, yarn, pnpm, bun¹, eslint, prettier, chromedriver **Ruby**| 3.1, 3.2, 3.3 with gem, bundler, rbenv -**PHP**| 8.4 with Composer +**PHP**| 8.3 with Composer **Java**| OpenJDK 21 with Maven and Gradle -**Go**| latest stable with module support +**Go**| Go with module support **Rust**| rustc and cargo **C/C++**| GCC, Clang, cmake, ninja, conan **Docker**| docker, dockerd, docker compose **Databases**| PostgreSQL 16, Redis 7.0 -**Utilities**| git, jq, yq, ripgrep, tmux, vim, nano - -¹ Bun is installed but has known proxy compatibility issues for package fetching. For exact versions, ask Claude to run `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. Node.js versions are installed at `/opt/node20`, `/opt/node21`, and `/opt/node22`, with 22 on `PATH` by default. To work with a different version, ask Claude to prepend that version’s `bin` directory, such as `/opt/node20/bin`, to `PATH`. 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. +**Utilities**| git, gh, jq, yq, ripgrep, tmux, vim, nano + +¹ Bun is installed but has known proxy compatibility issues for package fetching. To get the versions of most of the tools in this table, ask Claude to run `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. For a tool it doesn’t report, such as Ruby, PHP, bun, PostgreSQL, or Redis, ask Claude to run the tool’s own version command, for example `psql --version`. Node.js versions are installed at `/opt/node20`, `/opt/node21`, and `/opt/node22`, with 22 on `PATH` by default. To work with a different version, ask Claude to prepend that version’s `bin` directory, such as `/opt/node20/bin`, to `PATH`. 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. ### @@ -226,22 +226,10 @@ 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](</docs/en/claude-code-on-the-web#github-authentication-options>), so your token never enters the container. You can set `GH_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 [`gh` CLI](<https://cli.github.com>) if you install it, use it directly. + * If you set a token, it passes through to the container unchanged, so your scripts and GitHub’s [`gh` CLI](<https://cli.github.com>) 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-injected` in the commands Claude runs, and the proxy substitutes your real credentials on outbound GitHub requests. `gh` works without a token of your own, but a script that reads `GITHUB_TOKEN` directly gets the placeholder, not a usable token. -A token you set is an ordinary environment variable, so anyone who uses the environment can read it; the proxy path keeps the credential out of the environment configuration and the session VM. To check which case applies to your session, ask Claude to run `echo $GH_TOKEN`. GitHub’s [`gh` CLI](<https://cli.github.com>) 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: - -1 - -Install gh in your setup script - -Add `apt update && apt install -y gh` to your setup script. - -2 - -Provide a token if the proxy is not handling authentication - -If `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`. +A token you set is an ordinary environment variable, so anyone who uses the environment can read it; the proxy path keeps the credential out of the environment configuration and the session VM. To check which case applies to your session, ask Claude to run `echo $GH_TOKEN`. GitHub’s [`gh` CLI](<https://cli.github.com>) is pre-installed. If you need a `gh` command the built-in tools don’t cover, like `gh release` or `gh workflow run`, ask Claude to run it. `gh` reads `GH_TOKEN` automatically, so you don’t need to run `gh auth login`. ### @@ -249,7 +237,7 @@ 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 the `CLAUDE_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`](</docs/en/settings#attribution-settings>) 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: +Each cloud session has a transcript URL on claude.ai, and the session can read its own ID from the `CLAUDE_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`](</docs/en/settings-reference#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: echo "https://claude.ai/code/${CLAUDE_CODE_REMOTE_SESSION_ID/#cse_/session_}" @@ -311,10 +299,10 @@ 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, so `apt 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](<https://cli.github.com>), which isn’t pre-installed. +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, so `apt 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 [ShellCheck](<https://www.shellcheck.net/>), which isn’t pre-installed. #!/bin/bash - apt update && apt install -y gh + apt update && apt install -y shellcheck ### @@ -349,7 +337,7 @@ | Setup scripts| SessionStart hooks ---|---|--- -**Where you configure them**| The environment dialog at [claude.ai/code](<https://claude.ai/code>)| A [settings file](</docs/en/settings#settings-files>) such as your repo’s `.claude/settings.json`; see What carries over from your setup for which files reach a cloud session +**Where you configure them**| The environment dialog at [claude.ai/code](<https://claude.ai/code>), or the **Cloud environments** admin page for shared environments| A [settings file](</docs/en/settings#where-settings-live>) such as your repo’s `.claude/settings.json`; see What carries over from your setup for which files reach a cloud session **When they run**| Before Claude Code launches, skipped when a cached environment exists| After Claude Code launches, on every session including resumed **Where they run**| Cloud sessions only| Local and cloud sessions
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -86,8 +86,6 @@ * Set a shared environment as the organization’s default environment at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). * [Pin one to a channel](<https://claude.com/docs/claude-tag/admins/troubleshooting#channel-sessions-use-the-wrong-environment-or-can%E2%80%99t-find-one>) in the Claude Tag admin settings. - -Shared environments add to members’ selectors rather than replacing them. ## @@ -128,7 +126,7 @@ *.internal.example.com registry.example.com -Sessions in this environment can now reach `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](</docs/en/server-managed-settings>) still apply inside cloud sessions, but none of them adds domains to the environment’s network allowlist. +Sessions in this environment can now reach `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. If sessions in the environment work with [artifacts](</docs/en/artifacts>), include `*.frame.claudeusercontent.com` in your list. Claude Code fetches artifact content from that host. If you leave it out, Claude can’t read artifacts in sessions that run in the environment. 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](</docs/en/server-managed-settings>) still apply inside cloud sessions, but none of them adds domains to the environment’s network allowlist. ### @@ -408,7 +406,7 @@ * **Proxy compatibility** : in Anthropic-hosted environments, all outbound traffic passes through a security proxy, and some package managers don’t work correctly with it; Bun is a known example. In a [self-hosted environment](</docs/en/self-hosted-environments-deploy#default-deny-egress>), outbound traffic goes through your own network boundary instead. * **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. -To persist environment variables for subsequent Bash commands, write to the file at `$CLAUDE_ENV_FILE`. See [SessionStart hooks](</docs/en/hooks#sessionstart>) 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. +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. ##
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -54,7 +54,7 @@ LOG_LEVEL=debug DATABASE_URL=postgres://localhost:5432/myapp -Each session copies the environment’s values once, at startup, into ordinary environment variables that any command Claude runs can read. Because running sessions don’t re-read the configuration, editing or adding variables affects sessions you start afterward; sessions already running keep the values they started with. Anyone who uses the environment can read the values, and cloud environments have no dedicated secrets store, so don’t add API keys or other credentials. If a session needs a credential anyway, see What carries over from your setup. +Each session copies the environment’s values once, at startup, into ordinary environment variables that any command Claude runs can read. Because running sessions don’t re-read the configuration, editing or adding variables affects sessions you start afterward; sessions already running keep the values they started with. Claude Code on the web also sets some variables itself when it starts a session. For [`CLAUDE_AUTOCOMPACT_PCT_OVERRIDE`](</docs/en/claude-code-on-the-web#manage-context>), the value Claude Code on the web sets overrides one you add here, so adding that key here has no effect. Anyone who uses the environment can read the values, and cloud environments have no dedicated secrets store, so don’t add API keys or other credentials. If a session needs a credential anyway, see What carries over from your setup. ###
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -18,7 +18,7 @@ With only **Default** available, every session runs in it. When you have more than one environment, sessions choose one per surface: * 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-env` pick, or fall back to your first available cloud environment. Passing `--environment <environment-id>` on a [scripted dispatch](</docs/en/self-hosted-environments-testing#run-the-test-loop>) overrides both for that invocation; the flag requires Claude Code v2.1.224 or later. + * From the CLI, sessions use your `/remote-env` pick, or fall back to your first available cloud environment. For a [self-hosted environment](</docs/en/self-hosted-environments>), passing `--environment <environment-id>` with its `ccpool_` ID [when you dispatch a session](</docs/en/self-hosted-environments-testing#run-the-test-loop>) overrides both for that invocation. The flag rejects Anthropic-hosted `env_` IDs, 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.
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -62,7 +62,7 @@ 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`](</docs/en/claude-code-on-the-web#from-terminal-to-web>). The command opens a picker of your existing environments and saves your choice to the `remote.defaultEnvironmentId` key in your [user settings](</docs/en/settings#settings-files>), 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](</docs/en/settings#settings-precedence>), 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](<https://claude.ai/code>). +Run `/remote-env` in your terminal to choose the default environment for cloud sessions you create from the CLI, such as [`claude --cloud`](</docs/en/claude-code-on-the-web#from-terminal-to-web>). The command opens a picker of your existing environments and saves your choice to the `remote.defaultEnvironmentId` key in your [user settings](</docs/en/settings#settings-files>), 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](</docs/en/settings#settings-precedence>), such as a repo’s project settings. A [self-hosted environment](</docs/en/self-hosted-environments>) ID, which has the form `ccpool_...`, follows a stricter source rule. See [`remote.defaultEnvironmentId`](</docs/en/settings#available-settings>) for the settings layers Claude Code honors it from. `/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](<https://claude.ai/code>). ### @@ -142,6 +142,7 @@ * **API requests** : requests from the built-in GitHub tools, and from `gh` under the `proxy-injected` placeholder, go out with your real credentials substituted. * **Push protection** : `git push` works 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. + * **GraphQL restrictions** : the proxy serves only a pinned set of GraphQL operations for pull-request workflows. The proxy rejects everything else on the GraphQL endpoint with a 403 that says `This GraphQL query is not enabled for this session` and names the REST fallback, `gh api repos/{owner}/{repo}/...`. The restriction applies to every request through the proxy regardless of the credentials you supply, so a `GH_TOKEN` you set gets the same 403. Claude can’t reach GitHub APIs that exist only in GraphQL, such as Projects v2, through the proxy. Committed files from public repositories arrive through `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. @@ -164,7 +165,9 @@ 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. +In Anthropic-hosted environments, each session gets a fresh virtual machine (VM) running Ubuntu 24.04 on x86_64, regardless of your own operating system and CPU architecture, with your repository cloned and common toolchains pre-installed. When a dependency provides precompiled binaries, such as Ruby gems with native extensions or prebuilt Python wheels, use its x86_64 Linux build to match the VM. This section covers the Anthropic-hosted defaults, the built-in GitHub tools, how to run tests and services, and the resource limits each VM gets. + +Sessions your organization routes to a [self-hosted environment](</docs/en/self-hosted-environments>) run on your own runners instead, with the tools your runner image provides. ### @@ -204,7 +207,7 @@ Category| Included ---|--- **Python**| Python 3.x with pip, poetry, uv, black, mypy, pytest, ruff -**Node.js**| 20, 21, and 22 via nvm, with npm, yarn, pnpm, bun¹, eslint, prettier, chromedriver +**Node.js**| 20, 21, and 22, with npm, yarn, pnpm, bun¹, eslint, prettier, chromedriver **Ruby**| 3.1, 3.2, 3.3 with gem, bundler, rbenv **PHP**| 8.4 with Composer **Java**| OpenJDK 21 with Maven and Gradle @@ -215,7 +218,7 @@ **Databases**| PostgreSQL 16, Redis 7.0 **Utilities**| git, jq, yq, ripgrep, tmux, vim, nano -¹ Bun is installed but has known proxy compatibility issues for package fetching. For exact versions, ask Claude to run `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. +¹ Bun is installed but has known proxy compatibility issues for package fetching. For exact versions, ask Claude to run `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. Node.js versions are installed at `/opt/node20`, `/opt/node21`, and `/opt/node22`, with 22 on `PATH` by default. To work with a different version, ask Claude to prepend that version’s `bin` directory, such as `/opt/node20/bin`, to `PATH`. 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. ### @@ -296,7 +299,7 @@ Resource limits -Cloud sessions run with approximate resource ceilings that may change over time: +Cloud sessions in Anthropic-hosted environments run with approximate resource ceilings that may change over time: * 4 vCPUs * 16 GB of RAM
modified
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -1,6 +1,6 @@ Cloud environments require [Claude Code on the web](</docs/en/claude-code-on-the-web>), which is in research preview for Pro, Max, and Team users, and for Enterprise users with [premium seats or Chat + Claude Code seats](<https://support.claude.com/en/articles/11845131-use-claude-code-with-your-team-or-enterprise-plan>). -Each [cloud session](</docs/en/claude-code-on-the-web>) runs in a cloud environment. You can configure an environment to allow or deny network access, set environment variables for the session, and run a setup script before Claude starts working. The same environments apply wherever you start a cloud session: [Claude Code on the web](</docs/en/claude-code-on-the-web>), the terminal with [`claude --cloud`](</docs/en/claude-code-on-the-web#from-terminal-to-web>), [Claude Tag](<https://claude.com/docs/claude-tag/overview>), [routines](</docs/en/routines>), the [Claude mobile app](</docs/en/mobile>), and the [Desktop app](</docs/en/desktop>). +Each [cloud session](</docs/en/claude-code-on-the-web>) runs in a cloud environment. You can configure an environment to allow or deny network access, set environment variables for the session, and run a setup script before Claude starts working. The same environments apply wherever you start a cloud session: [Claude Code on the web](</docs/en/claude-code-on-the-web>), the terminal with [`claude --cloud`](</docs/en/claude-code-on-the-web#from-terminal-to-web>), [Claude Tag](<https://claude.com/docs/claude-tag/overview>), [routines](</docs/en/routines>), the [Claude mobile app](</docs/en/mobile>), and the [Desktop app](</docs/en/desktop>). Claude Tag sessions can’t run in [self-hosted environments](</docs/en/self-hosted-environments>) yet; the other surfaces can route to any environment. [Remote Control](</docs/en/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. Claude Tag channel sessions use shared environments only. @@ -18,7 +18,7 @@ With only **Default** available, every session runs in it. When you have more than one environment, sessions choose one per surface: * 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-env` pick, or fall back to your first available cloud environment. + * From the CLI, sessions use your `/remote-env` pick, or fall back to your first available cloud environment. Passing `--environment <environment-id>` on a [scripted dispatch](</docs/en/self-hosted-environments-testing#run-the-test-loop>) overrides both for that invocation; 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. @@ -82,7 +82,7 @@ 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](<https://claude.ai/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](<https://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. In [Claude Tag](<https://claude.com/docs/claude-tag/overview>) channels, Claude works as your organization’s shared identity, not as any member, so channel sessions use shared environments only. You can set the environment a channel uses in two ways: +Owners and admins on Team and Enterprise plans can create cloud environments that are shared with every member of the organization; the same roles manage everything else on the **Cloud environments** admin page, including [self-hosted environments](</docs/en/self-hosted-environments>). 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](<https://claude.ai/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](<https://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. In [Claude Tag](<https://claude.com/docs/claude-tag/overview>) channels, Claude works as your organization’s shared identity, not as any member, so channel sessions use shared environments only. You can set the environment a channel uses in two ways: * Set a shared environment as the organization’s default environment at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). * [Pin one to a channel](<https://claude.com/docs/claude-tag/admins/troubleshooting#channel-sessions-use-the-wrong-environment-or-can%E2%80%99t-find-one>) in the Claude Tag admin settings. @@ -136,7 +136,7 @@ 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: +In Anthropic-hosted environments, 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. Sessions in a self-hosted environment authenticate git operations with credentials your deployment provides; [Configure git](</docs/en/self-hosted-environments-deploy#configure-git>) covers the options, including per-session minted credentials and an opt-in to this same proxy. The proxy provides: * **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 `gh` under the `proxy-injected` placeholder, go out with your real credentials substituted. @@ -151,7 +151,7 @@ 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: +Cloud sessions in Anthropic-hosted environments run behind an HTTP/HTTPS network proxy for security and abuse prevention purposes; in a [self-hosted environment](</docs/en/self-hosted-environments-deploy#default-deny-egress>), outbound traffic leaves through your own network boundary instead. All outbound internet traffic from an Anthropic-hosted session passes through this proxy, which provides: * Protection against malicious requests * Rate limiting and abuse prevention @@ -182,7 +182,7 @@ Your repo’s `.claude/rules/`| Yes| Part of the clone Your repo’s `.claude/skills/`, `.claude/agents/`, `.claude/commands/`| Yes| Part of the clone Plugins declared in `.claude/settings.json`| Yes| Installed at session start from the [marketplace](</docs/en/plugin-marketplaces>) you declared. Requires network access to reach the marketplace source -Your organization’s [server-managed settings](</docs/en/server-managed-settings>)| Yes| Fetched from Anthropic’s servers when the session starts. See [Surface coverage](</docs/en/model-config#surface-coverage>) for how `availableModels` is enforced in cloud sessions. Settings deployed to your device through MDM or managed settings files don’t apply, because the session runs on an Anthropic-managed VM +Your organization’s [server-managed settings](</docs/en/server-managed-settings>)| Yes| Fetched from Anthropic’s servers when the session starts. See [Surface coverage](</docs/en/model-config#surface-coverage>) for how `availableModels` is enforced in cloud sessions. Settings deployed to your device through MDM or managed settings files don’t apply, because the session runs on an Anthropic-managed VM; in a [self-hosted environment](</docs/en/self-hosted-environments>), sessions read the managed settings file in the runner image only when server-managed settings deliver no keys, per [settings precedence](</docs/en/server-managed-settings#settings-precedence>) Your user `~/.claude/CLAUDE.md`| No| Lives on your machine, not in the repo Your user `~/.claude/skills/`, `~/.claude/agents/`, `~/.claude/commands/`| No| Live on your machine, not in the repo. Commit them to the repo’s `.claude/` directory instead. Cloud sessions automatically load skills you enable on claude.ai Plugins enabled only in your user settings| No| User-scoped `enabledPlugins` lives in `~/.claude/settings.json`. Declare them in the repo’s `.claude/settings.json` instead @@ -302,7 +302,7 @@ * 16 GB of RAM * 30 GB of disk -The VM may stop tasks that need significantly more memory, such as large build jobs or memory-intensive tests. For workloads beyond these limits, use [Remote Control](</docs/en/remote-control>) to run Claude Code on your own hardware. +The VM may stop tasks that need significantly more memory, such as large build jobs or memory-intensive tests. For workloads beyond these limits, use [Remote Control](</docs/en/remote-control>) to run Claude Code on your own hardware, or run cloud sessions in a [self-hosted environment](</docs/en/self-hosted-environments>) on compute your organization operates. ## @@ -352,7 +352,7 @@ **When they run**| Before Claude Code launches, skipped when a cached environment exists| After Claude Code launches, on every session including resumed **Where they run**| Cloud sessions only| Local and cloud sessions -If you have SessionStart hooks in your user-level `~/.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](</docs/en/server-managed-settings>). +If you have SessionStart hooks in your user-level `~/.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](</docs/en/server-managed-settings>); sessions in a [self-hosted environment](</docs/en/self-hosted-environments-configuration#permissions-and-tool-approval>) also run hooks the operator seeded from the runner host’s `~/.claude/`. ### @@ -402,7 +402,7 @@ * **No cloud-only scoping** : hooks run in both local and cloud sessions. To skip local execution, check the `CLAUDE_CODE_REMOTE` environment 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. + * **Proxy compatibility** : in Anthropic-hosted environments, all outbound traffic passes through a security proxy, and some package managers don’t work correctly with it; Bun is a known example. In a [self-hosted environment](</docs/en/self-hosted-environments-deploy#default-deny-egress>), outbound traffic goes through your own network boundary instead. * **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. To persist environment variables for subsequent Bash commands, write to the file at `$CLAUDE_ENV_FILE`. See [SessionStart hooks](</docs/en/hooks#sessionstart>) 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. @@ -676,8 +676,9 @@ * [Claude Code on the web](</docs/en/claude-code-on-the-web>): start, manage, and share cloud sessions * [Web quickstart](</docs/en/web-quickstart>): connect GitHub and start your first cloud session - * [Claude Tag](<https://claude.com/docs/claude-tag/overview>): sessions Claude starts from Slack run in the same environments + * [Claude Tag](<https://claude.com/docs/claude-tag/overview>): sessions Claude starts from Slack run in the same Anthropic-hosted environments * [Routines](</docs/en/routines>): scheduled runs use the same environments and network access levels * [Remote Control](</docs/en/remote-control>): run sessions on your own machine’s network and files instead + * [Self-hosted environments](</docs/en/self-hosted-environments>): run cloud sessions on your organization’s own infrastructure * [SessionStart hooks](</docs/en/hooks#sessionstart>): repo-committed setup that runs in local and cloud sessions * [Server-managed settings](</docs/en/server-managed-settings>): organization policy that reaches cloud sessions
added
Show diff (686 lines)
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -0,0 +1,683 @@ +Cloud environments require [Claude Code on the web](</docs/en/claude-code-on-the-web>), which is in research preview for Pro, Max, and Team users, and for Enterprise users with [premium seats or Chat + Claude Code seats](<https://support.claude.com/en/articles/11845131-use-claude-code-with-your-team-or-enterprise-plan>). + +Each [cloud session](</docs/en/claude-code-on-the-web>) runs in a cloud environment. You can configure an environment to allow or deny network access, set environment variables for the session, and run a setup script before Claude starts working. The same environments apply wherever you start a cloud session: [Claude Code on the web](</docs/en/claude-code-on-the-web>), the terminal with [`claude --cloud`](</docs/en/claude-code-on-the-web#from-terminal-to-web>), [Claude Tag](<https://claude.com/docs/claude-tag/overview>), [routines](</docs/en/routines>), the [Claude mobile app](</docs/en/mobile>), and the [Desktop app](</docs/en/desktop>). + +[Remote Control](</docs/en/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. Claude Tag channel sessions use shared environments only. + +## + +​ + +The Default environment + +Onboarding sets up the **Default** environment for you, whether you connect through [the web](</docs/en/web-quickstart#connect-github>) 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. + +With only **Default** available, every session runs in it. When you have more than one environment, sessions choose one per surface: + + * 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-env` pick, or fall back to your first available cloud environment. + +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 + +Create, edit, and archive environments from the environment selector at [claude.ai/code](<https://claude.ai/code>), which you reach after [web onboarding](</docs/en/web-quickstart>). 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. + +1 + +Open the environment selector + +On [claude.ai/code](<https://claude.ai/code>), select the cloud icon showing the current environment’s name, in the row above the message box. There’s no settings page or direct URL for the selector. + +2 + +Add or edit an environment + +Select **Add cloud environment** , or hover over an existing environment and select the settings icon that appears on the right. The dialog includes the name, network access level, environment variables, and setup script. + +### + +​ + +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 + +Each session copies the environment’s values once, at startup, into ordinary environment variables that any command Claude runs can read. Because running sessions don’t re-read the configuration, editing or adding variables affects sessions you start afterward; sessions already running keep the values they started with. Anyone who uses the environment can read the values, and cloud environments have no dedicated secrets store, so don’t add API keys or other credentials. If a session needs a credential anyway, see What carries over from your setup. + +### + +​ + +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`](</docs/en/claude-code-on-the-web#from-terminal-to-web>). The command opens a picker of your existing environments and saves your choice to the `remote.defaultEnvironmentId` key in your [user settings](</docs/en/settings#settings-files>), 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](</docs/en/settings#settings-precedence>), 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](<https://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](</docs/en/routines#environments-and-network-access>), 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](<https://claude.ai/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](<https://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. In [Claude Tag](<https://claude.com/docs/claude-tag/overview>) channels, Claude works as your organization’s shared identity, not as any member, so channel sessions use shared environments only. You can set the environment a channel uses in two ways: + + * Set a shared environment as the organization’s default environment at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). + * [Pin one to a channel](<https://claude.com/docs/claude-tag/admins/troubleshooting#channel-sessions-use-the-wrong-environment-or-can%E2%80%99t-find-one>) in the Claude Tag admin settings. + +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](</docs/en/routines#environments-and-network-access>); personal environments don’t have a separate page in your claude.ai account settings. + +MCP connectors you enable on a session or routine work without adding their hosts to **Allowed domains** , because connector traffic travels through Anthropic’s servers rather than the session’s network. You configure connectors per session or per routine; remove any you don’t need to limit which tools Claude can reach. This relies on the same Anthropic-bound channel noted under [Security and isolation](</docs/en/claude-code-on-the-web#security-and-isolation>). + +### + +​ + +Access levels + +The **Network access** field in the environment dialog takes one of four levels: + +Level| Outbound connections +---|--- +**None**| No outbound network access through the session’s network +**Trusted**| Allowlisted domains only: package registries, GitHub, cloud SDKs +**Full**| Any domain +**Custom**| Your own allowlist, optionally including the defaults + +GitHub operations use a separate proxy that is independent of this setting, and Claude Code’s connection to the Anthropic API still works at **None** , as noted under [Security and isolation](</docs/en/claude-code-on-the-web#security-and-isolation>). + +### + +​ + +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 + *.internal.example.com + registry.example.com + +Sessions in this environment can now reach `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](</docs/en/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 `gh` under the `proxy-injected` placeholder, go out with your real credentials substituted. + * **Push protection** : `git push` works 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. + +Committed files from public repositories arrive through `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](</docs/en/server-managed-settings>). + +| Available in cloud sessions| Why +---|---|--- +Your repo’s `CLAUDE.md`| Yes| Part of the clone +Your repo’s `.claude/settings.json` hooks| Yes| Part of the clone +Your repo’s `.mcp.json` MCP servers| Yes| Part of the clone +Your repo’s `.claude/rules/`| Yes| Part of the clone +Your repo’s `.claude/skills/`, `.claude/agents/`, `.claude/commands/`| Yes| Part of the clone +Plugins declared in `.claude/settings.json`| Yes| Installed at session start from the [marketplace](</docs/en/plugin-marketplaces>) you declared. Requires network access to reach the marketplace source +Your organization’s [server-managed settings](</docs/en/server-managed-settings>)| Yes| Fetched from Anthropic’s servers when the session starts. See [Surface coverage](</docs/en/model-config#surface-coverage>) for how `availableModels` is enforced in cloud sessions. Settings deployed to your device through MDM or managed settings files don’t apply, because the session runs on an Anthropic-managed VM +Your user `~/.claude/CLAUDE.md`| No| Lives on your machine, not in the repo +Your user `~/.claude/skills/`, `~/.claude/agents/`, `~/.claude/commands/`| No| Live on your machine, not in the repo. Commit them to the repo’s `.claude/` directory instead. Cloud sessions automatically load skills you enable on claude.ai +Plugins enabled only in your user settings| No| User-scoped `enabledPlugins` lives in `~/.claude/settings.json`. Declare them in the repo’s `.claude/settings.json` instead +MCP servers you added with `claude mcp add` at the default local scope or the user scope| No| Those write to `~/.claude.json` on your machine, not the repo. Add the server with `claude mcp add --scope project`, which writes the repo’s [`.mcp.json`](</docs/en/mcp#project-scope>), and commit that file +Transport variables in your repo’s `.claude/settings.json` `env` block, such as `NODE_EXTRA_CA_CERTS` and the [mTLS client certificate variables](</docs/en/network-config#mtls-authentication>)| No| The hosting environment manages the session’s API connection, so Claude Code ignores these keys and notes each ignored key in the session’s debug log +Static API tokens and credentials| No| No dedicated secrets store exists yet. See below +Interactive auth like AWS SSO| No| Not supported. SSO requires browser-based login that can’t run in a cloud session + +To make your own configuration available in cloud sessions, commit it to the repo. A dedicated secrets store is not yet available, and the dialog warns against adding secrets or credentials: environment variables and setup scripts live in the environment configuration, where anyone who uses the environment can read them. If a session needs a credential anyway, add it with that visibility in mind. + +### + +​ + +Installed tools + +Cloud sessions come with common language runtimes, build tools, and databases pre-installed. The table below summarizes what’s included by category. + +Category| Included +---|--- +**Python**| Python 3.x with pip, poetry, uv, black, mypy, pytest, ruff +**Node.js**| 20, 21, and 22 via nvm, with npm, yarn, pnpm, bun¹, eslint, prettier, chromedriver +**Ruby**| 3.1, 3.2, 3.3 with gem, bundler, rbenv +**PHP**| 8.4 with Composer +**Java**| OpenJDK 21 with Maven and Gradle +**Go**| latest stable with module support +**Rust**| rustc and cargo +**C/C++**| GCC, Clang, cmake, ninja, conan +**Docker**| docker, dockerd, docker compose +**Databases**| PostgreSQL 16, Redis 7.0 +**Utilities**| git, jq, yq, ripgrep, tmux, vim, nano + +¹ Bun is installed but has known proxy compatibility issues for package fetching. For exact versions, ask Claude to run `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](</docs/en/claude-code-on-the-web#github-authentication-options>), so your token never enters the container. You can set `GH_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 [`gh` CLI](<https://cli.github.com>) 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-injected` in the commands Claude runs, and the proxy substitutes your real credentials on outbound GitHub requests. `gh` works without a token of your own, but a script that reads `GITHUB_TOKEN` directly gets the placeholder, not a usable token. + +A token you set is an ordinary environment variable, so anyone who uses the environment can read it; the proxy path keeps the credential out of the environment configuration and the session VM. To check which case applies to your session, ask Claude to run `echo $GH_TOKEN`. GitHub’s [`gh` CLI](<https://cli.github.com>) 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: + +1 + +Install gh in your setup script + +Add `apt update && apt install -y gh` to your setup script. + +2 + +Provide a token if the proxy is not handling authentication + +If `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 the `CLAUDE_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`](</docs/en/settings#attribution-settings>) 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: + + echo "https://claude.ai/code/${CLAUDE_CODE_REMOTE_SESSION_ID/#cse_/session_}" + +### + +​ + +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 in `tests/`” 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: + + service postgresql start + + service redis-server start + +Docker is available for running containerized services. Ask Claude to run `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 + +The VM may stop tasks that need significantly more memory, such as large build jobs or memory-intensive tests. For workloads beyond these limits, use [Remote Control](</docs/en/remote-control>) to run Claude Code on your own hardware. + +## + +​ + +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, so `apt 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](<https://cli.github.com>), which isn’t pre-installed. + + #!/bin/bash + apt update && apt install -y gh + +### + +​ + +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 `|| true` to 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 `&` and `wait`, 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, a `docker 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](</docs/en/hooks#sessionstart>) for project setup that should run everywhere, cloud and local, like `npm install`. Setup scripts and SessionStart hooks run in a fixed order when a cloud session starts: + + 1. The setup script runs first, before Claude Code launches, and only when no cached environment exists. + 2. Claude Code launches and runs your SessionStart hooks, as it does at the start of every session, local or cloud. + +| Setup scripts| SessionStart hooks +---|---|--- +**Where you configure them**| The environment dialog at [claude.ai/code](<https://claude.ai/code>)| A [settings file](</docs/en/settings#settings-files>) such as your repo’s `.claude/settings.json`; see What carries over from your setup for which files reach a cloud session +**When they run**| Before Claude Code launches, skipped when a cached environment exists| After Claude Code launches, on every session including resumed +**Where they run**| Cloud sessions only| Local and cloud sessions + +If you have SessionStart hooks in your user-level `~/.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](</docs/en/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: + + { + "hooks": { + "SessionStart": [ + { + "matcher": "startup|resume", + "hooks": [ + { + "type": "command", + "command": "bash \"$CLAUDE_PROJECT_DIR\"/scripts/install_pkgs.sh" + } + ] + } + ] + } + } + +The `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: + + #!/bin/bash + + if [ "$CLAUDE_CODE_REMOTE" != "true" ]; then + exit 0 + fi + + npm install + pip install -r requirements.txt + exit 0 + +The `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_REMOTE` environment 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. + +To persist environment variables for subsequent Bash commands, write to the file at `$CLAUDE_ENV_FILE`. See [SessionStart hooks](</docs/en/hooks#sessionstart>) 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 + + * api.anthropic.com + * statsig.anthropic.com + * docs.claude.com + * platform.claude.com + * code.claude.com + * claude.ai + +Version control + + * github.com + * [www.github.com](<http://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](<http://www.gitlab.com>) + * registry.gitlab.com + * bitbucket.org + * [www.bitbucket.org](<http://www.bitbucket.org>) + * api.bitbucket.org + +Container registries + + * registry-1.docker.io + * auth.docker.io + * index.docker.io + * hub.docker.com + * [www.docker.com](<http://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.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](<http://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](<http://www.oracle.com>) + * java.com + * [www.java.com](<http://www.java.com>) + * java.net + * [www.java.net](<http://www.java.net>) + * download.oracle.com + * yum.oracle.com + +JavaScript and Node package managers + + * registry.npmjs.org + * [www.npmjs.com](<http://www.npmjs.com>) + * [www.npmjs.org](<http://www.npmjs.org>) + * npmjs.com + * npmjs.org + * yarnpkg.com + * registry.yarnpkg.com + +Python package managers + + * pypi.org + * [www.pypi.org](<http://www.pypi.org>) + * files.pythonhosted.org + * pythonhosted.org + * test.pypi.org + * pypi.python.org + * pypa.io + * [www.pypa.io](<http://www.pypa.io>) + +Ruby package managers + + * rubygems.org + * [www.rubygems.org](<http://www.rubygems.org>) + * api.rubygems.org + * index.rubygems.org + * ruby-lang.org + * [www.ruby-lang.org](<http://www.ruby-lang.org>) + * rubyforge.org + * [www.rubyforge.org](<http://www.rubyforge.org>) + * rubyonrails.org + * [www.rubyonrails.org](<http://www.rubyonrails.org>) + * rvm.io + * get.rvm.io + +Rust package managers + + * crates.io + * [www.crates.io](<http://www.crates.io>) + * index.crates.io + * static.crates.io + * rustup.rs + * static.rust-lang.org + * [www.rust-lang.org](<http://www.rust-lang.org>) + +Go package managers + + * proxy.golang.org + * sum.golang.org + * index.golang.org + * golang.org + * [www.golang.org](<http://www.golang.org>) + * goproxy.io + * pkg.go.dev + +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](<http://www.gradle.org>) + * services.gradle.org + * plugins.gradle.org + * kotlinlang.org + * [www.kotlinlang.org](<http://www.kotlinlang.org>) + * spring.io + * repo.spring.io + +Other package managers + + * packagist.org (PHP Composer) + * [www.packagist.org](<http://www.packagist.org>) + * repo.packagist.org + * nuget.org (.NET NuGet) + * [www.nuget.org](<http://www.nuget.org>) + * api.nuget.org + * pub.dev (Dart/Flutter) + * api.pub.dev + * hex.pm (Elixir/Erlang) + * [www.hex.pm](<http://www.hex.pm>) + * cpan.org (Perl CPAN) + * [www.cpan.org](<http://www.cpan.org>) + * metacpan.org + * [www.metacpan.org](<http://www.metacpan.org>) + * api.metacpan.org + * cocoapods.org (iOS/macOS) + * [www.cocoapods.org](<http://www.cocoapods.org>) + * cdn.cocoapods.org + * haskell.org + * [www.haskell.org](<http://www.haskell.org>) + * hackage.haskell.org + * swift.org + * [www.swift.org](<http://www.swift.org>) + +Linux distributions + + * archive.ubuntu.com + * security.ubuntu.com + * ubuntu.com + * [www.ubuntu.com](<http://www.ubuntu.com>) + * *.ubuntu.com + * ppa.launchpad.net + * launchpad.net + * [www.launchpad.net](<http://www.launchpad.net>) + * *.nixos.org + +Development tools and platforms + + * dl.k8s.io (Kubernetes) + * pkgs.k8s.io + * k8s.io + * [www.k8s.io](<http://www.k8s.io>) + * releases.hashicorp.com (HashiCorp) + * apt.releases.hashicorp.com + * rpm.releases.hashicorp.com + * archive.releases.hashicorp.com + * hashicorp.com + * [www.hashicorp.com](<http://www.hashicorp.com>) + * repo.anaconda.com (Anaconda/Conda) + * conda.anaconda.org + * anaconda.org + * [www.anaconda.com](<http://www.anaconda.com>) + * anaconda.com + * continuum.io + * apache.org (Apache) + * [www.apache.org](<http://www.apache.org>) + * archive.apache.org + * downloads.apache.org + * eclipse.org (Eclipse) + * [www.eclipse.org](<http://www.eclipse.org>) + * download.eclipse.org + * nodejs.org (Node.js) + * [www.nodejs.org](<http://www.nodejs.org>) + * developer.apple.com + * developer.android.com + * pkg.stainless.com + * binaries.prisma.sh + +Cloud services and monitoring + + * statsig.com + * [www.statsig.com](<http://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 + + * sourceforge.net + * *.sourceforge.net + * packagecloud.io + * *.packagecloud.io + * fonts.googleapis.com + * fonts.gstatic.com + +Schema and configuration + + * json-schema.org + * [www.json-schema.org](<http://www.json-schema.org>) + * json.schemastore.org + * [www.schemastore.org](<http://www.schemastore.org>) + +Model Context Protocol + + * *.modelcontextprotocol.io + +## + +​ + +Related resources + + * [Claude Code on the web](</docs/en/claude-code-on-the-web>): start, manage, and share cloud sessions + * [Web quickstart](</docs/en/web-quickstart>): connect GitHub and start your first cloud session + * [Claude Tag](<https://claude.com/docs/claude-tag/overview>): sessions Claude starts from Slack run in the same environments + * [Routines](</docs/en/routines>): scheduled runs use the same environments and network access levels + * [Remote Control](</docs/en/remote-control>): run sessions on your own machine’s network and files instead + * [SessionStart hooks](</docs/en/hooks#sessionstart>): repo-committed setup that runs in local and cloud sessions + * [Server-managed settings](</docs/en/server-managed-settings>): organization policy that reaches cloud sessions