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. The host sets most of them, and Claude Code reads them. Set one yourself only when you run your own host.

This page lists 186 variables. The host program that starts Claude Code sets many of them. 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_B64
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Gives the agent proxy CA certificate as base64 PEM. Claude Code uses it instead of fetching the CA.Text. Claude Code reads it once at startup and then removes it from the env. A bad value logs a warning, and Claude Code fetches the CACloud remote sessions
CCR_AGENT_PROXY_CA_WATCH_ENABLED
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Turns 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_ENABLED
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Turns 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_HOSTS
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Lists 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_HOSTS
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Lists 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_JAVA_STORE_DIRECT_DISABLED
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Stops the agent proxy from adding its CA straight to the Java trust store. It runs the Java CA hook instead. Added in 2.1.311.On or off, off by default. The direct install check then reports disabledCloud remote sessions, agent proxy tool trust
CCR_AGENT_PROXY_NO_PROXY_LOCAL_ONLY
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Limits 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_NSS_RECORDS_DISABLED
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Stops the agent proxy from keeping a record of its NSS database check. It then checks the database again on each start. Added in 2.1.311.On or off, off by default. An nssRecords option from the caller wins over itCloud remote sessions, agent proxy browser trust
CCR_AGENT_PROXY_RECEIVE_GATE_DISABLED
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Turns off the receive gate of the agent proxy relay.On or off. Claude Code removes it from the env after readingCloud remote sessions
CCR_AGENT_PROXY_RELAY_MODE
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Selects 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. Claude Code removes it from the env after readingCloud remote sessions
CCR_AGENT_PROXY_STANDALONE_URL
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Caution: It deletes data, skips a safety check, or sends data off your machine. In 2.1.312 the program only clears this variable from the environment of child processes. It no longer reads it. The program reads SELF_HOSTED_RUNNER_AGENT_PROXY_URL, or the --agent-proxy-url flag, instead.
Gave the URL of the standalone agent proxy relay in a bring-your-own-cloud session.Text. Used in 2.1.306 when the relay mode is agent_proxy_standalone. An invalid URL stopped startupCloud byoc sessions
CCR_AGENT_PROXY_TOKEN_FILE_DESCRIPTOR
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Gives the file descriptor number that holds the relay token for a tool container daemon.A number. Digits only, number 3 or more. Claude Code reads it once and then removes it from the envCloud tool containers
CCR_AGENT_PROXY_UPLOAD_GATE_DISABLED
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Turns off the upload gate of the agent proxy relay.On or off. Claude Code removes it from the env after readingCloud remote sessions
CCR_AUTO_MODE_ALLOW
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Carries 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_APPLY
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Switches 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_ENVIRONMENT
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Carries 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_DENY
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Carries 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_BYOC_RESOURCE_WATCHDOG_TELEMETRY
Undocumented: Only the program shows this item. It can change without notice.
Lets the disk and memory watchdog send its telemetry events in a byoc session. It also lets the watchdog run when CLAUDE_CODE_DIAGNOSTICS_FILE is not set. Added in 2.1.311.On or off, off by default. A byoc session (CLAUDE_CODE_ENVIRONMENT_KIND) sends the events only with it. The watchdog does not run when CLAUDECODE is setCloud byoc sessions
CCR_DELTA_RESET
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Turns 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_BUNDLE
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Lets 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_BUNDLE
Documented: An official docs page names this item.
Forces 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_GUARD
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Sets 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_NETWORK
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Carries 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_STAT
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Carries 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_VDA
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Carries 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_ACCOUNT_EMAIL
Undocumented: Only the program shows this item. It can change without notice.
Gives a git hook the email of the session account. The commit message hook that --configure-git installs adds a Co-authored-by: <name> <email> line to the commit message. The name is the part before the @.Text. A value with <, >, a line break, or a character outside printable ASCII is dropped, and no line is addedSelf-hosted runner. The runner sets it for the session
CCR_SESSION_PROFILE
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Marks 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_HINTS
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Makes 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_MARKS
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Names 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_GRANT
Undocumented: Only the program shows this item. It can change without notice.
Holds 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 starts the session sets itArtifact publish in a host-launched session. Not set from project env before trust
CLAUDE_BRIDGE_REATTACH_NO_BACKFILL
Undocumented: Only the program shows this item. It can change without notice.
Tells a reattached bridge session to skip the history backfill.On or off. Claude Code sets it to 1 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_ONLY
Undocumented: Only the program shows this item. It can change without notice.
Makes 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_ACCT
Undocumented: Only the program shows this item. It can change without notice.
Passes the owner account UUID to a reattached bridge session.Text. Claude Code sets it 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_ORG
Undocumented: Only the program shows this item. It can change without notice.
Passes the owner organization UUID to a reattached bridge session.Text. Claude Code sets it 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_SEQ
Undocumented: Only the program shows this item. It can change without notice.
Passes 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_SESSION
Undocumented: Only the program shows this item. It can change without notice.
Gives the bridge session id that a relaunched process must reattach to.Text. Claude Code sets it 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_ID
Undocumented: Only the program shows this item. It can change without notice.
Names 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_KEY
Undocumented: Only the program shows this item. It can change without notice.
Sets 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_FILE
Documented: An official docs page names this item.
Names 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_DATA
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Turns 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_ARTIFACT
Undocumented: Only the program shows this item. It can change without notice.
Marks a Remote Control child session as allowed to use artifacts. Claude Code sets it 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_DEFAULT
Undocumented: Only the program shows this item. It can change without notice.
Makes auto mode the default mode of a Remote Control child session. Claude Code sets it for the child.On or off. Claude Code sets it to 1 in the child env. It also ignores defaultMode auto if disableAutoMode is setRemote Control child sessions
CLAUDE_CODE_BRIDGE_CHILD_MACHINE_SETTINGS
Undocumented: Only the program shows this item. It can change without notice.
Marks a Remote Control child session that uses machine settings. Claude Code sets it for the child.On or off. Claude Code sets it to 1 in the child envRemote Control child sessions
CLAUDE_CODE_BRIDGE_MCP_CARRIER
Undocumented: Only the program shows this item. It can change without notice.
Marks a Remote Control child that carries the bridge MCP config. Claude Code sets it.One of a fixed set of values. Enum 1 or spent. 1 means a childRemote Control sessions
CLAUDE_CODE_BRIDGE_OWNER_ACCOUNT_UUID
Undocumented: Only the program shows this item. It can change without notice.
Carries the owner account UUID into a Remote Control child session. Claude Code sets it.Text. The child reads it as the bridge owner identityRemote Control child sessions
CLAUDE_CODE_BRIDGE_OWNER_ORG_UUID
Undocumented: Only the program shows this item. It can change without notice.
Carries the owner organization UUID into a Remote Control child session. Claude Code sets it.Text. Used with CLAUDE_CODE_BRIDGE_OWNER_ACCOUNT_UUIDRemote Control child sessions
CLAUDE_CODE_BRIDGE_PROMPT_SHA256
Undocumented: Only the program shows this item. It can change without notice.
Holds 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. Claude Code sets it. The child removes it after the first readRemote Control carrier children
CLAUDE_CODE_BRIDGE_SESSION_ID
Documented: An official docs page names this item.
Holds the session_ ID of the active Remote Control connection. Claude Code sets it.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_DIR
Undocumented: Only the program shows this item. It can change without notice.
Carries the source directory into a Remote Control child session. Claude Code sets it from the spawn option sourceDir. The program has no code that reads it back. The program only passes it to the child and names it in two env lists.Text. Set from the spawn option sourceDirRemote Control child sessions
CLAUDE_CODE_BRIEF_UPLOAD
Undocumented: Only the program shows this item. It can change without notice.
Picks 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_PREFETCH
Undocumented: Only the program shows this item. It can change without notice.
Starts 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_CONNECT
Undocumented: Only the program shows this item. It can change without notice.
Starts the remote connection early for a resumed remote session.On or off. Needs an SDK URL and a resume optionCloud sessions
CLAUDE_CODE_CCR_OWN_CONNECTION_POOL
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. A feature flag can also turn it on
Gives the event reader of the cloud session worker its own connection pool.On or off, off by default. Since 2.1.309Cloud sessions
CLAUDE_CODE_CCR_WORKER_SOCKET
Undocumented: Only the program shows this item. It can change without notice.
Opens 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_LATE_MCP_SERVER
Undocumented: Only the program shows this item. It can change without notice.
Loads another module for the Claude in Chrome MCP server and socket client. In an Anthropic-hosted cloud session it also skips the install of the Chrome native host. Added in 2.1.311.On or off, off by default. The skip applies when CLAUDE_CODE_REMOTE is true and CLAUDE_CODE_ENVIRONMENT_KIND is unsetClaude in Chrome
CLAUDE_CODE_CHROME_MCP_ORG_DENIED
Undocumented: Only the program shows this item. It can change without notice.
When 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_ID
Undocumented: Only the program shows this item. It can change without notice.
Holds the cloud session ID for shell commands that Claude Code runs. Claude Code sets it.Text. Claude Code adds it to the extra env of spawned shell commandsCloud sessions
CLAUDE_CODE_CONTAINER_ID
Undocumented: Only the program shows this item. It can change without notice.
Reports 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_VERSION
Undocumented: Only the program shows this item. It can change without notice.
Gives 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_DIFF_COPY_ROOT
Undocumented: Only the program shows this item. It can change without notice.
Names the folder where the runner keeps the checked copy of the repository git settings, which the workspace diff uses. Claude Code creates the folder.An absolute path. A value that is not absolute gives an error that says the variable must reach Claude Code unchanged from the runnerSet by the runner
CLAUDE_CODE_DISABLE_TURN_HANDOFF
Undocumented: Only the program shows this item. It can change without notice.
Marks 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_ULTRAREVIEW_TRUST_CHECK
Undocumented: Only the program shows this item. It can change without notice.
Lets claude ultrareview start in a folder you have not trusted when it cannot ask, such as in a script or CI job.On or off, off by default. Since 2.1.309. --trust-workspace trusts the folder for one run insteadclaude ultrareview. See Subcommands
CLAUDE_CODE_DISABLE_WORKING_SYNC
Undocumented: Only the program shows this item. It can change without notice.
Stops 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_DISABLE_WORKING_SYNC_WATCH
Undocumented: Only the program shows this item. It can change without notice.
Stops the working-file syncer from using the file system watch (fs.watch) on Linux. Added in 2.1.311.On or off, off by default. Read only on LinuxRemote sessions with the working-file syncer
CLAUDE_CODE_ENABLE_CFC
Documented: An official docs page names this item.
Starts 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_RECAP
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. A feature flag or server gate decides by default. This variable overrides it
Forces 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_KIND
Undocumented: Only the program shows this item. It can change without notice.
Names the remote runner kind. bridge and byoc change session and bridge behavior.TextRemote and bridge sessions
CLAUDE_CODE_ENVIRONMENT_RUNNER_VERSION
Undocumented: Only the program shows this item. It can change without notice.
Sends 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_NUDGE
Undocumented: Only the program shows this item. It can change without notice.
Forces 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_CLOUD
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Allows 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_INIT
Undocumented: Only the program shows this item. It can change without notice.
Sets 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_IGNORE_PERSISTED_TRUST
Undocumented: Only the program shows this item. It can change without notice.
Makes Claude Code ignore saved workspace trust records.1 turns it on. Off by default. Since 2.1.307Self-hosted runner. The runner sets it when it starts with --trust-workspace false. Settings env cannot set it
CLAUDE_CODE_IS_COWORK
Undocumented: Only the program shows this item. It can change without notice.
Marks 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_BUNDLE
Undocumented: Only the program shows this item. It can change without notice.
Makes a cloud session upload the working tree the previous way, as a git bundle.On or off. Claude Code ignores it when a settings file sets it or when settings move HOME or CLAUDE_CONFIG_DIRCloud sessions (git bundle upload)
CLAUDE_CODE_PARKED_PERMISSION_WAIT_MS
Undocumented: Only the program shows this item. It can change without notice.
Feeds 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_CLEAR
Undocumented: Only the program shows this item. It can change without notice.
Feeds 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_RETIRES
Undocumented: Only the program shows this item. It can change without notice.
Feeds the parkedStopRetires field of the parked-permission resume options. No visible effect in a print-mode probe (Probes).On or offAll sessions
CLAUDE_CODE_REMOTE
Documented: An official docs page names this item.
Marks 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_TYPE
Undocumented: Only the program shows this item. It can change without notice.
Names 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_MODE
Undocumented: Only the program shows this item. It can change without notice.
Reports 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_CONFIG
Documented: An official docs page names this item.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Names 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_URL
Undocumented: Only the program shows this item. It can change without notice.
Gives 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_KEEPALIVES
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Sends session keepalive callbacks during heartbeat and long hook runs. Hook keepalive also needs a feature flag.On or offCloud sessions
CLAUDE_CODE_REMOTE_SESSION_ID
Documented: An official docs page names this item.
Holds the ID of the current cloud session.Text. Claude Code sets it in cloud sessions, and a self-hosted runner sets it too. Telemetry and the session ID parser read itCloud sessions
CLAUDE_CODE_REMOTE_SESSION_ORIGIN
Undocumented: Only the program shows this item. It can change without notice.
The value review marks a review-origin session. Such sessions skip some token disk writes.Text. Compared to reviewCloud sessions
CLAUDE_CODE_REMOTE_SESSION_UUID
Documented: An official docs page names this item.
Holds 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_PATH
Undocumented: Only the program shows this item. It can change without notice.
Names a file that replaces the remote settings fetch. The log says skipping API fetch.Text. Read directlyAll sessions
CLAUDE_CODE_REMOTE_TOOLS_FORWARD
Undocumented: Only the program shows this item. It can change without notice.
Turns on the remote tools forward mode. When it is on, tool schemas get an optional machine field that names an attached machine to run the call on. When it is off, a call that names a machine fails with "Running tool calls on an attached machine is not enabled in this session". Project settings env cannot set it.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_UNATTENDED
Undocumented: Only the program shows this item. It can change without notice.
A 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_HOST_IDLE_RELEASE_MINUTES
Undocumented: Only the program shows this item. It can change without notice.
Lets a session that serves tools to a cloud session end itself after it runs nothing here for this many minutes. Work in progress, live tool calls, and background work keep it open. Added in 2.1.312.A number of minutes. Whole number from 1 to 10080, digits only. Read only in a control-only tools session. A host that starts a child session does not pass the value on. The child gets a value from a feature flag, default 60Host apps, sessions that serve tools to cloud sessions
CLAUDE_CODE_REMOTE_TOOLS_JUMP_QUEUE
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. A feature flag or server gate decides by default. This variable overrides it
Overrides 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_LOGIN
Undocumented: Only the program shows this item. It can change without notice.
Pins 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_POLICY
Undocumented: Only the program shows this item. It can change without notice.
Picks the policy of the tools that the session serves to cloud sessions. parity builds the served tools with background shells when they are available. interim builds a separate tool set. The mode is reported in the served tools facts.Unset or parity gives parity. Any other value gives interimSessions that serve tools to cloud sessions
CLAUDE_CODE_REMOTE_TOOLS_SERVE
Undocumented: Only the program shows this item. It can change without notice.
Turns 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_CHANNEL
Undocumented: Only the program shows this item. It can change without notice.
A false value turns off the session channel of the remote tools module. Tools are then served over the device bridge only (transport bridge and not auto), and the served tools facts report bridge_only.On or off. Compared to the boolean false onlySessions that serve tools to cloud sessions
CLAUDE_CODE_REPO_CHECKOUTS
Undocumented: Only the program shows this item. It can change without notice.
Maps 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_RESUME_SHOWS_CUT_OFF_CALLS
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. A server kill switch can turn it off
On resume, shows Claude the tool calls that an interruption cut off, so Claude knows their outcome is unknown.true turns it on. Since 2.1.309. A self-hosted runner sets it for a session that moved to a new runner, unless the value is falseResumed sessions, self-hosted runner
CLAUDE_CODE_SESSION_ORIGIN
Undocumented: Only the program shows this item. It can change without notice.
Marks 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_FEATURE
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Names 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_STDOUT
Undocumented: Only the program shows this item. It can change without notice.
Sets 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_V2
Undocumented: Only the program shows this item. It can change without notice.
Marks a child as a CCR v2 session.On or off. Claude Code sets it to 1 in the environment of self-hosted runner childrenSelf-hosted runner
CLAUDE_CODE_WARN_DISK_FREE_GIB
Undocumented: Only the program shows this item. It can change without notice.
Sets a low free disk level in GiB. The program reads it as diskLowGib and forwards it to the remote env.A number, 0 by defaultAny session that is not a child session. A watchdog checks every 60 seconds and shows Claude the notice "Low disk space: ... is free on the filesystem holding the working directory." Not set from project env before trust
CLAUDE_CODE_WARN_MEMORY_FREE_GIB
Undocumented: Only the program shows this item. It can change without notice.
Sets a low free memory level in GiB. The program reads it as memoryLowGib and forwards it to the remote env.A number, 0 by defaultAny session that is not a child session. A watchdog checks every 60 seconds and shows Claude the notice "Low memory: ... is available to this session." Not set from project env before trust
CLAUDE_CODE_WEBFETCH_USE_CCR_PROXY
Undocumented: Only the program shows this item. It can change without notice.
Sends 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_PROXY
Undocumented: Only the program shows this item. It can change without notice.
Sends 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_EPOCH
Undocumented: Only the program shows this item. It can change without notice.
Counts 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_PREFIX
Documented: An official docs page names this item.
Sets the prefix of auto-generated Remote Control session names.--
CLAUDE_REMOTE_TOOLS_BRIDGE_URL
Undocumented: Only the program shows this item. It can change without notice.
Overrides the URL of the device bridge for remote tools.A URL-
CLAUDE_REMOTE_WORKFLOW_ARGS
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Passes JSON arguments to the workflow script of a remote session.--
CLAUDE_REMOTE_WORKFLOW_SCRIPT
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Holds the workflow script that a remote session runs through a fixed command.--
CLAUDE_RUNNER_ACCOUNT_EMAIL
Undocumented: Only the program shows this item. It can change without notice.
Gives the spawn-runner hook the account email of the work order.Text. Taken from the account_email claim of the work orderSelf-hosted runner, orchestrator mode
CLAUDE_RUNNER_ACCOUNT_ID
Undocumented: Only the program shows this item. It can change without notice.
Gives the spawn-runner hook the account ID of the work order.Text. Taken from the account_id claim of the work orderSelf-hosted runner, orchestrator mode
CLAUDE_RUNNER_ACTIVITY_FD
Undocumented: Only the program shows this item. It can change without notice.
Names an extra file descriptor that the remote IO layer writes to.--
CLAUDE_RUNNER_ALIVE_EVERY_MS
Undocumented: Only the program shows this item. It can change without notice.
Sets how often a runner child that started a turn before it finished starting up writes an alive_before_init line to the activity channel.A number of milliseconds. Since 2.1.309. Set by the self-hosted runner for its childSelf-hosted runner
CLAUDE_RUNNER_API_BASE_URL
Documented: An official docs page names this item.
Gives runner hooks the API base URL. The code-sign helper uses it as a last fallback.A URL-
CLAUDE_RUNNER_ATTEMPT
Undocumented: Only the program shows this item. It can change without notice.
Gives the spawn-runner hook the attempt number of the work order.A number as text. Taken from the attempt claimSelf-hosted runner, orchestrator mode
CLAUDE_RUNNER_CHECKOUT_PATH
Undocumented: Only the program shows this item. It can change without notice.
Gives a checkout hook the path where the repository is to be checked out.A pathSelf-hosted runner checkout hook
CLAUDE_RUNNER_CLIENT_PLATFORM
Documented: An official docs page names this item.
Tells hooks and the child session which client platform started the runner session.--
CLAUDE_RUNNER_CORRELATION_ID
Undocumented: Only the program shows this item. It can change without notice.
Gives the spawn-runner hook the correlation ID of the work order.Text. Taken from the correlation_id claimSelf-hosted runner, orchestrator mode
CLAUDE_RUNNER_DEBUG_LOG_PATH
Undocumented: Only the program shows this item. It can change without notice.
Gives the post-session hook the path of the debug log of the session. The help text of the runner says to copy the log from the hook if you need it locally.A pathSelf-hosted runner post-session hook
CLAUDE_RUNNER_DISABLE_AWAITING_ACTION_OVERRIDE
Undocumented: Only the program shows this item. It can change without notice.
Stops the runner from reporting awaiting-action when the child waits at a prompt after a turn ends.--
CLAUDE_RUNNER_DISABLE_TURN_BEGAN_BEFORE_INIT
Undocumented: Only the program shows this item. It can change without notice.
Stops the runner from treating a turn that starts before the child finishes starting up as activity. --startup-timeout-min then keeps counting from the start.On or off, off by default. Since 2.1.309Self-hosted runner
CLAUDE_RUNNER_EXIT_REASON
Undocumented: Only the program shows this item. It can change without notice.
Gives the post-session hook the reason that the session ended.TextSelf-hosted runner post-session hook
CLAUDE_RUNNER_FETCH_DEPTH
Documented: An official docs page names this item.
Sets the --depth of the runner git fetch.--
CLAUDE_RUNNER_FETCH_SERVER_PROGRESS_CAP_MS
Documented: An official docs page names this item.
Sets a cap in ms for the server-progress wait of the runner git fetch.A number of milliseconds-
CLAUDE_RUNNER_GIT_MOUNT_URL
Undocumented: Only the program shows this item. It can change without notice.
Gives a checkout hook the address of the Anthropic-managed git mount of the session. It is not set for a session without one.A URLSelf-hosted runner checkout hook
CLAUDE_RUNNER_ORDER_ID
Undocumented: Only the program shows this item. It can change without notice.
Gives the spawn-runner hook the ID of the work order.Text. Taken from the jti claimSelf-hosted runner, orchestrator mode
CLAUDE_RUNNER_ORDER_SERVER_TIME
Undocumented: Only the program shows this item. It can change without notice.
Gives the spawn-runner hook the server time of the work order.Text. Taken from the server_time claimSelf-hosted runner, orchestrator mode
CLAUDE_RUNNER_POOL_ID
Undocumented: Only the program shows this item. It can change without notice.
Gives the spawn-runner hook the pool ID of the work order.Text. Taken from the pool_id claimSelf-hosted runner, orchestrator mode
CLAUDE_RUNNER_PRIMARY_REPO_REVISION
Undocumented: Only the program shows this item. It can change without notice.
Gives the spawn-runner hook the revision of the primary repository of the work order.Text. Taken from the primary_repo_revision claimSelf-hosted runner, orchestrator mode
CLAUDE_RUNNER_PRIMARY_REPO_URL
Undocumented: Only the program shows this item. It can change without notice.
Gives the spawn-runner hook the URL of the primary repository of the work order.Text. Taken from the primary_repo_url claimSelf-hosted runner, orchestrator mode
CLAUDE_RUNNER_REPO_REF
Undocumented: Only the program shows this item. It can change without notice.
Gives a checkout hook the ref to check out.Text. An empty string when there is no refSelf-hosted runner checkout hook
CLAUDE_RUNNER_REPO_SOURCES
Undocumented: Only the program shows this item. It can change without notice.
Gives the spawn-runner hook the repository sources of the work order.Text. An empty string when the work order has no sourcesSelf-hosted runner, orchestrator mode
CLAUDE_RUNNER_REPO_URL
Undocumented: Only the program shows this item. It can change without notice.
Gives a checkout hook the URL of the repository to check out.TextSelf-hosted runner checkout hook
CLAUDE_RUNNER_SESSION_ID
Documented: An official docs page names this item.
Gives lifecycle hooks the session ID. The code-sign helper reads it when CLAUDE_CODE_REMOTE_SESSION_ID is unset.Text-
CLAUDE_RUNNER_SESSION_UUID
Undocumented: Only the program shows this item. It can change without notice.
Gives hooks the session ID in a second form, next to CLAUDE_RUNNER_SESSION_ID.TextSelf-hosted runner hooks
CLAUDE_RUNNER_SKIP_GIT_VERIFY
Documented: An official docs page names this item.
Skips the check for a .git directory after the checkout hook ends. For non-git source control.--
CLAUDE_RUNNER_TRUST_CANONICAL_PREWARM
Undocumented: Only the program shows this item. It can change without notice.
Tells the runner to trust the prewarmed canonical checkout and skip its validation.--
CLAUDE_RUNNER_USE_GIT_PROXY
Documented: An official docs page names this item.
Turns on the Anthropic git proxy for the self-hosted runner.--
CLAUDE_RUNNER_WORK_ORDER_FILE
Undocumented: Only the program shows this item. It can change without notice.
Gives the spawn-runner hook the path of the file that holds the work order.A pathSelf-hosted runner, orchestrator mode
CLAUDE_RUNNER_WORKSPACE_PATHS
Undocumented: Only the program shows this item. It can change without notice.
Gives the post-session hook the workspace paths of the session.Text. Paths joined with :Self-hosted runner post-session hook
CLAUDE_SSH_DAEMON_CHILD
Undocumented: Only the program shows this item. It can change without notice.
A text variable that the program declares. With CLAUDE_SSH_RUN_DIR it can skip an optional prompt section. A Probes run saw no effect.Text-
CLAUDE_SSH_RUN_DIR
Undocumented: Only the program shows this item. It can change without notice.
A 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_ROOT
Undocumented: Only the program shows this item. It can change without notice.
Sets the root directory for staged upload files in remote sessions.--
LOCAL_BRIDGE
Undocumented: Only the program shows this item. It can change without notice.
Points the bridge URL to ws://localhost:8765, like USE_LOCAL_OAUTH.--
SELF_HOSTED_RUNNER_AGENT_PROXY_URL
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Sets the agent proxy for the runners that the spawn-runner hook starts. The hook must pass it on to each runner.Text. An https:// URL. The --agent-proxy-url flag wins over the variable when both are setclaude self-hosted-runner only
SELF_HOSTED_RUNNER_BASE_DIR
Documented: An official docs page names this item.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Sets 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_BG_RESULT_GRACE_MS
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Limits how long a background task that just finished still counts as in flight, until the follow-up turn that reads its result starts.A number of milliseconds. 0 or an unusable value gives the built-in default, so the hold cannot be turned offclaude self-hosted-runner only
SELF_HOSTED_RUNNER_CHECKOUT_HOOK_TIMEOUT_MS
Documented: An official docs page names this item.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Sets how long a checkout hook may run. At the limit the runner stops the hook, and the setup of the session fails.Milliseconds. Flag --checkout-hook-timeout-min (minutes). Default 30 minutes. 0 turns the limit off. Maximum 10080 minutes. Since 2.1.307Self-hosted runner
SELF_HOSTED_RUNNER_CLIENT_LABEL
Documented: An official docs page names this item.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Sets 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_GIT
Documented: An official docs page names this item.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Writes 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_SETTINGS
Documented: An official docs page names this item.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Sets 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_DIR
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Writes 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_DIR
Documented: An official docs page names this item.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Writes live tokens to disk for debugging.Text. Debug only, not for production. Flag --debug-token-dirSelf-hosted runner
SELF_HOSTED_RUNNER_DEFER_SHUTDOWN_MAX_MS
Documented: An official docs page names this item.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
On 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_DIFF_FINDS_NESTED_REPOSITORY
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Lets the web Changes pane show a repository cloned in a subfolder when the session started with no repository.On or off. Flag --diff-finds-nested-repository. One repository only, and only while the tool sandbox is off. Since 2.1.307Self-hosted runner
SELF_HOSTED_RUNNER_DRAIN_GRACE_MS
Documented: An official docs page names this item.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Keeps 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_FILE
Documented: An official docs page names this item.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Names 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_BG_TASKS_MS
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Old name of SELF_HOSTED_RUNNER_DRAIN_WAIT_MS. The runner reads it only when the new variable is unset or empty.A number of milliseconds. Zero, a negative number, or text gives 0. The maximum is 2147483647claude self-hosted-runner only. The flag --drain-wait-bg-tasks-sec is a deprecated alias of --drain-wait-sec
SELF_HOSTED_RUNNER_DRAIN_WAIT_MS
Documented: An official docs page names this item.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
On 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_SECRET
Documented: An official docs page names this item.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Gives the environment secret that the runner uses to authenticate.Text. Trimmed string. The flag --environment-secret-file winsSelf-hosted runner
SELF_HOSTED_RUNNER_EXEC_PATH
Documented: An official docs page names this item.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Sets 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_PORT
Documented: An official docs page names this item.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Sets 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_HOLD_IDLE_FILE
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Names a file that keeps an idle session from being released while the file is a regular file changed in the last 180 seconds. Your host keeps it fresh while a process that the session left running (for example nohup or tmux) lives. The --hold-idle-file flag sets it. Added in 2.1.311.A path, off when unset or blank. The runner looks again every 30 seconds. A path that leads to a network location is refused. The hold does not apply at startup, at --retire-at, at the --defer-shutdown-max-min ceiling, or at --kill-session-after-minclaude self-hosted-runner only
SELF_HOSTED_RUNNER_HOOKS_DIR
Documented: An official docs page names this item.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Names 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_DIR
Documented: An official docs page names this item.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Names 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_SNAPSHOT
Documented: An official docs page names this item.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Chooses where the startup snapshot of the host config is kept.Text. Another value throwsSelf-hosted runner
SELF_HOSTED_RUNNER_IDLE_SHUTDOWN_MS
Documented: An official docs page names this item.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Exits 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_ACCOUNT
Documented: An official docs page names this item.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Locks 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_FILE
Documented: An official docs page names this item.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Copies runner logs to a file in append mode.Text. Flag --log-file. Stdout is unchangedSelf-hosted runner
SELF_HOSTED_RUNNER_MAX_HOLD_MS
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
With SELF_HOSTED_RUNNER_HOLD_IDLE_FILE, releases the session anyway after it has been idle this long. The --max-hold-min flag sets it in minutes. Added in 2.1.311.A number of ms, 86400000 (24 hours) by default. 0 turns the hold off, and so does a value that is not a usable ms duration. The flag takes 0 to 10080 minutesclaude self-hosted-runner only
SELF_HOSTED_RUNNER_MAX_LIFETIME_GRACE_MS
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Overrides the hard cap after the max-lifetime deadline. A turn that still runs at the cap gets SIGTERM.A number of milliseconds. The help text names a cap of 15 minutes past the deadline. 0 or an unusable value gives the built-in defaultclaude self-hosted-runner only. Works with SELF_HOSTED_RUNNER_MAX_LIFETIME_MS
SELF_HOSTED_RUNNER_MAX_LIFETIME_MS
Documented: An official docs page names this item.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Caps 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_SECRET
Documented: An official docs page names this item.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Deprecated: The program or the official docs call this deprecated. Alias of SELF_HOSTED_RUNNER_ENVIRONMENT_SECRET
Deprecated 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_MS
Documented: An official docs page names this item.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Sets 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_POST_TURN_SETTLE_MS
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Limits how long a turn that just finished still counts as in flight, until the session process reports its end to the server.A number of milliseconds. The help text says the default is normally about two seconds. 0 or an unusable value gives the built-in defaultclaude self-hosted-runner only
SELF_HOSTED_RUNNER_PROXY_AUTHORIZATION_COMMAND
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
For an egress proxy that needs a Proxy-Authorization header. The command prints the full header value, and the runner runs it for each new connection to the proxy.A shell command. Flag --proxy-authorization-command. Setting it together with the file variable is an error. Needs HTTPS_PROXY or HTTP_PROXY, and ALL_PROXY alone does not countclaude self-hosted-runner only. The help text says the value is never logged
SELF_HOSTED_RUNNER_PROXY_AUTHORIZATION_FILE
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Names a file that holds the Proxy-Authorization header value for an egress proxy. It is the file form of SELF_HOSTED_RUNNER_PROXY_AUTHORIZATION_COMMAND.A path. Flag --proxy-authorization-file. Setting it together with the command variable is an error. Needs HTTPS_PROXY or HTTP_PROXYclaude self-hosted-runner only
SELF_HOSTED_RUNNER_PUSH_OUTCOME_ON_RELEASE
Documented: An official docs page names this item.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Pushes 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_STATE
Documented: An official docs page names this item.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Deletes 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_AT
Documented: An official docs page names this item.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Retires 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_LISTS
Documented: An official docs page names this item.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Chooses which server auto-mode classifier lists a session may receive.Text. Another value stops the runner. Flag --server-auto-mode-listsSelf-hosted runner
SELF_HOSTED_RUNNER_SIGKILL_GRACE_MS
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Sets the SIGKILL grace of a runner session. The runner never uses less than the time of the post-session hook plus a margin.A number of milliseconds. Default 30000. The maximum is 2147483647claude self-hosted-runner only
SELF_HOSTED_RUNNER_SIGKILL_TIMEOUT_MS
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Caution: It deletes data, skips a safety check, or sends data off your machine. Renamed. In 2.1.312 the runner stops at startup with a fatal error when this variable is set.
Old name of SELF_HOSTED_RUNNER_SESSION_STOP_GRACE_MS. The runner stops with an error that tells you to use the new name.Do not set itclaude self-hosted-runner only
SESSION_INGRESS_URL
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Sets 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_BIN
Undocumented: Only the program shows this item. It can change without notice.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Sets 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. Claude Code itself sets some variables. Do not set them yourself.

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