> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xpander.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Cloud Claude Code

> Run Claude Code from a laptop terminal on a cloud session your organization governs, and keep laptops off models when Claude Code should run in the cloud only.

With xpander-connect on a laptop, `xpander-connect claude` opens Claude Code in the terminal on the person's own cloud agent. Each turn runs in an isolated cloud session with the organization's skills, approvals, AI gateway and record, the same as every agent turn. The terminal streams the answer as it arrives.

An admin can also make the cloud the only place Claude Code runs. AI clients on laptops then call no model through the [AI gateway](https://docs.xpander.ai/run/integrations/ai-gateway.md), and typing `claude` opens the cloud session instead.

## Turn it on or off

Open **Platform > AI governance > AI tool clients** and select **Everyone**, or a group override.

| Setting | Default | What it does |
| - | - | - |
| **Cloud Claude Code** | On | People open cloud sessions with `xpander-connect claude`. Off for every client, or for a group, refuses the session with the reason. |
| **Run Claude Code** | On laptops | **On laptops**: Claude Code and the other AI clients on laptops call models through the AI gateway. **In the cloud only**: laptops call no model, and the gateway answers a laptop call with the command to run instead. |

![Group override panel showing the Cloud Claude Code switch and Run Claude Code with On laptops and In the cloud only](https://mintcdn.com/xpanderai-099931d1/G1LXBCidjD2Wd_jo/images/run/integrations/cloud-claude-code/cloud-claude-code-rules.png?fit=max\&auto=format\&n=G1LXBCidjD2Wd_jo\&q=85\&s=f5aa7e2fe0521b991d352a5006b31cbe)

Cloud Claude Code and Run Claude Code on a group override. Shown with sample data.

A group override can only be stricter than **Everyone**: it can turn **Cloud Claude Code** off and choose **In the cloud only**, never the reverse. **In the cloud only** needs **Cloud Claude Code** on; a group with both strict settings has no Claude Code at all, and its row says so.

**In the cloud only** is enforced on the AI gateway for every laptop sign-in and personal gateway token, whatever the client calls itself. Agent runs, including cloud sessions, are not affected.

## Access policies

Two actions in the **Gateway** category decide per person or group, beside the settings above:

| Action | Allows |
| - | - |
| `claude-code:RunLocal` | AI clients on the person's laptop call models through the AI gateway |
| `claude-code:StartCloudSession` | The person opens cloud sessions with `xpander-connect claude` |

Every member holds both through the built-in **Member** policy. A **Deny** for a group takes either away once enforcement of the **Claude Code** area is on for your organization; [xpander support](https://xpander.ai/contact-us) turns it on. An approval cannot hold a model call or a session start, so **Ask for approval** on these actions refuses them.

## Use it from a terminal

```bash theme={"dark"}
xpander-connect claude                          # type a message; Enter sends it
xpander-connect claude -p "fix the failing test"  # one turn, print the answer, exit
xpander-connect claude -c                       # continue this folder's last cloud session
xpander-connect claude --upload                 # send this folder first
xpander-connect claude pull                     # bring the folder back as the sessions left it
```

* Typing while a turn runs steers it: the message reaches Claude at its next step.
* Ctrl-C stops the turn. Ctrl-C again within three seconds, Ctrl-D or `/exit` leaves.
* A dropped connection resumes where it left off. The turn keeps running in the cloud meanwhile.
* Each session has a link to the same conversation in Xpander Chat, with its full record.

When **In the cloud only** is on, xpander-connect adds `claude` to the person's zsh, bash and fish startup files, so typing `claude` opens the cloud session. It is removed when the setting is turned off. On Windows, run `xpander-connect claude`.

## Folders

`xpander-connect claude --upload` (or `xpander-connect claude upload [folder]`) sends a folder to the person's cloud agent. Every session sees it as `./shared/<folder>`, so it is sent once and used in later sessions too.

* In a git repository, it sends the files git does not ignore, plus the repository history. Elsewhere it sends every file. Links are left out.
* At most 2 GB on disk and 512 MB compressed. Larger projects belong in git: push, and ask Claude to clone the repository in the session.
* `xpander-connect claude pull` writes the folder as the sessions left it into `./<folder>-cloud`. Every file is checked against the cloud's checksum before the folder is put in place, and an existing folder is never overwritten (`--replace` keeps the current one beside the new copy). `pull --session` takes a session's own folder instead.

Every session opened, folder sent and folder taken is in the audit log.

## Self-hosted installs

* **Air-Gapped**: the same settings and commands. The install serves xpander-connect's routes on the AI gateway host.
* **Hybrid**: sessions run on your install's own agents. Folders move with git there: clone your repository in the session, or push a branch and ask Claude to pull it. `--upload` and `pull` answer with that step.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.