# --environment Flag

> It starts a cloud session on your own machines.

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** claude --environment, --environment, --ref

## Think of it like

It is like you bake the cake at home. You do not buy it at the shop.

## Definition

--environment starts a new cloud session on a self-hosted environment, a pool of your own machines. Give it the environment's ID, which starts with ccpool_. The session works from your current commit. Add --ref with a branch name to start from that branch. It needs Claude Code version 2.1.224 or later.

## Example

Jack's company keeps code inside its own network. He runs claude --environment with the team's pool ID, and the task runs on the company's machines.

## Example code

```bash
claude -p "Run the smoke test" --environment ccpool_abc123 --ref main
```

Run a task on your own pool, from main.

## Why it matters

You get cloud sessions, and the code stays on machines your team owns.

## Common mistake

Passing a name. It needs the ID that starts with ccpool_, which an admin gets when the pool is set up.

## Three principles

- **Your own pool.** Not Anthropic's.
- **ccpool_ ID.** Not a name.
- **--ref.** Start from a branch.

## Related terms

- [Cloud Session](https://learn.benibix.com/term/ai/cloud-session)
- [claude self-hosted-runner Command](https://learn.benibix.com/term/ai/claude-self-hosted-runner-command)
- [/remote-env Command](https://learn.benibix.com/term/ai/remote-env-command)

## Taught in

- [Cloud and Server Commands](https://learn.benibix.com/learn/ai-claude-code-commands/cloud-and-server-commands): Claude Code Commands, 17/17

![Where each launch flag sends the session: the background, the app, your machines, your editor.](https://learn.benibix.com/diagrams/flag-launch.svg)

---

Source: https://learn.benibix.com/term/ai/environment-flag
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-16
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
