# Cloud agents

Give an agent that runs in a vendor's cloud the same 0bridge tools, and have its conversation land in your history. This is for Claude Code on the web; Codex cloud and Cursor cloud are opt-in and not yet verified.

## Why it needs setup

A cloud agent runs somewhere with no `0b`, no sign-in and none of your files. What it does have is the repo. So `0b project cloud` puts what it needs in the repo, and a token in the cloud environment.

## Set it up

In a repo you linked with `0b project link`:

```
0b project cloud
```

It writes, and you commit:

- `.mcp.json`: the project's 0bridge endpoint, with the token read from the environment variable `ZEROB_TOKEN`. The token isn't in the file.
- `.0bridge/hooks/push.mjs`: a small Node script, with no dependencies, that uploads the session. It does nothing unless `ZEROB_TOKEN` is set and the session is a Claude Code cloud session.
- `.claude/settings.json`: UserPromptSubmit, Notification, Stop and SessionEnd hooks that run the script. Existing settings are kept. The first two post the session's state to your [session board](/docs/sessions), so a cloud session that is waiting for you shows up there.

It then prints a project token once. The token is limited to MCP plus session upload, expires in 90 days, and opens only this project. Then:

1. Add `ZEROB_TOKEN` to the cloud environment's variables. On Pro and Max, Claude's API credentials setting can hold it for the host 0bridge.dev instead.
2. Add `0bridge.dev` to the environment's allowed domains. It isn't on the default list.
3. Commit the files.

## What you get

- The project's connections and tools in the cloud session, as on your machine.
- The session uploaded as it goes, as `claude-web:<id>` in your history, under the repo, from a device named "Claude Code on the web". You can resume it anywhere: [Resume anywhere](/docs/resume).

Flags: `--no-hooks` skips the upload hook and settings, and `--read-only` makes the token's tools read-only. `--codex` and `--cursor` also write `.codex/config.toml` and `.cursor/mcp.json`.

## What to know

- Anyone who can use the cloud environment can read its variables, so the token is narrow on purpose and expires. Revoke it from the dashboard's Devices page any time.
- History upload needs history in server mode; if you chose end-to-end, the upload is refused.
- The Codex and Cursor files use field names we haven't verified against their cloud products. Codex cloud may also remove secrets before the agent runs. Check them before relying on them.
- Whether Claude's cloud runs your `Stop` hook on every session is something to verify on your setup.
