Skip to main content

Remote and Cloud Sessions

These variables matter when Claude Code runs away from your terminal. They cover cloud sessions, the remote bridge, the desktop app, the Chrome extension, Cowork, and Slack. Most are set by the host, and Claude Code reads them. Set one yourself only when you run your own host.

This page lists 139 variables. Many are set by the host program that starts Claude Code, so you can change them only if you control that process. They live in the environment of the Claude Code process.

Example​

CLAUDE_CODE_REMOTE=true claude -p "Summarize the repo"

CLAUDE_CODE_REMOTE=true marks the run as a cloud session. Claude Code then raises its Node heap limit to 8192 MB.

Variables​

The table is sorted by name. See Environment Variables for what each column and badge means.

VariableStatusWhat it doesValues and defaultNotes
CCR_AGENT_PROXY_CA_CERT_B64Undocumented GatedGives the agent proxy CA certificate as base64 PEM. Claude Code uses it instead of fetching the CA.Text. Read once at startup then removed from the env. A bad value logs a warning and the CA is fetchedCloud remote sessions
CCR_AGENT_PROXY_CA_WATCH_ENABLEDUndocumented GatedTurns on the CA file watch of the agent proxy relay.On or off. Read at agent proxy startup with CCR_AGENT_PROXY_ENABLED. Purpose of the watch is not shown beyond the flag nameCloud remote sessions
CCR_AGENT_PROXY_ENABLEDUndocumented GatedTurns on the hosted agent proxy relay that routes git and GitHub traffic of a remote session.On or off. Needs CLAUDE_CODE_REMOTE true and a session id and token. Off by defaultCloud remote sessions
CCR_AGENT_PROXY_FRAME_HOSTSUndocumented GatedLists hosts for the frame tunnel. A malformed value logs a warning and keeps the gateway routes.Text. Unset means no frame tunnel hostCloud remote sessions
CCR_AGENT_PROXY_INCLUDE_HOSTSUndocumented GatedLists the hosts that the agent proxy relays in selective mode. Other hosts use normal networking.Text. Comma separated string. An empty list in selective mode fails closed and tunnels everythingCloud remote sessions
CCR_AGENT_PROXY_NO_PROXY_LOCAL_ONLYUndocumented GatedLimits the proxy bypass list of the agent proxy relay to local hosts only.On or off. Used with standalone mode and in the no-proxy list choiceCloud remote sessions
CCR_AGENT_PROXY_RECEIVE_GATE_DISABLEDUndocumented GatedTurns off the receive gate of the agent proxy relay.On or off. Removed from the env after readingCloud remote sessions
CCR_AGENT_PROXY_RELAY_MODEUndocumented GatedSelects the relay mode of the agent proxy. agent_proxy_standalone starts a standalone relay and selective relays only listed hosts.Text. Standalone mode needs CLAUDE_CODE_ENVIRONMENT_KIND to be byoc. Removed from the env after readingCloud remote sessions
CCR_AGENT_PROXY_STANDALONE_URLUndocumented GatedGives the URL of the standalone agent proxy relay in a bring-your-own-cloud session.Text. Used when the relay mode is agent_proxy_standalone. An invalid URL stops startupCloud byoc sessions
CCR_AGENT_PROXY_TOKEN_FILE_DESCRIPTORUndocumented GatedGives the file descriptor number that holds the relay token for a tool container daemon.A number. Digits only, number 3 or more. Read once then removed from the envCloud tool containers
CCR_AGENT_PROXY_UPLOAD_GATE_DISABLEDUndocumented GatedTurns off the upload gate of the agent proxy relay.On or off. Removed from the env after readingCloud remote sessions
CCR_AUTO_MODE_ALLOWUndocumented GatedCarries auto mode allow rules from the host to a self-hosted runner. The runner removes it from the session env.Read from session environment_variables only when CCR_AUTO_MODE_APPLY is 1. Entries with line breaks or blanks are refusedSelf-hosted runner (cloud byoc)
CCR_AUTO_MODE_APPLYUndocumented GatedSwitches on the host-sent auto mode rules for a self-hosted runner. The runner removes it from the session env.Active only when the session environment_variables value is exactly 1. Set to undefined for the childSelf-hosted runner (cloud byoc)
CCR_AUTO_MODE_ENVIRONMENTUndocumented GatedCarries auto mode environment entries from the host to a self-hosted runner. The runner removes it from the session env.Read from session environment_variables only when CCR_AUTO_MODE_APPLY is 1. Set to undefined for the childSelf-hosted runner (cloud byoc)
CCR_AUTO_MODE_SOFT_DENYUndocumented GatedCarries auto mode soft_deny rules from the host to a self-hosted runner. The runner removes it from the session env.Read from session environment_variables only when CCR_AUTO_MODE_APPLY is 1. Set to undefined for the childSelf-hosted runner (cloud byoc)
CCR_DELTA_RESETUndocumented GatedTurns on a delta reset path in the CCR git fetch step and adds a delta_reset field to startup timing data.On or off. Truthy check on the env value. The fetch step then checks HEAD is a valid commit before it fetchesCloud remote and self-hosted runner sessions
CCR_ENABLE_BUNDLEUndocumented GatedLets claude --cloud seed a cloud session from an uploaded local git bundle instead of a remote clone.On or off. Not used for byoc environmentsLocal CLI, cloud session start
CCR_FORCE_BUNDLEDocumentedForces claude --cloud to bundle and upload the local repository instead of cloning from its remote.On or off. Docs name only 1. Skipped for byoc environments and agent sessionsLocal CLI, cloud session start
CCR_ON_BRANCH_DEFAULT_GUARDUndocumented GatedSets how the guard acts when an --on-branch cloud start targets the default branch. The guard has three modes.One of a fixed set of values. Enum enforce, observe, off. Unset gives enforce, or observe when a feature flag is onLocal CLI, cloud session start
CCR_PREFETCH_NETWORKUndocumented GatedCarries the network prefetch result of a CCR runner. Claude Code only reports it as prefetch_network in startup timing data.TextCloud remote and self-hosted runner sessions
CCR_PREWARM_STATUndocumented GatedCarries the prewarm stat result of a CCR runner. Claude Code only reports it as prewarm_stat in startup timing data.TextCloud remote and self-hosted runner sessions
CCR_PREWARM_VDAUndocumented GatedCarries the prewarm VDA result of a CCR runner. Claude Code only reports it as prewarm_vda in startup timing data.TextCloud remote and self-hosted runner sessions
CCR_SESSION_PROFILEUndocumented GatedMarks a CCR session profile. It turns off default inline tools and prompt cache keepalive, and enables the session ingress check.On or off. The ingress check also needs SESSION_INGRESS_URL and a session id that starts with cse_Cloud remote sessions
CCR_SHR_SSE_HINTSUndocumented GatedMakes the self-hosted runner open a server-sent events stream for work hints, so it wakes sooner.On or off. Logs CCR_SHR_SSE_HINTS enabled when onSelf-hosted runner
CCR_SHR_START_MARKSUndocumented GatedNames a start marks key that the self-hosted runner blanks in the session env. It is also tied to prewarm marker files in /tmp.Set to undefined in the child envSelf-hosted runner
CLAUDE_ARTIFACT_HOST_GRANTUndocumentedHolds the host app grant for local MCP servers. Artifact publish uses it to check the MCP manifest of a page.rawStr, parsed by a grant reader. The app that launches the session sets itArtifact publish in a host-launched session. Not set from project env before trust
CLAUDE_BRIDGE_REATTACH_NO_BACKFILLUndocumentedTells a reattached bridge session to skip the history backfill.On or off. Set to 1 by Claude Code on a reattach spawn. The new process reads it once and deletes itRemote Control bridge reattach. Not set from project env before trust
CLAUDE_BRIDGE_REATTACH_OUTBOUND_ONLYUndocumentedMakes a reattached bridge session send only outbound (mirror mode). Without it the reattach is a full bridge.On or off. Claude Code sets 1 unless the caller passes false. It feeds the bridge enable logicRemote Control bridge reattach. Not set from project env before trust
CLAUDE_BRIDGE_REATTACH_OWNER_ACCTUndocumentedPasses the owner account UUID to a reattached bridge session.Text. Set by Claude Code on a reattach spawn. The new process reads it once and deletes itRemote Control bridge reattach. Not set from project env before trust
CLAUDE_BRIDGE_REATTACH_OWNER_ORGUndocumentedPasses the owner organization UUID to a reattached bridge session.Text. Set by Claude Code on a reattach spawn. The new process reads it once and deletes itRemote Control bridge reattach. Not set from project env before trust
CLAUDE_BRIDGE_REATTACH_SEQUndocumentedPasses the last sequence number to a reattached bridge session.A number. Whole number. Claude Code sets it only when the number is above 0Remote Control bridge reattach. Not set from project env before trust
CLAUDE_BRIDGE_REATTACH_SESSIONUndocumentedGives the bridge session id that a relaunched process must reattach to.Text. Set by Claude Code on a reattach spawn. The new process reads it once and deletes itRemote Control bridge reattach. Not set from project env before trust
CLAUDE_CHROME_PAIRED_DEVICE_IDUndocumentedNames the paired browser extension device for the Chrome bridge.Text. Must match a device id pattern. Else Claude Code logs a warning and ignores itClaude in Chrome bridge. Not set from project env before trust
CLAUDE_CHROME_TAB_GROUP_KEYUndocumentedSets the browser tab group key for Claude Code browser calls.Text. Honored only with CLAUDE_CODE_REMOTE_SESSION_ID. Claude Code then unsets itClaude in Chrome in remote sessions. Not set from project env before trust
CLAUDE_CLIENT_PRESENCE_FILEDocumentedNames a marker file that tells Claude Code you are at the computer. While it exists, Claude Code skips Remote Control mobile pushes.Text. The code checks with a file stat on each presence checkRemote Control. Not set from project env before trust
CLAUDE_CODE_ATTACHMENTS_IN_USER_DATAUndocumented GatedTurns on an attachments-in-user-data step in cloud sessions. The step stops when data retention rules apply.On or off. Needs CLAUDE_CODE_REMOTE_SESSION_ID and a cloud sessionCloud sessions
CLAUDE_CODE_BRIDGE_CHILD_ARTIFACTUndocumentedMarks a Remote Control child session as allowed to use artifacts. Set by Claude Code for the child.On or off. Claude Code sets 1 in the child env. It first clears the inherited valueRemote Control child sessions
CLAUDE_CODE_BRIDGE_CHILD_AUTO_DEFAULTUndocumentedMakes auto mode the default mode of a Remote Control child session. Set by Claude Code for the child.On or off. Set to 1 in the child env. It also ignores defaultMode auto if disableAutoMode is setRemote Control child sessions
CLAUDE_CODE_BRIDGE_CHILD_MACHINE_SETTINGSUndocumentedMarks a Remote Control child session that uses machine settings. Set by Claude Code for the child.On or off. Set to 1 in the child envRemote Control child sessions
CLAUDE_CODE_BRIDGE_MCP_CARRIERUndocumentedMarks a Remote Control child that carries the bridge MCP config. Set by Claude Code.One of a fixed set of values. Enum 1 or spent. 1 means a childRemote Control sessions
CLAUDE_CODE_BRIDGE_OWNER_ACCOUNT_UUIDUndocumentedCarries the owner account UUID into a Remote Control child session. Set by Claude Code.Text. The child reads it as the bridge owner identityRemote Control child sessions
CLAUDE_CODE_BRIDGE_OWNER_ORG_UUIDUndocumentedCarries the owner organization UUID into a Remote Control child session. Set by Claude Code.Text. Used with CLAUDE_CODE_BRIDGE_OWNER_ACCOUNT_UUIDRemote Control child sessions
CLAUDE_CODE_BRIDGE_PROMPT_SHA256UndocumentedHolds the SHA-256 of the appended system prompt that the bridge passes to a carrier child. The child checks the prompt file against it.Text. Set by Claude Code. The child removes it after the first readRemote Control carrier children
CLAUDE_CODE_BRIDGE_SESSION_IDDocumentedHolds the session_ ID of the active Remote Control connection. Set by Claude Code.Text. Set while connected and deleted when the connection ends. Claude Code removes it from some child envsRemote Control, Bash and hook subprocesses
CLAUDE_CODE_BRIDGE_SOURCE_DIRUndocumentedCarries the source directory into a Remote Control child session. Set by Claude Code. Purpose of the read side is not clear from the bundle.Text. Set from the spawn option sourceDirRemote Control child sessions
CLAUDE_CODE_BRIEF_UPLOADUndocumentedPicks the env_brief_upload attachment mode for the file delivery tool.On or off. It ranks after CLAUDE_CODE_ATTACHMENTS_BY_PATH and the REPL bridge, and before the cloud and BYOC modesBrief mode attachments
CLAUDE_CODE_CCR_EARLY_HYDRATE_PREFETCHUndocumentedStarts the hydrate prefetch early for a resumed remote session.On or off. Needs an SDK URL and a resume optionCloud sessions
CLAUDE_CODE_CCR_EARLY_REMOTE_CONNECTUndocumentedStarts the remote connection early for a resumed remote session.On or off. Needs an SDK URL and a resume optionCloud sessions
CLAUDE_CODE_CCR_WORKER_SOCKETUndocumentedOpens the cloud session event stream over a worker socket.On or off. Needs a cloud session where Claude Code owns the processCloud sessions
CLAUDE_CODE_CHROME_MCP_ORG_DENIEDUndocumentedWhen set, the Chrome MCP check reports a denial by the parent organization policy.On or off. Claude Code deletes it when it builds some child envsChrome integration
CLAUDE_CODE_CLOUD_SESSION_IDUndocumentedHolds the cloud session ID for shell commands that Claude Code runs. Set by Claude Code.Text. Added to the extra env of spawned shell commandsCloud sessions
CLAUDE_CODE_CONTAINER_IDUndocumentedReports the container id in session metadata as claudeCodeContainerId. Its presence also marks a remote or container session.Text. No default. Set by the container hostRemote and container sessions
CLAUDE_CODE_DESKTOP_APP_VERSIONUndocumentedGives the desktop app version to Claude Code. Claude Code reads it only for the desktop entrypoints.Text. Used when CLAUDE_CODE_ENTRYPOINT is claude-desktop or local-agent. Else ignoredDesktop app
CLAUDE_CODE_DISABLE_TURN_HANDOFFUndocumentedMarks turn handoff as disabled in the admission check for SDK and remote sessions.On or off, off by defaultSDK and remote sessions
CLAUDE_CODE_DISABLE_WORKING_SYNCUndocumentedStops the synced working-file syncer in remote sessions and blocks the self-hosted admitted state.On or off, off by defaultRemote sessions with CLAUDE_CODE_REMOTE_SESSION_ID and an SDK URL
CLAUDE_CODE_ENABLE_CFCDocumentedStarts the session with Chrome integration on or off, ahead of claudeInChromeDefaultEnabled.On, off, or unset. --chrome and --no-chrome win. Remote and Cowork sessions also need this var or the flagAll sessions. Not set from project env before trust
CLAUDE_CODE_ENABLE_REMOTE_RECAPUndocumented GatedForces the remote session recap on or off.On, off, or unset, off by default. Unset uses a feature flag, default offRemote sessions that report metadata
CLAUDE_CODE_ENVIRONMENT_KINDUndocumentedNames the remote runner kind. bridge and byoc change session and bridge behavior.TextRemote and bridge sessions
CLAUDE_CODE_ENVIRONMENT_RUNNER_VERSIONUndocumentedSends the runner version in the x-environment-runner-version header on worker requests.Text. Skipped when emptyRemote runner sessions
CLAUDE_CODE_FORCE_RC_LONG_TURN_NUDGEUndocumentedForces the remote control nudge after a long turn. Uses a 5 s threshold, probability 1, and no impression limit.On or off. Second env accessor, truthy check. Else a feature flagInteractive
CLAUDE_CODE_HARBOR_KITE_CLOUDUndocumented GatedAllows cloud peer access for cross-session messaging.On or off, off by default. Else a feature flag. Needs first-party auth and allow_remote_sessionsFirst-party sessions with an org
CLAUDE_CODE_HOLD_REPORT_PARK_AT_INITUndocumentedSets reportParkAtInit for the remote session worker. It takes effect only when CLAUDE_CODE_RESUME_INTERRUPTED_TURN is also on.On or off. Both values must be trueRemote session worker
CLAUDE_CODE_IS_COWORKUndocumentedMarks the session as Cowork. It allows synced skills and treats the session like a remote one for state and cache checks.On or off. Checked next to CLAUDE_CODE_REMOTE and the remote_cowork entrypointCowork
CLAUDE_CODE_LEGACY_BUNDLEUndocumentedMakes a cloud session upload the working tree the previous way, as a git bundle.On or off. Ignored when a settings file sets it or when settings move HOME or CLAUDE_CONFIG_DIRCloud sessions (git bundle upload)
CLAUDE_CODE_PARKED_PERMISSION_WAIT_MSUndocumentedFeeds the answerWaitMs value of the parked-permission resume options. No visible effect in a print-mode probe (Probes).A number of milliseconds, 2000 by default. Whole number of 0 or more. Read next to CLAUDE_CODE_RESUME_INTERRUPTED_TURNAll sessions
CLAUDE_CODE_PARKED_RUN_BEFORE_CLEARUndocumentedFeeds the runsBeforeClear field of the parked-permission resume options. No visible effect in a print-mode probe (Probes).On or offAll sessions
CLAUDE_CODE_PARKED_STOP_RETIRESUndocumentedFeeds the parkedStopRetires field of the parked-permission resume options. No visible effect in a print-mode probe (Probes).On or offAll sessions
CLAUDE_CODE_REMOTEDocumentedMarks a cloud session. When it is true Claude Code raises the Node heap limit to 8192 MB.On or off. Set automatically in cloud sessions. Many code paths test itCloud sessions
CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPEUndocumentedNames the kind of remote environment. The value self_hosted with CLAUDE_CODE_ENVIRONMENT_KIND=byoc marks a self-hosted runner.Text. Also copied into telemetry as remoteEnvironmentTypeCloud and runner sessions
CLAUDE_CODE_REMOTE_HERMETIC_MODEUndocumentedReports a hermetic mode flag. It is true only when CLAUDE_CODE_REMOTE is also set. No visible effect in a print-mode probe (Probes).On or offCloud sessions
CLAUDE_CODE_REMOTE_MCP_CONFIGDocumented GatedNames a file with the MCP servers that a runner delivered. Claude Code loads it as a dynamic scope config.Text. Read only when CLAUDE_CODE_REMOTE is true and CLAUDE_CODE_ENVIRONMENT_KIND is byocSelf-hosted runner sessions
CLAUDE_CODE_REMOTE_SDK_URLUndocumentedGives the SDK URL of a remote session. Claude Code uses it when no other URL is set and the URL is valid.Text. Claude Code also sets it from a stored URL in bridge or byoc modeBridge and byoc sessions
CLAUDE_CODE_REMOTE_SEND_KEEPALIVESUndocumented GatedSends session keepalive callbacks during heartbeat and long hook runs. Hook keepalive also needs a feature flag.On or offCloud sessions
CLAUDE_CODE_REMOTE_SESSION_IDDocumentedHolds the ID of the current cloud session.Text. Set by Claude Code in cloud sessions and by a self-hosted runner. Telemetry and the session ID parser read itCloud sessions
CLAUDE_CODE_REMOTE_SESSION_ORIGINUndocumentedThe value review marks a review-origin session. Such sessions skip some token disk writes.Text. Compared to reviewCloud sessions
CLAUDE_CODE_REMOTE_SESSION_UUIDDocumentedHolds the UUID form of the remote session ID. A self-hosted runner puts it in the env of the session it starts.Set by a runner, from the session IDSelf-hosted runner sessions
CLAUDE_CODE_REMOTE_SETTINGS_PATHUndocumentedNames a file that replaces the remote settings fetch. The log says skipping API fetch.Text. Read directlyAll sessions
CLAUDE_CODE_REMOTE_TOOLS_FORWARDUndocumentedTurns on the remote tools forward mode that gates the served tools code. Details are not clear from the bundle.On or off. True only for true. Telemetry also notes whether it is presentSessions that serve tools to cloud sessions
CLAUDE_CODE_REMOTE_TOOLS_HOST_ALLOWS_UNATTENDEDUndocumentedA host passes a grant for unattended runs. Claude Code stores it with setHostUnattendedGrant and then removes the var.Text. Read once at startup and removed from the envHost apps
CLAUDE_CODE_REMOTE_TOOLS_JUMP_QUEUEUndocumented GatedOverrides a feature flag. No visible effect in a print-mode probe (Probes).Off by default. Read from the env objectSessions that serve tools to cloud sessions
CLAUDE_CODE_REMOTE_TOOLS_PIN_STORED_LOGINUndocumentedPins remote tool serving to the stored claude.ai login. It stops with an error if the endpoint is not Anthropic's own service.On or off. True only for true. A token from the env does not satisfy itSessions that serve tools to cloud sessions
CLAUDE_CODE_REMOTE_TOOLS_POLICYUndocumentedPicks the remote tools policy mode. Details are not clear from the bundle.Unset or parity gives parity. Any other value gives interimSessions that serve tools to cloud sessions
CLAUDE_CODE_REMOTE_TOOLS_SERVEUndocumentedTurns off serving local tools to cloud sessions when false. A bundle message says it turns the feature off.Unset gives on. A true value gives onInteractive sessions with a cloud link
CLAUDE_CODE_REMOTE_TOOLS_SESSION_CHANNELUndocumentedA false value turns off the session channel of the remote tools module. Details are not clear from the bundle.On or off. Compared to the boolean false onlySessions that serve tools to cloud sessions
CLAUDE_CODE_REPO_CHECKOUTSUndocumentedMaps repo names to local checkout paths for multi-repo sessions. File attribution uses the paths.Text. A bad value logs Failed to parse env map. Pairs with CLAUDE_CODE_BASE_REFSSessions with several repos
CLAUDE_CODE_SESSION_ORIGINUndocumentedMarks a session that started from a claude.ai chat. Only the value claude_ai_chat is valid.One of a fixed set of values. Enum with one value claude_ai_chat. Used in an origin check, in account context, and in the permission classifier inputClaude.ai chat sessions
CLAUDE_CODE_SYSTEM_PROMPT_GB_FEATUREUndocumented GatedNames a GrowthBook feature whose string value replaces the system prompt on each turn. An empty value keeps the normal prompt.Text. Read only when CLAUDE_CODE_REMOTE is set. The feature name goes to a flag lookupRemote sessions
CLAUDE_CODE_TEE_SDK_STDOUTUndocumentedSets the teeStdout option of the remote I/O transport. The effect of that option is not shown here.On or off. Claude Code sets it to 1 for self-hosted runner childrenRemote I/O and self-hosted runner
CLAUDE_CODE_USE_CCR_V2UndocumentedMarks a child as a CCR v2 session.On or off. Set by Claude Code to 1 in the environment of self-hosted runner childrenSelf-hosted runner
CLAUDE_CODE_WARN_DISK_FREE_GIBUndocumentedSets a low free disk level in GiB. The program reads it as diskLowGib and forwards it to the remote env.A number, 0 by defaultLikely remote or cloud sessions. Not set from project env before trust
CLAUDE_CODE_WARN_MEMORY_FREE_GIBUndocumentedSets a low free memory level in GiB. The program reads it as memoryLowGib and forwards it to the remote env.A number, 0 by defaultLikely remote or cloud sessions. Not set from project env before trust
CLAUDE_CODE_WEBFETCH_USE_CCR_PROXYUndocumentedSends WebFetch through the CCR proxy when a CCR session is available.On or off. Works only with the first-party providerCloud sessions, first-party
CLAUDE_CODE_WEBSEARCH_USE_CCR_PROXYUndocumentedSends WebSearch through the CCR proxy when a CCR session is available.On or off. Works only with the first-party providerCloud sessions, first-party
CLAUDE_CODE_WORKER_EPOCHUndocumentedCounts worker restarts. A value above 1 marks a restored worker, so tools are not announced again.A number, 1 by default. Integer, default 1. Also passed in the init data when the remote check is trueRemote workers
CLAUDE_REMOTE_CONTROL_SESSION_NAME_PREFIXDocumentedSets the prefix of auto-generated Remote Control session names.--
CLAUDE_REMOTE_TOOLS_BRIDGE_URLUndocumentedOverrides the URL of the device bridge for remote tools.A URL-
CLAUDE_REMOTE_WORKFLOW_ARGSUndocumented GatedPasses JSON arguments to the workflow script of a remote session.--
CLAUDE_REMOTE_WORKFLOW_SCRIPTUndocumented GatedHolds the workflow script that a remote session runs through a fixed command.--
CLAUDE_RUNNER_ACTIVITY_FDUndocumentedNames an extra file descriptor that the remote IO layer writes to.--
CLAUDE_RUNNER_API_BASE_URLDocumentedGives runner hooks the API base URL. The code-sign helper uses it as a last fallback.A URL-
CLAUDE_RUNNER_CLIENT_PLATFORMDocumentedTells hooks and the child session which client platform started the runner session.--
CLAUDE_RUNNER_DISABLE_AWAITING_ACTION_OVERRIDEUndocumentedStops the runner from reporting awaiting-action when the child waits at a prompt after a turn ends.--
CLAUDE_RUNNER_FETCH_DEPTHDocumentedSets the --depth of the runner git fetch.--
CLAUDE_RUNNER_FETCH_SERVER_PROGRESS_CAP_MSDocumentedSets a cap in ms for the server-progress wait of the runner git fetch.A number of milliseconds-
CLAUDE_RUNNER_SESSION_IDDocumentedGives lifecycle hooks the session ID. The code-sign helper reads it when CLAUDE_CODE_REMOTE_SESSION_ID is unset.Text-
CLAUDE_RUNNER_SKIP_GIT_VERIFYDocumentedSkips the check for a .git directory after the checkout hook ends. For non-git source control.--
CLAUDE_RUNNER_TRUST_CANONICAL_PREWARMUndocumentedTells the runner to trust the prewarmed canonical checkout and skip its validation.--
CLAUDE_RUNNER_USE_GIT_PROXYDocumentedTurns on the Anthropic git proxy for the self-hosted runner.--
CLAUDE_SSH_RUN_DIRUndocumentedA presence check in system prompt assembly. With CLAUDE_SSH_DAEMON_CHILD it can skip an optional prompt section. A Probes run saw no effect.A path-
CLAUDE_STAGE_FILE_ROOTUndocumentedSets the root directory for staged upload files in remote sessions.--
LOCAL_BRIDGEUndocumentedPoints the bridge URL to ws://localhost:8765, like USE_LOCAL_OAUTH.--
SELF_HOSTED_RUNNER_BASE_DIRDocumented GatedSets the base directory for repository checkouts and per-session state.Text. Flag --base-dir. Default is a POSIX container pathSelf-hosted runner
SELF_HOSTED_RUNNER_CLIENT_LABELDocumented GatedSets the label sent at registration and shown beside the runner in the console.Text, the by default. Trimmed string, default the hostname. Flag --client-labelSelf-hosted runner
SELF_HOSTED_RUNNER_CONFIGURE_GITDocumented GatedWrites a global git identity (Claude <noreply@anthropic.com>) and commit signing at runner start.On or off. Flag --configure-gitSelf-hosted runner
SELF_HOSTED_RUNNER_CONFINE_REPO_SETTINGSDocumented GatedSets the guard mode for settings committed in the repo.Text. An invalid value fails at startup. Flag --confine-repo-settingsSelf-hosted runner
SELF_HOSTED_RUNNER_DEBUG_DIRUndocumented GatedWrites each work-order JWT, decoded JSON and hook stderr to files in this directory.Text. Dev only, files are pruned after 5 min. Flag --debug-dirSelf-hosted runner orchestrator
SELF_HOSTED_RUNNER_DEBUG_TOKEN_DIRDocumented GatedWrites live tokens to disk for debugging.Text. Debug only, not for production. Flag --debug-token-dirSelf-hosted runner
SELF_HOSTED_RUNNER_DEFER_SHUTDOWN_MAX_MSDocumented GatedOn the first SIGTERM, stops new work and waits up to this long before draining.A number of milliseconds, 0 by default. The flag --defer-shutdown-max-min sets itSelf-hosted runner
SELF_HOSTED_RUNNER_DRAIN_GRACE_MSDocumented GatedKeeps the runner warm and polling this long after sessions end.A number of milliseconds, 0 by default. Max 604800 s. The flag --drain-grace-sec sets itSelf-hosted runner
SELF_HOSTED_RUNNER_DRAIN_MARKER_FILEDocumented GatedNames a file whose presence at drain time reports the exit as a host drain.Text, unset by default. Telemetry only. The first line may hold a Unix timeSelf-hosted runner
SELF_HOSTED_RUNNER_DRAIN_WAIT_MSDocumented GatedOn SIGTERM, waits up to this long for running turns and background tasks before stopping the session.A number of milliseconds, 0 by default. Max 86400 s. The flag --drain-wait-sec sets itSelf-hosted runner
SELF_HOSTED_RUNNER_ENVIRONMENT_SECRETDocumented GatedGives the environment secret that the runner uses to authenticate.Text. Trimmed string. The flag --environment-secret-file winsSelf-hosted runner
SELF_HOSTED_RUNNER_EXEC_PATHDocumented GatedSets the binary that the runner spawns for child sessions.Text. Default is the runner's own binary. Flag --exec-pathSelf-hosted runner
SELF_HOSTED_RUNNER_HEALTH_PORTDocumented GatedSets the port of the /healthz HTTP listener.A number, 8080 by default. Integer from 0 to 65535, default 8080. 0 disables itSelf-hosted runner
SELF_HOSTED_RUNNER_HOOKS_DIRDocumented GatedNames the directory of lifecycle hook scripts (checkout, command, post-session).Text. Missing hooks use built-in behavior. Flag --hooks-dirSelf-hosted runner
SELF_HOSTED_RUNNER_HOST_CONFIG_DIRDocumented GatedNames the host config directory that seeds each session's config dir.Text. Falls back to CLAUDE_CONFIG_DIR, then ~/.claude. An empty dir turns it offSelf-hosted runner
SELF_HOSTED_RUNNER_HOST_CONFIG_SNAPSHOTDocumented GatedChooses where the startup snapshot of the host config is kept.Text. Another value throwsSelf-hosted runner
SELF_HOSTED_RUNNER_IDLE_SHUTDOWN_MSDocumented GatedExits the runner if it gets no work for this long.A number of milliseconds, never by default. Max 10080 min. The flag --exit-if-unused-min sets itSelf-hosted runner
SELF_HOSTED_RUNNER_LOCK_TO_ACCOUNTDocumented GatedLocks the runner to one account id at registration.Text. Flag --lock-to-account. Only that account's sessions are assignedSelf-hosted runner
SELF_HOSTED_RUNNER_LOG_FILEDocumented GatedCopies runner logs to a file in append mode.Text. Flag --log-file. Stdout is unchangedSelf-hosted runner
SELF_HOSTED_RUNNER_MAX_LIFETIME_MSDocumented GatedCaps the wall-clock life of each session child.A number of milliseconds, never by default. Max 10080 min. The flag --kill-session-after-min sets itSelf-hosted runner
⛔ SELF_HOSTED_RUNNER_POOL_SECRETDocumented GatedDeprecated alias of SELF_HOSTED_RUNNER_ENVIRONMENT_SECRET.Text. Used only if the new name is unset. Prints a deprecation warningSelf-hosted runner
SELF_HOSTED_RUNNER_POST_SESSION_HOOK_TIMEOUT_MSDocumented GatedSets the SIGTERM budget of the post-session hook.A number of milliseconds. Positive number in ms. Flag --post-session-hook-timeout-sec sets itSelf-hosted runner
SELF_HOSTED_RUNNER_PUSH_OUTCOME_ON_RELEASEDocumented GatedPushes outcome branches to origin when the runner ends a session itself.On or off. Flag --push-outcome-on-release. Adds 30 s to the shutdown budgetSelf-hosted runner
SELF_HOSTED_RUNNER_REMOVE_SESSION_STATEDocumented GatedDeletes per-session state under the base dir when a session ends.On or off, off by default. Another value throws. Flag --remove-session-stateSelf-hosted runner
SELF_HOSTED_RUNNER_RETIRE_ATDocumented GatedRetires the runner at a Unix time, in seconds.A number, never by default. Integer in seconds, valid from 1e9 to 1e11. Else ignored (0)Self-hosted runner
SELF_HOSTED_RUNNER_SERVER_AUTO_MODE_LISTSDocumented GatedChooses which server auto-mode classifier lists a session may receive.Text. Another value stops the runner. Flag --server-auto-mode-listsSelf-hosted runner
SESSION_INGRESS_URLUndocumented GatedSets the base URL of the session ingress for remote (CCR) sessions. It wins over ANTHROPIC_BASE_URL.Text. Non-empty string. Reads as SESSION_INGRESS_URL first, else ANTHROPIC_BASE_URLRemote sessions
VITALS_EMITTER_BINUndocumented GatedSets the path of the guest vitals emitter binary for remote sessions.Must be an absolute path. Else the log says vitals are disabledRemote sessions

How It Works​

A host program starts Claude Code as a child process and passes variables to it. The child reads them to learn where it runs and how to reach the host. Check the Notes column: some variables are set by Claude Code itself and are not meant to be set by you.

Source: the program (variable names found in the 2.1.304 binary) and the Environment Variables page of the official docs.