Skip to content
BENIBIX Learn

CLAUDECODE vs CLAUDE_CODE_REMOTE

People think CLAUDECODE tells a script it is in the cloud. It only says the script was started by Claude Code, and that is true on your laptop too. CLAUDE_CODE_REMOTE is the one set to true only in a cloud session. A hook that should act only on a fresh cloud machine checks the second.

AI⌨️ Claude Code

CLAUDECODE

Set to 1 in each program Claude Code starts, so a script knows.

CLAUDECODE is set to 1 in the programs Claude Code starts. That means Bash commands, hooks, the status line and local MCP servers. IDE plugins also set it in their own terminals. A script reads it to know it is running inside Claude Code, and can act on that.

Example
Jack's test script opens a browser, which stalls Claude. The script now skips the browser when this is set.
Why it matters
Some scripts should act a bit differently for an AI than for a person, such as no prompts.
Full entry
AI⌨️ Claude Code

CLAUDE_CODE_REMOTE

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

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
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.
Full entry

In one line

CLAUDECODE
Set to 1 in each program Claude Code starts, so a script knows.
CLAUDE_CODE_REMOTE
Set to true when Claude Code runs as a cloud session.