Skip to content
BENIBIX Learn

CLAUDE_CODE_REMOTE

AI⌨️ Claude CodeConfiguration

Also known as CLAUDE_CODE_REMOTE=true

Set to true when Claude Code runs as a cloud session.

Think of it like

It is like a sign that tells you that you are on a boat, not at home.

Example

Lucy's SessionStart hook installs packages. On her laptop that is slow and not needed, so the hook only does it in the cloud.

Why it matters

A cloud machine starts empty, and a laptop does not. One hook can serve both.

Definition

CLAUDE_CODE_REMOTE is set to true when Claude Code runs as a cloud session, not on your own computer. A hook or setup script reads it to know where it runs. It can then skip steps that only make sense on a laptop, or add ones a fresh cloud machine needs.

Example code

bash
if [ "$CLAUDE_CODE_REMOTE" = "true" ]; then
  npm ci
fi
Install packages only on a fresh cloud machine.

Common mistake

Checking CLAUDECODE instead. That is set on your laptop too.

Key takeaways

  1. 1
    true in the cloud. Set for you.
  2. 2
    For hooks. And setup scripts.
  3. 3
    Not CLAUDECODE. That is everywhere.

Compare