Skip to main content

System and Third-Party

Claude Code reads many variables that it does not define. Your system, your terminal, CI services, and other tools own them. Examples are HOME, PATH, EDITOR, TERM, and ALL_PROXY. Claude Code reads them to find files, pick colors, and detect where it runs.

This page lists 130 variables. You set many of them for your system anyway. Set them in your shell, or in the env key of a settings file.

Example​

export EDITOR="code --wait"
claude

Claude Code opens this editor for files, for example for /memory. VISUAL wins over EDITOR.

Variables​

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

VariableStatusWhat it doesValues and defaultNotes
__CFBundleIdentifierUndocumentedMacOS bundle id of the app that started the process. Claude Code uses it to find the host app and the URL handler.Text. Non-empty string. com.anthropic.claude-code-url-handler starts the deep link pathMacOS
AGENT_NAMEUndocumentedConfirms an Azure Pipelines agent for the terminal color level.Text. Presence test together with TF_BUILDAll sessions
ALACRITTY_LOGUndocumentedTerminal detection. A set value counts as an Alacritty terminal in a terminal-feature check and rules out a plain VTE terminal.On or off. Truthy test only. Read from the env object and from the env of the terminal detectorTerminal UI rendering, all. Not set from project env before trust
ALACRITTY_WINDOW_IDUndocumentedTerminal detection. A set value rules out a plain vte-based or gnome-terminal guess, because Alacritty sets it.On or off. Truthy test only, in the terminal detectorTerminal UI rendering, all. Not set from project env before trust
ALL_PROXYDocumentedStandard proxy variable. Claude Code passes it to git as http.proxy and remote.origin.proxy when it runs git commands.Text. Read after HTTPS_PROXY and https_proxy, with the lowercase all_proxy as the last fallbackGit helper commands, all. Not set from project env before trust
ALLUSERSPROFILEUndocumentedWindows path variable. It is the last fallback for the ProgramData folder when Claude Code builds the Windows Start Menu path.Text. Order is ProgramData, then PROGRAMDATA, then ALLUSERSPROFILE. Also in a list of Windows path namesWindows. Not set from project env before trust
ANDROID_HOMEUndocumentedEnvironment detection. If the path exists, Claude Code records android-sdk in the detected build tools.Text. Read first, with ANDROID_SDK_ROOT as the fallback. Only the path check mattersEnvironment report, all. Not set from project env before trust
ANDROID_SDK_ROOTUndocumentedEnvironment detection. It is the fallback for ANDROID_HOME. If the path exists, Claude Code records android-sdk in the detected build tools.Text. Read only when ANDROID_HOME is unsetEnvironment report, all. Not set from project env before trust
APPDATADocumentedWindows path variable. Claude Code uses it for the gcloud config folder, the Alacritty config path, and a Windows path list.Text. Used on Windows only for gcloud and Alacritty pathsWindows. Not set from project env before trust
APPVEYORUndocumentedNames AppVeyor for the terminal color level.Presence test, only when CI is set. Gives color level 1All sessions
AWS_EXECUTION_ENVUndocumentedNames the AWS runtime. Claude Code uses it to detect aws-fargate and aws-ecs as the deployment environment. The AWS SDK adds it to its user agent.Compared with AWS_ECS_FARGATE and AWS_ECS_EC2All (deployment detection) and AWS SDK calls
AWS_LAMBDA_FUNCTION_NAMEUndocumentedMarks an AWS Lambda host. Claude Code reports aws-lambda as the deployment environment when it is set.Text. Any non-empty value. The AWS SDK also reads it for trace headersAll (deployment detection)
AWS_PAGERUndocumentedSets the pager of the AWS CLI. Claude Code lists it among env names that can run a program, for safety checks.Text. No direct readSettings env and Bash safety checks
AZURE_AUTH_LOCATIONUndocumentedNames an Azure auth file path. Claude Code lists it among credential file names to protect.Text. No direct readSettings env and sandbox credential lists
AZURE_CONFIG_DIRUndocumentedSets the Azure CLI config folder. Claude Code treats it as a credential path to protect, default ~/.azure.TextSandbox credential deny paths
AZURE_FUNCTIONS_ENVIRONMENTUndocumentedMarks an Azure Functions host. Claude Code reports azure-functions as the deployment environment when it is set.Any non-empty valueAll (deployment detection)
BASH_ENVDocumentedNames the startup file that bash reads. Claude Code treats it as an unsafe inlet and flags it in settings and plugin env.Claude Code never reads it for its own useSettings env, plugin env, sandbox checks
BROWSERDocumentedNames the command that opens URLs. Claude Code uses it before open on macOS, and the browser setting wins over it.Text. The browser setting wins over it. On Linux with no display the open step fails with no_displayAll sessions
BUILDKITEUndocumentedMarks a Buildkite CI run. Claude Code uses it for CI detection, deployment detection, and color depth hints.Text. Any non-empty value countsAll sessions
C9_PIDUndocumentedMarks an AWS Cloud9 workspace. Claude Code reports aws-cloud9 as the environment when it is set.Any non-empty value. Read directly in deployment detectionAll (deployment detection)
C9_USERUndocumentedMarks an AWS Cloud9 workspace. Claude Code reports aws-cloud9 as the environment when it is set.Any non-empty value. Read directly in deployment detectionAll (deployment detection)
CDPATHUndocumentedIs the shell cd search path. Claude Code blanks it in cd helper commands and treats it as an unsafe env name to override.TextBash tool, Git and settings env checks
CF_PAGESUndocumentedMarks Cloudflare Pages. Claude Code reports cloudflare-pages as the deployment environment and counts it as a CI signal.On or off. Truthy value checkAll (deployment detection)
CIDocumentedMarks a CI run for the terminal color level.Presence test ("CI" in env), any value counts. A CI vendor variable then picks the levelAll sessions
CI_NAMEUndocumentedNames the CI vendor. Claude Code checks for codeship when it picks the terminal color depth.Text. Only the value codeship mattersTerminal color detection (all)
CIRCLECIUndocumentedMarks a CircleCI run. Claude Code uses it for CI detection, deployment detection, and terminal color depth.Text. Presence countsAll sessions
CODERUndocumentedMarks a Coder workspace. The environment detector records deployment coder.--
CODER_WORKSPACE_NAMEUndocumentedMarks a Coder workspace by name. The environment detector records deployment coder.Text-
CODESPACESUndocumentedMarks GitHub Codespaces. The environment detector records deployment codespaces.--
COLORTERMUndocumentedReports terminal color support. truecolor or 24bit means 24-bit color.--
COLUMNSDocumentedGives hook commands the terminal width.--
COMPUTERNAMEUndocumentedThe Windows host name. Claude Code uses it as the device name.--
COMSPECUndocumentedThe Windows command interpreter path. Claude Code uses it as a shell path fallback in environment info.--
ComSpecDocumentedThe Windows command interpreter path. The terminal opener uses it for the Command Prompt entry.--
ConEmuANSIUndocumentedMarks ConEmu. Any of the three ConEmu vars turns on terminal progress reporting.--
ConEmuPIDUndocumentedMarks ConEmu. Any of the three ConEmu vars turns on terminal progress reporting.--
ConEmuTaskUndocumentedMarks ConEmu. The value {cmd::Cmder} also selects Unicode symbols.--
CONTAINER_SANDBOX_MOUNT_POINTUndocumentedMarks a Windows container. The check turns off the registry sweep.--
COREPACK_ENABLE_AUTO_PINUndocumentedSet to 0 at startup so that corepack does not edit package.json.--
CURSOR_TRACE_IDUndocumentedMarks the Cursor editor. Claude Code uses it to name the terminal host.Text-
DAYTONA_WS_IDUndocumentedMarks a Daytona workspace. The environment detector records deployment daytona.Text-
DENO_DEPLOYMENT_IDUndocumentedMarks Deno Deploy. The environment detector records deployment deno-deploy.Text-
DEVPODUndocumentedMarks a DevPod workspace. The environment detector records deployment devpod.--
DEVPOD_WORKSPACE_UIDUndocumentedMarks a DevPod workspace by ID. The environment detector records deployment devpod.--
DISPLAYUndocumentedTells Claude Code if a local display exists on Linux. With no DISPLAY and no WAYLAND_DISPLAY, it treats the browser open as not possible.Text. Matched against :N or unix:N formsLinux. Not set from project env before trust
DRONEUndocumentedNames Drone CI for the terminal color level.Presence test, only when CI is set. Gives color level 1All sessions
DYNOUndocumentedHeroku sets it. Environment detection reports the deployment platform as heroku when it is non-empty.Any non-empty value countsAll sessions. Environment detection only
EDITORDocumentedNames the editor that Claude Code opens for files, for example for /memory. VISUAL wins over it, and the fallback is the first of code, vi, nano found.Text. Also sent in environment detection as the editor valueInteractive. Not set from project env before trust
FLY_APP_NAMEUndocumentedFly.io sets it. Environment detection reports the platform as fly.io when it is non-empty.TextAll sessions. Environment detection only
FLY_MACHINE_IDUndocumentedFly.io sets it. Environment detection reports the platform as fly.io when it is non-empty.TextAll sessions. Environment detection only
FORCE_COLORDocumentedForces the color depth. The Bun runtime maps "", 1, true to 16 colors and 2 to 256 colors.Text. Untrimmed stringAll sessions. Not set from project env before trust
GH_CONFIG_DIRUndocumentedNames the gh config directory. Claude Code checks it for hosts.yml or config.yml to see if gh has a login.Text. Falls back to XDG_CONFIG_HOME/gh, then ~/.config/gh. Also used in a secrets scanGitHub features. Not set from project env before trust
GH_HOSTDocumentedNames the GitHub host. It picks the enterprise token and is passed to the gh stand-in shim.TextGitHub features. Not set from project env before trust
GH_REPOUndocumentedNames the repository for gh. Claude Code passes it to the gh shim, which uses a host in it to choose the route.TextGitHub features. Not set from project env before trust
GITEA_ACTIONSUndocumentedNames Gitea Actions for the terminal color level.Presence test, only when CI is set. Gives color level 3 in one helperAll sessions
GITHUB_ACTION_PATHUndocumentedPath of the running action. Claude Code protects it in the scrub path list and logs the claude-code-action ref.A pathGitHub Actions. Not set from project env before trust
GITHUB_ACTIONSUndocumentedMarks a GitHub Actions run. It adds run metadata to telemetry and turns on the subprocess env scrub unless that scrub is set off.On or off. Truthy parse. CLAUDE_CODE_SUBPROCESS_ENV_SCRUB set to 0, false, no, or off turns the scrub offGitHub Actions. Not set from project env before trust
GITHUB_ACTORUndocumentedGives a user label for a cache diagnostic. It falls back to USER, USERNAME, then the git email name.Text. The label drops chars outside a-zA-Z0-9._- and is cut to 64 chars. Telemetry also reads it in ActionsGitHub Actions. Not set from project env before trust
GITHUB_ENVUndocumentedPath of the runner env file. Claude Code adds it to the protected path list of the subprocess scrub.Resolved to a pathGitHub Actions. Not set from project env before trust
GITHUB_EVENT_PATHUndocumentedPath of the event payload file. Claude Code adds it to the protected path list of the subprocess scrub.A pathGitHub Actions. Not set from project env before trust
GITHUB_WORKSPACEUndocumentedPath of the workspace. If it differs from the cwd, Claude Code protects its .git hooks and config in the scrub path list.-GitHub Actions. Not set from project env before trust
GITLAB_CIUndocumentedGitLab CI marker. It appears in CI vendor lists of the Bun runtime and the color support code.Text. Use is by name in lists. No direct Claude Code read was seenGitLab CI. Not set from project env before trust
GITPOD_WORKSPACE_IDUndocumentedGitpod sets it. Environment detection reports the deployment as gitpod when it is non-empty.TextAll sessions. Environment detection only
GNOME_TERMINAL_SERVICEUndocumentedTerminal marker for GNOME Terminal. Environment detection records if it is set.Presence onlyTerminal detection
GOOGLE_CLOUD_WORKSTATIONSUndocumentedMarks Google Cloud Workstations. Environment detection reports gcp-cloud-workstations when it is set.Presence checkAll sessions. Environment detection only
HISTFILEUndocumentedGives the shell history path to a context step that reads the shell history for tool usage.Text. Passed as the history file input. Does not run if the home is a network pathContext gathering. Not set from project env before trust
HOMEDocumentedHome directory. Many paths start from it, such as the config and XDG fallback dirs.Text. Falls back to the OS home dirAll sessions. Not set from project env before trust
HOMEDRIVEUndocumentedWindows home drive. Claude Code sets it in a child env and uses it to expand paths in a Windows lookup.Set by Claude Code from the home path for a Windows child envWindows
HOMEPATHUndocumentedWindows home path. Claude Code sets it in a child env and uses it to expand paths in a Windows lookup.Set by Claude Code from the home path for a Windows child envWindows
HOMESHAREUndocumentedWindows network home. Claude Code uses it to expand %HOMESHARE% in a Windows registry lookup.TextWindows
KUBERNETES_SERVICE_HOSTUndocumentedDetects a Kubernetes pod so Claude Code reports a Kubernetes container runtime.--
NODE_ENVDocumentedClaude Code sets production in the env of some helper child processes. It also lists it in env reports.--
NODE_OPTIONSUndocumentedNode options. Claude Code adds --max-old-space-size=8192 when CLAUDE_CODE_REMOTE is true.--
NODE_PATHDocumentedBun runtime module search path. Claude Code removes it from the env of some helper child processes.A path-
PATHDocumentedStandard executable search path. Claude Code reads it to find tools and sets it in shell and pwsh child environments.TextAll sessions. Not set from project env before trust
PATHEXTDocumentedWindows list of executable extensions. Used when Claude Code looks for commands.Text, .EXE by default. For pwsh child shells Claude Code sets its own valueWindows. Not set from project env before trust
PIP_CERTUndocumentedSets the CA bundle path for pip. Claude Code sets it in the egress-proxy child env.Text. Also in the sandbox CA listSessions with the agent proxy or sandbox. Not set from project env before trust
PLAYWRIGHT_BROWSERS_PATHUndocumentedIs part of the key of the local Chrome search for artifact preview.TextLocal sessions with artifact preview. Not set from project env before trust
PREFIXDocumented GatedGives the Termux install prefix. Claude Code uses $PREFIX/tmp for daemon and socket paths.Text. Used only when TERMUX_VERSION is set. Else /tmpTermux (Android). Not set from project env before trust
PROGRAMDATAUndocumented GatedGives the Windows ProgramData folder. Used to find the Start Menu folder and as a protected env name in shell checks.Text. Looked up as ProgramData, then PROGRAMDATA, then ALLUSERSPROFILEWindows. Not set from project env before trust
ProgramDataDocumented GatedGives the Windows ProgramData folder for the sandbox runtime and the Azure Arc token path.Text. The sandbox throws ProgramData is not set when it is missingWindows. Not set from project env before trust
ProgramFilesDocumented GatedGives the Windows Program Files folder. Used to locate PowerShell and Azure Arc tools.TextWindows. Not set from project env before trust
PROJECT_DOMAINUndocumentedMarks the host as Glitch in deployment-environment detection.TextAll platforms. Not set from project env before trust
PWDDocumentedStandard working directory. Claude Code adds it as a session directory when it differs from the original cwd.Text. Used in startup permission setup and shell-expression checksAll sessions. Not set from project env before trust
RAILWAY_ENVIRONMENT_NAMEUndocumentedMarks the host as Railway in deployment-environment detection.TextAll platforms. Not set from project env before trust
RAILWAY_SERVICE_NAMEUndocumentedMarks the host as Railway in deployment-environment detection.TextAll platforms. Not set from project env before trust
RENDERUndocumentedMarks the host as Render in deployment-environment detection.TextAll platforms. Not set from project env before trust
REPL_IDUndocumentedMarks the host as Replit in deployment-environment detection.TextAll platforms. Not set from project env before trust
REPL_SLUGUndocumentedMarks the host as Replit in deployment-environment detection.TextAll platforms. Not set from project env before trust
REQUESTS_CA_BUNDLEUndocumentedSets the CA bundle path for Python requests. Claude Code sets it in the egress-proxy and sandbox child env.Text. Listed with the other CA variablesSessions with the agent proxy or sandbox. Not set from project env before trust
RUNNER_ENVIRONMENTUndocumented GatedGitHub Actions runner kind. github-hosted marks a hosted runner in diagnostics.Text. Read only when GITHUB_ACTIONS is trueGitHub Actions. Not set from project env before trust
RUNNER_OSUndocumented GatedGitHub Actions runner OS. Claude Code reports it in telemetry.Text. Read only when GITHUB_ACTIONS is trueGitHub Actions. Not set from project env before trust
SESSIONNAMEUndocumentedWindows console session name. Claude Code only records whether it is set, as telemetry about the terminal.Text. Any non-empty string. No behavior changeAll sessions, telemetry only
SPACE_CREATOR_USER_IDUndocumentedHugging Face Spaces variable. Claude Code uses it to detect the huggingface-spaces deployment environment for telemetry.Text. Non-empty string means presentAll sessions, telemetry only
SSH_AUTH_SOCKUndocumentedSSH agent socket. The agent proxy tests whether it is unset before it sets up git access.Text. Non-empty string. Used with GIT_SSH_COMMAND in a check on the agent proxy git setupAgent proxy (remote sessions)
SSH_CLIENTUndocumentedMarks an SSH session. Claude Code uses it to decide not to open a browser and for terminal detection.Text. Non-empty string means SSH. One of SSH_CONNECTION, SSH_TTY or this on WindowsAll sessions
SSH_CONNECTIONUndocumentedMarks an SSH session. Claude Code treats the terminal as remote and skips opening a browser.Text. Non-empty string. Sets the terminal ssh flagAll sessions
SSH_TTYUndocumentedMarks an SSH session. Used with SSH_CONNECTION and SSH_CLIENT in Windows terminal checks and in the no-browser check.Text. Non-empty string means present. Also recorded as hasSshTty in the environment reportAll sessions
STYUndocumentedGNU screen session id. Claude Code uses it to detect a screen multiplexer.Text. Non-empty string. Sets the multiplexer to screen when TMUX is not setAll sessions
SYSTEMROOTUndocumentedWindows system directory. Claude Code uses it to find powershell.exe and other Windows tools.Text. Non-empty string. Falls back to SystemRoot, then to windir, then to C:\WindowsWindows
SystemRootDocumentedWindows system directory in its usual mixed case. Claude Code reads it as a fallback and sets it in a clean git env.Text. Non-empty string. On Windows a sanitized env sets it to C:\WindowsWindows
TERMDocumentedTerminal type. Claude Code reads it to pick color level, key dialect, and terminal-feature support.Text. Non-empty string. Names like xterm-kitty or xterm-ghostty raise the color level to 3All sessions
TERM_PROGRAMDocumentedTerminal program name. Claude Code reads it to detect vscode, iTerm.app, ghostty, tmux, and others and tune features.Text. Non-empty string. Used for color level, hyperlinks, clipboard and key supportAll sessions
TERM_PROGRAM_VERSIONUndocumentedTerminal program version. Claude Code reads the major version to pick a color level for iTerm.app and a hyperlink check for tmux.Text. Non-empty string. For example iTerm2 major 3 or later gives true colorAll sessions
TERMINAL_EMULATORUndocumentedJetBrains sets it to JetBrains-JediTerm. Claude Code uses it to detect a JetBrains IDE terminal.Compared to JetBrains-JediTerm. On non-macOS it sets the terminal name to pycharmAll sessions, JetBrains terminals
TERMINATOR_UUIDUndocumentedTerminator terminal id. Claude Code records only whether it is set, as a telemetry flag.Text. Non-empty string means present. No behavior changeAll sessions, telemetry only
TF_BUILDUndocumentedNames Azure Pipelines for the terminal color level.Presence test together with AGENT_NAME. Gives color level 1 in one helper and 4 in anotherAll sessions
TILIX_IDUndocumentedTilix terminal id. Claude Code records only whether it is set, as a telemetry flag.Text. Non-empty string means present. No behavior changeAll sessions, telemetry only
TMUXDocumentedSet by tmux. Claude Code uses it to detect tmux, to find the tmux socket, and to tune colors and features.Text. Non-empty string. Also gives a true color step down, and blocks some terminal features inside tmuxAll sessions
TMUX_PANEUndocumentedSet by tmux. Claude Code uses it to find the current pane when it runs tmux commands.Text. Non-empty string. Needs TMUX as wellTmux
TRAVISUndocumentedNames Travis CI for the terminal color level.Presence test, only when CI is set. Gives color level 1All sessions
USERDocumentedLogin name. Claude Code uses it as a fallback for the user name, for example in a browser bridge socket name.Text. Non-empty string. Read when the OS user lookup fails, then USERNAME, then defaultAll sessions
USERNAMEUndocumentedWindows user name. Claude Code uses it as a name fallback and to spot Windows container users.Text. Non-empty string. ContainerAdministrator or ContainerUser turns off a registry sweepWindows
USERPROFILEDocumentedWindows home directory. Claude Code uses it to find Desktop, Documents, Downloads, and IDE lock files, and in WSL path mapping.Text. Non-empty string. Used on Windows and WSLWindows and WSL
UV_THREADPOOL_SIZEUndocumentedNode libuv thread pool size. Claude Code only prints it in MCP HTTP debug logs.Text. Non-empty string. Shown as default when unsetMCP HTTP transport debug
VERCELUndocumentedVercel variable. Claude Code uses it to detect the vercel deployment environment for telemetry.On or off. Truthy stringAll sessions, telemetry only
VSCODE_GIT_ASKPASS_MAINUndocumentedVS Code sets this path. Claude Code checks it to tell Cursor from VS Code and to find remote VS Code servers.Text. Non-empty string. A path with cursor means CursorVS Code and Cursor terminals
VTE_VERSIONUndocumentedVTE terminal version. Claude Code uses it for terminal bug workarounds and hyperlink support.A number. A value under 5300 gets a workaround for unknown sequence printing. 4400 or more enables a featureVTE terminals
WAYLAND_DISPLAYUndocumentedWayland display name. Claude Code uses it to detect whether a local display exists, and to pick a clipboard tool.Text. Non-empty string. With no DISPLAY and no WAYLAND_DISPLAY on Linux, it takes no browser or GUI pathLinux
WEBSITE_SITE_NAMEUndocumentedAzure App Service variable. Claude Code uses it to detect the azure-app-service environment for telemetry.Text. Non-empty string means presentAll sessions, telemetry only
WEBSITE_SKUUndocumentedAzure App Service variable. Claude Code uses it to detect the azure-app-service environment for telemetry.Text. Non-empty string means presentAll sessions, telemetry only
WEZTERM_PANEUndocumentedWezTerm pane id. Claude Code uses it to exclude WezTerm when it detects a VTE-based terminal.Text. Non-empty string. Used as a presence check onlyAll sessions
WINDIRUndocumentedWindows directory. Claude Code reads it once at load to build the explorer.exe path for a Windows app filter.Lowercased with a trailing backslash. Also a fallback for powershell.exe pathWindows
WSL_DISTRO_NAMEUndocumentedWSL distro name. Claude Code uses it to detect WSL and to match IDE workspace paths.Text. Non-empty string. Either this or WSL_INTEROP on Linux sets the platform to wslWSL
WSL_INTEROPUndocumentedWSL interop socket. Claude Code uses it to detect WSL.Text. Non-empty string. Either this or WSL_DISTRO_NAME on Linux sets the platform to wslWSL
WT_SESSIONUndocumentedWindows Terminal session id. Claude Code uses it to detect Windows Terminal for key and link support.Text. Non-empty string. Enables hyperlinks and some featuresWindows Terminal
XTERM_VERSIONUndocumentedXterm version. Claude Code uses it to tell xterm from a VTE terminal and as a telemetry flag.Text. Non-empty string. Presence check onlyAll sessions
ZDOTDIRDocumentedZsh config directory. Claude Code uses it to find the zsh rc files when it checks for a claude alias.Text. Non-empty string. Falls back to the home dirZsh users
ZED_TERMUndocumentedZed terminal marker. Claude Code uses it to detect the Zed terminal for hyperlink and feature support.Text. Non-empty string. Presence check onlyZed terminal
ZELLIJUndocumentedZellij marker. Claude Code uses it to detect the zellij multiplexer.Any value other than undefined. Turns off some terminal featuresZellij

How It Works​

Many rows here are detection names. Claude Code checks whether a name is set to learn the terminal, CI service, or host. For example, TRAVIS or GITLAB_CI tell it that it runs in CI, which affects the terminal color level. You rarely set these by hand. Set one only to fake or hide a detection result.

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