OmniscioGuidesClaude Code cloud environments
Claude Code cloud environments: what a session gets before it starts
A cloud session is not your machine with a different window. In an Anthropic-hosted environment it is a fresh x86_64 virtual machine running Ubuntu 24.04, with your repository cloned and common toolchains pre-installed, and the environment is the configuration it starts from.
This page is the environment itself: where you edit one, the four settings it holds, what each one changes, and how to retire it. The cloud sessions guide covers starting, steering and pulling a session back to your terminal, and the self-hosted environments guide covers running the machine yourself.
Sources read November 25, 2026. By the Omniscio team. Updated .
Where you edit one
Your own environments are added and edited from the environment selector, the first control in the row under the message box on the screen where you start a new session at claude.ai/code. New environment at the bottom of the menu opens the form, and an environment's settings icon opens it for editing. An organization-shared environment opens read-only there for every member, Owners included, because an Owner edits it on the Cloud environments page in admin settings.
That selector is there only until you send a new session's first message. For a cloud session of your own that is already running, select the caret after the session title at the top, then Edit cloud environment.
From the terminal, /remote-env chooses the default environment for cloud sessions you create with claude --cloud. It saves the choice and starts nothing, and it is a default rather than a rule: with no pick saved, Claude Code falls back to the Anthropic-hosted environment when your list has one, and otherwise to the first environment in the list that is not a Remote Control bridge environment.
What an environment decides
Each cloud session runs in a cloud environment. An environment lets you 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.
One environment serves every place a cloud session can start: the Desktop app, the Claude mobile app, claude.ai/code, the terminal with claude --cloud, cloud scheduled tasks and Claude Tag. Remote Control is the exception, because that session runs on your own machine and uses your own network and files.
What you get before configuring anything
If you have no environment yet, onboarding sets up one called Default. How depends on where you onboard: the CLI flows such as /web-setup and web onboarding on Pro, Max and Ultra create it for you, while web onboarding on Team and Enterprise shows a Create your first cloud environment form unless an Owner has turned on Quick setup.
Default is the baseline rather than a configured environment. It sets Limited network access, which reaches package registries and other allowlisted domains, and it defines no environment variables and no setup script, so sessions start with just the pre-installed tools.
That is enough for a repository whose dependencies install from public registries. It is not enough when Claude has to reach a domain outside the allowlist, when sessions need variables, or when toolchains have to be installed before work starts, which is exactly when you configure one.
Cloud sessions are available on Pro, Max, Ultra and Team plans, and for Enterprise users with premium seats or Chat + Claude Code seats. Which environment a session gets depends on where you start it: in the Desktop app, the mobile app and claude.ai/code, a session you start uses the environment shown in the selector, and an organization default set by an Owner fills the choice when you have not picked one; from the CLI it is the /remote-env pick; a thread in a project uses the environment set in the project's settings.
Network access: None, Limited or Full
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.
| Level | Outbound connections |
|---|---|
| None | No outbound network access through the session's network |
| Limited | The default allowlist of package registries, GitHub and cloud SDKs while Allow package managers is checked, plus any domains you list |
| Full | Any domain |
A few paths never go through that allowlist, at any level: GitHub, which has its own proxy; MCP connectors you enable, whose traffic travels through Anthropic's servers; the hosts you listed on the environment's network secrets, except the hosts that never get the secret; and the Anthropic API, which Claude Code reaches for its own requests even at None.
GitHub appears in both lists, which is Anthropic's own wording and worth knowing: Limited reaches GitHub, and GitHub traffic still goes through the dedicated proxy rather than the session's allowlist. Plan your rules around the proxy, not the table cell.
Adding a domain
To allow something outside the default allowlist, choose Limited and list one domain per line in Allowed domains. A leading *. matches every subdomain.
api.example.com
*.internal.example.com
registry.example.comClearing Allow package managers leaves the default allowlist out and keeps only the domains you listed. Each environment has its own list, and no server-managed setting pushes domains into it, so a team-standard list means one organization-shared environment.
A change to an Anthropic-hosted environment's network access reaches its existing sessions within about a minute, for requests that go through the allowlist, so you do not have to start a new session to make it take effect.
Environment variables
Environment variables use .env format, one KEY=value pair per line. Plain values need no quotes, a matching pair of quotes is removed rather than kept, and a value with a # or a line break has to be quoted because an unquoted # starts a comment.
NODE_ENV=development
LOG_LEVEL=debug
DATABASE_URL=postgres://localhost:5432/myappA session reads those values into ordinary environment variables that any command Claude runs can read, with one exception: OTEL_* variables are used for Claude Code's own telemetry export and are not passed to the commands it runs.
When a change reaches a session
In an Anthropic-hosted environment, a session reads the values when you create it, and again each time Claude Code starts in its VM afterwards, which happens when an idle VM is restored or when a reclaimed VM is rebuilt. After you edit a variable, an existing session there keeps the values it last read until its VM is next restored or rebuilt.
To use a new value immediately, Anthropic's two options are to set it on the command Claude runs, for example LOG_LEVEL=trace npm test, or to start a new session. The environment variables guide covers the variables Claude Code reads from your own shell and settings, which is a different list.
Network secrets: an API key Claude never sees
A network secret is an API key or token stored 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.
That is the difference from a variable. Anyone who uses the environment can read its variables and setup script, and Anthropic's dialog says so and warns against putting secrets there.
What a secret needs to work
- It is available on Pro, Max, Ultra, Team and Enterprise plans, and only on an Anthropic-hosted environment: a self-hosted one does not have network secrets.
- The API it points at has to accept connections from the internet, because requests leave from Anthropic's network.
- If your organization uses customer-managed encryption keys, you cannot save one.
- On every plan you can add and delete secrets on your own environments whatever your role; on a Team or Enterprise shared environment an Owner adds them from admin settings.
What never gets the secret
The proxy attaches a secret when a request's host matches one you listed, and that host is reachable even when the environment's access level would not otherwise allow it. Four kinds of request are excluded on purpose: GitHub, which its own proxy authenticates; the Anthropic API and the public package registries; setup script requests, because Claude Code connects to the proxy after the script has run; and Claude Code's own telemetry export.
To check one, 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 appears in neither the session's environment variables nor any file.
A setup script, and the cache that skips it
A setup script is a Bash script that runs when a new cloud session starts, before Claude Code launches. Use it to install dependencies, configure tools, or fetch anything the session needs that is not pre-installed. Scripts run as root on Ubuntu 24.04, so apt install and most language package managers work.
#!/bin/bash
apt update && apt install -y shellcheckYou add it in the environment's Setup script row, by typing or pasting it or by loading a text file up to 64 KB.
The four constraints worth writing around
- Exit zero: a non-zero exit fails the session's start or leaves whatever the script did not install missing, so Anthropic's advice is to append
|| trueto non-critical commands. - Finish in about five minutes, because a script that takes longer is not cached. Run independent installs in parallel with
&andwait. - Reach the registries: installs need network access, and None means they fail.
- Do not rely on the environment's variables: the script runs before the session sets them, so a value the script needs belongs in the script.
Why it usually does not run a second time
When setup completes within roughly five minutes, Anthropic snapshots the filesystem and uses that snapshot as the starting point for later sessions, which skip the script. That is what keeps startup fast when the script installs a toolchain or pulls images.
The snapshot keeps what the script wrote to disk and loses anything that was only running. Packages, pulled images and files carry over; a database the script started or a docker compose up stack does not, so those are started per session, by asking Claude or with a SessionStart hook.
The script runs again, rebuilding the cache, when you change the script or the allowed hosts, and when the cache expires after roughly seven days. In an Anthropic-hosted environment it does not run when a session's VM is merely restored after being idle, so a script change reaches an existing session only when that VM is reclaimed and rebuilt.
Anthropic splits the jobs like this: a setup script provisions the VM itself, with toolchains and CLI tools that are not pre-installed, while a SessionStart hook does project setup that should run everywhere, cloud and local, such as npm install.
Archiving an environment
To archive one of your own environments, open it for editing and select Archive environment. A shared environment is archived by an Owner from the Cloud environments page in admin settings instead.
Archiving affects new sessions, not running ones. Sessions already running keep working, the environment disappears from the selector and from /remote-env, and no new session can start in it on any surface, including a cloud scheduled task pointed at it.
Network secrets on the environment stay attached in its running sessions, so Anthropic's advice is to delete any you no longer want before you archive. An Anthropic-hosted environment is archived rather than deleted: neither the environment dialog nor the admin page offers a delete for it.
Sources
Every line on this page rests on one of these. The date beside each one is the day we read it.
- Configure cloud environments, for the environment model, the Default environment, the three network access levels, allowed domains, environment variables, network secrets, setup scripts and environment caching,
/remote-envand archiving. Read November 25, 2026.
Cloud environments are a fast-moving part of Claude Code, and the names have moved before: an environment saved as Trusted or Custom now opens as one of the three levels described here. Read the access-level table again before you trust a copy of this page from a few months back.
Common questions
What is a cloud environment in Claude Code?
Every cloud session runs in a cloud environment, and an environment decides what network the session can reach, which environment variables it gets, which stored secrets the agent proxy may attach, and what setup script runs before Claude starts.
What does the Default cloud environment do?
Nothing beyond the baseline. Anthropic says Default carries Limited network access, which reaches package registries and other allowlisted domains, and no environment variables or setup script, so a session starts with just the pre-installed tools.
Where should an API key go, an environment variable or a network secret?
Anyone who uses the environment can read its variables and setup script, so Anthropic says to use a network secret for a key the agent proxy can attach to a request. The proxy adds the key after the request leaves the session's VM, so the key stays outside it.
Why does my setup script not run again?
When setup finishes within roughly five minutes, Anthropic snapshots the filesystem and later sessions start from that snapshot, skipping the script. It runs again when you change the script or the allowed hosts, or when the cache expires after about seven days.
Which cloud sessions use the environment I configured?
The same environments apply wherever a cloud session starts: the Desktop app, the Claude mobile app, claude.ai/code, the terminal with claude --cloud, cloud scheduled tasks and Claude Tag. Remote Control is the exception, because that session runs on your own machine.
Cloud sessions and local ones, side by side
Omniscio runs several agent sessions in one window, each with its own context and its own diff view. Any model, any harness: Claude Code, Codex, OpenCode, Devin, Pi and Hermes are all supported.