# Install in Claude Code on the web

Set up LeoPrevent for claude.ai/code cloud sessions with a setup script, a licence key and an allowed domain.

Cloud sessions at claude.ai/code do not use your local installs and have no `/plugin` command. You set LeoPrevent up once in the environment's settings, and it applies to every new session in that environment.

## Before you start

- A licence key from **Plugin setup** in the dashboard. Cloud machines are rebuilt, so this environment connects with a key rather than browser login.

## Setup

All of these are in the environment's **⋮** menu, under **Edit environment**.

**Add it to the setup script**

Append these lines, keeping whatever is already there.

```bash
# LeoPrevent security review hook
CLAUDE_BIN="$(command -v claude || ls -d "$HOME"/.local/bin/claude "$HOME"/.claude/local/claude \
  /usr/local/bin/claude /opt/node*/bin/claude 2>/dev/null | head -1)"
CLAUDE_BIN="${CLAUDE_BIN:-claude}"
"$CLAUDE_BIN" plugin marketplace add leotrace-hq/leoprevent-plugin \
  --sparse .claude-plugin .agents/plugins || true
"$CLAUDE_BIN" plugin install leoprevent@leotrace \
  || echo "leoprevent: install failed, reviews will not run" >&2
"$CLAUDE_BIN" plugin list || true   # confirms in the setup log that it landed
```

**Set your licence key**

Add it as an environment variable with this name.

```text
LEOPREVENT_LICENSE_KEY
```

**Allow the server**

Under **Network access**, choose **Custom**, tick **Also include default list of common package managers**, and add this to **Allowed domains**:

```text
api.leotrace.io
```

**Verify in a new session**

The setup log should show `leoprevent@leotrace … enabled`.

```bash
claude plugin list
```

These settings apply to new sessions. A failed install never blocks your session; if reviews never run, look in the setup log for `leoprevent: install failed, reviews will not run`.

## Check it worked

Paste this into your agent and let it reply. The finished turn is what checks in.

```text
Hello! I just installed LeoPrevent. Say hi back so this turn finishes.
```

The installation then shows as **Live** in **Plugin setup**. See [Check it's working](https://help.leotrace.io/check-its-working/).

## Already installed this before?

Nothing to reinstall. The setup script runs again when the environment is rebuilt, and your key is an environment variable, so it comes back with it.

## Update

The setup script installs the latest version whenever the environment is rebuilt. To update sooner, edit the setup script or the allowed domains, which forces a rebuild.

## Remove

Delete the LeoPrevent lines from the setup script and remove the `LEOPREVENT_LICENSE_KEY` variable. New sessions no longer load the plugin.

Source: https://help.leotrace.io/install-claude-code-web/ (updated 2026-11-18)
