Claude Code on the web
Claude Code on the web runs
Claude Code sessions in the cloud, which AgentSpaces calls Claude Cloud sessions: you start them at claude.ai/code, in the Claude desktop and
mobile apps, from a routine, or with claude --cloud. With a self-hosted environment, those
sessions run on machines you choose instead of Anthropic’s. A project can be that
environment. Each session then gets a machine of its own in the project, which works for the
member of your organization who started the session. The machine is suspended when the session is
idle, and resumes with its files still there when you send the next message.
You keep using claude.ai and the Claude apps to start sessions and talk to them. AgentSpaces only runs them.
Self-hosted environments are in public beta at Anthropic, for Claude Team and Enterprise organizations. The project setting is offered to staff only for now.
Set it up
- An Owner of your Claude Team or Enterprise organization turns on Allow self-hosted
environments and creates a self-hosted environment at
claude.ai/admin-settings/cloud-environments.
Copy its environment key, and note the environment’s id (
ccpool_…). - In the AgentSpaces portal, open the project’s Settings, tab Claude, and switch on Claude Code on
the web. Paste the environment id and key. You can also set:
- after how many idle minutes a session’s machine is suspended (30), and how long one run of a session may last (8 hours);
- how many days a session’s machine is kept after it was last used (14).
- Pick the environment in claude.ai/code’s environment picker and start a session. It shows
up on the project’s canvas as a machine named
c-and twelve letters and digits.

A session’s machine is the agent of that session, so it has an agent’s size: 2 vCPUs, 1 GiB of memory and an 8 GiB disk (fixed sizes). A session’s machine made before keeps its disk, and takes 2 vCPUs and 1 GiB at its next start.
Who may run sessions
The members of the project’s AgentSpaces organization. A session starts only when the email of the Claude account that started it is the confirmed email of a member’s AgentSpaces account. Anyone else in your Claude organization who picks the environment sees the session refused: “this Claude account isn’t a member of the AgentSpaces organization that owns this project; an owner or admin can invite it”. To let someone in, invite them to the organization with the email of their Claude account; once they have accepted and confirmed it, their sessions start. Nothing in the setting changes.
Someone who leaves the organization, or is removed, is disabled: they can’t start new sessions. A session they had running goes on until it ends, and their session machines stay. An owner or admin deletes them on Members once no machine acts for them.
Two things look alike but don’t work here:
- A Claude Managed Agents environment (the Claude Console; its id starts with
env_) is for Anthropic’s agent API, a different product. Connect it under Claude Managed Agents instead (Claude Managed Agents). - A Claude API key (
sk-ant-api…) is not an environment key. The environment’s key is on its Configuration tab in claude.ai.
The portal says so when it is given either one. Anthropic has no way to check an environment key on its own, so the key is checked when the project’s orchestrator first uses it: the Credentials page then says whether it works.
Switching the setting off removes the project’s orchestrator machine and the stored key. The sessions’ machines stay: they are ordinary machines of the project, and hold the sessions' files. Delete them when you are done.
What happens
- An orchestrator (a machine of the project’s that members don’t see) runs Anthropic’s
claude self-hosted-runner orchestrator. When a session needs a runner, it gives the session its machine: it creates one for a new session, or resumes the session’s own machine when you come back to it. - The session’s machine runs one Claude Code runner for that session. The session’s
repositories are cloned into
/workspace. When the session has been idle for the minutes you set, the runner hands the session back to Anthropic and the machine is suspended. The next message resumes the same machine, with its disk as you left it: the branch the session was on, edits it didn’t commit (staged or not), new files, local commits, installed dependencies and build caches are all still there. When the session hands back, its working tree is saved in the clone asrefs/space/keep/<session>(never pushed), and put back before Claude Code starts again. - A day after its session last ran, the session’s machine becomes a checkpoint: a
snapshot of its disk named after the machine (
c-…), taggedccrand with the session’s id, listed with the project’s checkpoints. Then the machine is deleted, so it no longer counts against the project’s machines. Anthropic doesn’t tell us when you delete or archive a session, so a day of quiet is the only sign we have. - If you come back to the session, its machine is made again from that checkpoint, with everything it had on its disk, and the session goes on. The first message takes a little longer while the machine is made.
- The checkpoint is deleted once the session has been idle for the retention days you set (Days kept). After that, a session that comes back starts on a new machine.
The canvas shows each session as a Claude Cloud session in the agents view, under the member it runs for: the Claude mark, their name, what it is doing (working, with what it says, idle while it waits for you, or asleep, its machine suspended) and the app it was started from. Double-click it, or pick Open in claude.ai in its menu, to open the session at claude.ai. The conversation itself is at claude.ai, not on the canvas.
Each session is also an agent of yours, named as its machine. The agents it starts
(space-env agents spawn) appear below its card, as an agent’s subagents appear below
theirs. A notification it sends you (space-env notify) comes from the session’s agent, as
any agent’s does, and opens the session at claude.ai: you answer it there, so it has no
Reply in the portal or the app.
Sessions run on your Claude organization’s own Claude Code usage: Anthropic bills them as any Claude Code session. AgentSpaces bills the machines.
What a session knows of AgentSpaces
Claude in a session knows it runs on AgentSpaces, for you. Each time a session’s runner starts (a new session, or a resumed one), its machine puts these in Claude Code’s own settings directory beside what Anthropic syncs from claude.ai (your claude.ai skills, plugins and connectors):
- a short
CLAUDE.md: the machine’s name, the project, who the session acts for, and how to use another machine (below); - the
space-envskill (whatspace-envcan do: messages, machines, credentials, artifacts and shares, notifying you) and theagentspaces-handbookskill; - the
AGENTS.mdandskills/of the project’s repo in your organization’s git and of your ownhomerepo; - your Claude Code agent repo,
claude-codein your git namespace, made the first time a session of yours uses it and shared by all your sessions: itsAGENTS.md,skills/and memory.
A session remembers by writing Markdown files in /space/agent/memory/. They are committed
and pushed to your claude-code repo when the session’s runner stops (or at once with
space-env layers sync), and your next session reads them. Two sessions that remember at
the same time are merged; one that can’t be merged is kept on its machine and you get a
notification.
Commits in /space/ name you as their author (by your name in your organization’s git, or
else the email you started the session with, and your address there, so the commit links to
you) and Claude Code as their committer, so the git history shows both: the memory
commits, and commits the session makes there itself with git. They are not signed and run
no hooks: each checkout’s own git settings say so, while the session’s own repository in
/workspace keeps the runner’s.
A session’s start waits for this at most about two seconds; when your organization’s git is slower (suspended, say), the session starts with what its machine had, and the next start has the rest.
Using another machine
Ask the session to run space-env tools attach <machine> with one of the project’s
machines (a big build machine, say); space-env tools status lists the machines it can
attach to, every machine of the project but the sessions’ own. From its next command on, its Bash commands run on that
machine, each in that machine’s /workspace, while the session’s own working tree, its file
tools and claude.ai’s diff stay on the session’s machine. That machine’s files are at
/machine/ on the session’s machine, to read and edit (its /workspace at
/machine/workspace), and git there acts as you: its pushes to your organization’s git
are yours, and its commits name you as their author and Claude Code as their committer,
as in /space/ (above). The machine’s own git
settings are left alone: the identity comes with the session’s commands only.
space-env tools detach brings the commands back and unmounts /machine/. When the
session’s runner stops (the session ended, or was idle and released), its machine detaches by
itself, so the other machine is free for anyone else to attach to; a session that comes back
attaches again.
A session is an agent
As an agent of yours (above; space-env agents shows it in the tree, under you), a session
can do what any of your agents can:
- Hand work to subagents. Ask it to spawn one (
space-env agents spawn): the subagent runs on a machine of its own, works for you and reports back to the session. Subagents count towards your agents in the project, as any agent’s do. - Get messages. A subagent’s report, a topic it follows or someone’s
space-env sendreaches the session at its turns: what came while it was idle is added to the next message you send it, and what comes while it works is given to it before it finishes. A message can’t start a turn by itself: it waits until you write to the session again. - Tell you. When you aren’t watching the conversation (it’s done, it’s stuck, it has a
question), the session reaches you with
space-env notify, in the AgentSpaces app or a chat you connected, with a link that opens the conversation at claude.ai.
Its messages to machines and agents come from the session’s agent (agent:<name>).
Your environment key
The key lets whoever holds it take every session of the environment. It is kept by AgentSpaces’ credential service, and only the project’s orchestrator can use it. Even the orchestrator never sees it: it sends a placeholder, and the credential proxy puts the key in on the way to Anthropic. No session machine and no other machine of the project can use it, and it is not listed among the project’s credentials. The Credentials page shows it as the project’s Claude Code environment, where you can replace or remove it.
To rotate it, generate a new key on the environment’s Configuration tab in claude.ai, replace it on the Credentials page, and revoke the old one in claude.ai.
A session’s machine gets only a single-use work order for its session, which Anthropic issues for about two minutes. It is deleted once the runner has registered.
If Anthropic refuses the key, the project gets an alert with a link to the Credentials page. Replace the key there.
A session’s machine acts for the member who started the session, as their own machines do:
it uses their credentials and the project’s, can start machines and agents, share artifacts
and message other machines, lists, starts, suspends, resumes and resizes the project’s machines
with space-env machines (and deletes those it or the member created), and reaches the internet as the project allows. It
is one of the platform’s machines: it counts with the agents’ machines (5 running per member,
see Machines), not against the running vCPUs and memory.
The project’s activity shows what it did under that member. When the organization’s
agents’ count is full, a new session is refused until a session or agent falls asleep.
Limits
- A session’s machine clones repositories over its own internet access, from GitHub, GitLab
or any other host: a public repository works, a private one needs credentials on the
machine. Starting a session from a terminal (
claude --environment ccpool_… "…"in a checkout of the repository) works too. - A runner locks to the first person who uses it; on AgentSpaces every session has a runner and a machine of its own, so that never mixes two people’s sessions.