OmniscioGuidesEnvironment variables
Claude Code environment variables: what each one changes
This page covers the variables, what each changes, its default, and the layer to put it in. One warning: a value in a project's settings file is dropped outright if it belongs to a group Claude Code protects. If your question is which settings file wins, the settings.json guide covers that.
Sources read November 10, 2026. By the Omniscio team. Updated .
Every variable on this page, A to Z
135 names, each linking to the section that explains it. If you arrived with a variable name in hand, start here rather than scrolling.
- ANTHROPIC_API_KEY
- ANTHROPIC_AUTH_TOKEN
- ANTHROPIC_AWS_BASE_URL
- ANTHROPIC_BASE_URL
- ANTHROPIC_BEDROCK_BASE_URL
- ANTHROPIC_CUSTOM_HEADERS
- ANTHROPIC_CUSTOM_MODEL_OPTION
- ANTHROPIC_DEFAULT_FABLE_MODEL
- ANTHROPIC_DEFAULT_HAIKU_MODEL
- ANTHROPIC_DEFAULT_MODEL
- ANTHROPIC_DEFAULT_OPUS_MODEL
- ANTHROPIC_DEFAULT_SONNET_MODEL
- ANTHROPIC_FEDERATION_RULE_ID
- ANTHROPIC_FOUNDRY_BASE_URL
- ANTHROPIC_MODEL
- ANTHROPIC_ORGANIZATION_ID
- ANTHROPIC_PROFILE
- ANTHROPIC_SMALL_FAST_MODEL
- ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION
- ANTHROPIC_VERTEX_BASE_URL
- ANTHROPIC_WORKSPACE_ID
- API_TIMEOUT_MS
- BASH_DEFAULT_TIMEOUT_MS
- BASH_MAX_OUTPUT_LENGTH
- BASH_MAX_TIMEOUT_MS
- CLAUDECODE
- CLAUDE_AUTOCOMPACT_PCT_OVERRIDE
- CLAUDE_AUTO_BACKGROUND_TASKS
- CLAUDE_CODE_ACCESSIBILITY
- CLAUDE_CODE_API_KEY_HELPER_TTL_MS
- CLAUDE_CODE_AUTO_BACKGROUND_WORKER_CHECKIN_SECONDS
- CLAUDE_CODE_AUTO_COMPACT_WINDOW
- CLAUDE_CODE_CONNECT_TIMEOUT_MS
- CLAUDE_CODE_DEBUG_LOGS_DIR
- CLAUDE_CODE_DISABLE_1M_CONTEXT
- CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING
- CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN
- CLAUDE_CODE_DISABLE_AUTO_MEMORY
- CLAUDE_CODE_DISABLE_BACKGROUND_TASKS
- CLAUDE_CODE_DISABLE_BUNDLED_SKILLS
- CLAUDE_CODE_DISABLE_CLAUDE_MDS
- CLAUDE_CODE_DISABLE_CRON
- CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS
- CLAUDE_CODE_DISABLE_FAST_MODE
- CLAUDE_CODE_DISABLE_FEATURE_FLAGS
- CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING
- CLAUDE_CODE_DISABLE_MOUSE
- CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC
- CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL
- CLAUDE_CODE_DISABLE_STRUCTURED_OUTPUTS
- CLAUDE_CODE_DISABLE_TERMINAL_TITLE
- CLAUDE_CODE_DISABLE_WEB_FETCH
- CLAUDE_CODE_DISABLE_WORKFLOWS
- CLAUDE_CODE_EFFORT_LEVEL
- CLAUDE_CODE_ENABLE_AUTO_MODE
- CLAUDE_CODE_ENABLE_OPUS_4_7_FAST_MODE
- CLAUDE_CODE_ENABLE_TASKS
- CLAUDE_CODE_ENABLE_TELEMETRY
- CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS
- CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS
- CLAUDE_CODE_GIT_BASH_PATH
- CLAUDE_CODE_GOAL_CHECKIN_MINUTES
- CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS
- CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS
- CLAUDE_CODE_MAX_CONTEXT_TOKENS
- CLAUDE_CODE_MAX_OUTPUT_TOKENS
- CLAUDE_CODE_MAX_RETRIES
- CLAUDE_CODE_MAX_SUBAGENTS_PER_SESSION
- CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH
- CLAUDE_CODE_MAX_TURNS
- CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION
- CLAUDE_CODE_NO_FLICKER
- CLAUDE_CODE_OAUTH_REFRESH_TOKEN
- CLAUDE_CODE_OAUTH_SCOPES
- CLAUDE_CODE_OAUTH_TOKEN
- CLAUDE_CODE_OPUS_4_6_FAST_MODE_OVERRIDE
- CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE
- CLAUDE_CODE_PLUGIN_CACHE_DIR
- CLAUDE_CODE_PLUGIN_DIRS
- CLAUDE_CODE_PROCESS_WRAPPER
- CLAUDE_CODE_RETRY_WATCHDOG
- CLAUDE_CODE_SCROLL_SPEED
- CLAUDE_CODE_SHELL
- CLAUDE_CODE_SKIP_BEDROCK_AUTH
- CLAUDE_CODE_SUBAGENT_MODEL
- CLAUDE_CODE_SUBAGENT_MODEL_FORCE
- CLAUDE_CODE_SUBPROCESS_ENV_SCRUB
- CLAUDE_CODE_TMPDIR
- CLAUDE_CODE_TMUX_TRUECOLOR
- CLAUDE_CODE_USE_BEDROCK
- CLAUDE_CODE_USE_POWERSHELL_TOOL
- CLAUDE_CODE_WEBFETCH_CACHE_TTL_MS
- CLAUDE_CODE_WEBFETCH_DEADLINE_MS
- CLAUDE_CODE_WORKER_CHECKIN_SCHEDULE
- CLAUDE_CODE_WORKFLOW_MAX_CONCURRENT_AGENTS
- CLAUDE_CONFIG_DIR
- CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS
- CLAUDE_STREAM_IDLE_TIMEOUT_MS
- CLAUDE_SUBAGENT_BG_SHELL_MAX_MS
- DISABLE_AUTOUPDATER
- DISABLE_AUTO_COMPACT
- DISABLE_COMPACT
- DISABLE_ERROR_REPORTING
- DISABLE_GROWTHBOOK
- DISABLE_PROMPT_CACHING
- DISABLE_TELEMETRY
- DISABLE_UPDATES
- DO_NOT_TRACK
- ENABLE_PROMPT_CACHING_1H
- ENABLE_PROMPT_CACHING_1H_BEDROCK
- FORCE_COLOR
- FORCE_HYPERLINK
- FORCE_PROMPT_CACHING_5M
- GH_TOKEN
- GITHUB_ACTIONS
- GITHUB_TOKEN
- GITLAB_TOKEN
- HOME
- MAX_MCP_OUTPUT_TOKENS
- MAX_THINKING_TOKENS
- MCP_CLIENT_SECRET
- MCP_CONNECTION_NONBLOCKING
- MCP_OAUTH_CALLBACK_PORT
- MCP_PROTOCOL_NEGOTIATION
- MCP_SERVER_CONNECTION_BATCH_SIZE
- MCP_TIMEOUT
- MCP_TOOL_TIMEOUT
- NODE_OPTIONS
- NO_COLOR
- NPM_TOKEN
- PATH
- SLASH_COMMAND_TOOL_CHAR_BUDGET
- TASK_MAX_OUTPUT_LENGTH
- TMPDIR
- USE_BUILTIN_RIPGREP
Where a variable goes, and which layer wins
The place decides who it reaches.
| Where you set it | Who it reaches | When it takes effect |
|---|---|---|
Your shell, before launching claude | The session you started from that shell | At launch, and never again: a running session does not pick up a later export |
The env block of ~/.claude/settings.json | You, in every project | At startup, and again in the running session when you save a change |
The env block of a project's .claude/settings.json or .claude/settings.local.json | The project, or just you in it | After you trust the workspace, or at startup in a -p run |
| Managed settings, deployed by an administrator | Everyone in the organisation | At startup, and again when a saved change alters the merged values |
| A launch environment built by a desktop app or a self-hosted runner | That one session | Immediately, and it beats every settings file for a name it already sets |
Three rules explain almost every surprise:
- The settings file beats the shell. When both set the same name, the settings value applies in most sessions.
- A settings file can set a variable but cannot remove one. To cancel an export from a shell profile you do not control, set it to an empty string: Claude Code treats that as unset when it picks a provider, and subprocesses inherit the empty value.
- A launch environment is the top layer. When a desktop app or a self-hosted runner builds the environment, Claude Code ignores any settings-file value for a name it already carries.
One group cannot be set from a project's own files at all, however it is written.
It covers CLAUDE_CONFIG_DIR, CLAUDE_CODE_TMPDIR and the OS's own HOME, TMPDIR and XDG_* names; the Windows variables that pick the programs Claude Code starts, such as SystemRoot and ComSpec; and the OpenTelemetry exporter and content variables.
It also covers the claude.ai tokens CLAUDE_CODE_OAUTH_TOKEN, CLAUDE_CODE_OAUTH_REFRESH_TOKEN and CLAUDE_CODE_OAUTH_SCOPES, and the names that change how it starts or syncs, such as CLAUDE_CODE_PROCESS_WRAPPER.
A startup notice and /status tell an interactive session which ones were dropped, by name and never by value; a -p run says nothing.
One part of that group runs the other way: a value that turns telemetry off still applies from a project or local settings file — none for an exporter selector, or an off value such as 0 for one of the OpenTelemetry content variables — because turning something off is the one direction a checked-out repository can push.
Syntax is plain on purpose. Values in a settings file are copied into the environment exactly as written, with no shell to expand them, so a ~ or a $HOME stays a literal tilde or dollar sign. For a path such as CLAUDE_CONFIG_DIR, write the absolute path.
Logging in: keys, tokens and profiles
The variable most people reach for first is ANTHROPIC_API_KEY, and it also changes which account pays for the work.
| Variable | What it does |
|---|---|
ANTHROPIC_API_KEY | Sent as the X-Api-Key header. When set it is used instead of a Claude plan you are signed in to; in a -p run it always wins, and interactively you approve it once |
ANTHROPIC_AUTH_TOKEN | Value for the Authorization header, prefixed with Bearer for you |
CLAUDE_CODE_OAUTH_TOKEN | A claude.ai OAuth access token, an alternative to /login for scripted and SDK runs; it beats a keychain credential, and it cannot be set from project or local settings |
CLAUDE_CODE_OAUTH_SCOPES | Space-separated scopes the refresh token was issued with; required alongside CLAUDE_CODE_OAUTH_REFRESH_TOKEN |
ANTHROPIC_PROFILE | The Anthropic profile to authenticate with, such as one made by ant auth login |
ANTHROPIC_ORGANIZATION_ID | Organization for Workload Identity Federation, set together with ANTHROPIC_FEDERATION_RULE_ID |
ANTHROPIC_WORKSPACE_ID | Workspace for that federation exchange, when the rule covers more than one |
CLAUDE_CODE_API_KEY_HELPER_TTL_MS | How often the credentials produced by an apiKeyHelper are refreshed |
ANTHROPIC_CUSTOM_HEADERS | Extra request headers in Name: Value form, newline-separated; needs v2.1.227 or later |
Choosing the model
Two questions live here: which model a session starts on, and what an alias such as opus means on a gateway that does not use Anthropic's own model IDs.
| Variable | What it does |
|---|---|
ANTHROPIC_MODEL | The model to use. It is read before the model setting, which applies only while the variable is unset |
ANTHROPIC_DEFAULT_MODEL | The model new sessions start on; needs v2.1.236 or later |
ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_HAIKU_MODEL, ANTHROPIC_DEFAULT_FABLE_MODEL | The model ID each alias resolves to. The Opus and Sonnet pair is also what opusplan uses in and out of Plan Mode, and the Haiku one is used for background work |
ANTHROPIC_CUSTOM_MODEL_OPTION and its _NAME, _DESCRIPTION, _SUPPORTED_CAPABILITIES partners | Adds one extra entry to the /model picker, so a gateway model can be chosen without replacing a built-in alias |
CLAUDE_CODE_EFFORT_LEVEL | Sets the effort level, and beats --effort, /effort and both effort settings |
MAX_THINKING_TOKENS | A fixed extended-thinking budget, capped one token below the request's output limit and never below 1,024 |
CLAUDE_CODE_MAX_CONTEXT_TOKENS | Overrides the context window Claude Code assumes for the active model |
CLAUDE_CODE_DISABLE_1M_CONTEXT | Removes [1m] variants from the picker and holds models that default to the longer window at 200K |
The aliases are what matters on a gateway. An alias resolves to the model ID in its ANTHROPIC_DEFAULT_*_MODEL variable, so pointing Claude Code at a gateway means setting those to the IDs it serves. The provider setup guide covers the rest of that path.
Sending requests somewhere else
Five variables pick a provider, and one moves the endpoint without changing who authenticates.
| Variable | What it does |
|---|---|
ANTHROPIC_BASE_URL | Points requests at a proxy or gateway instead of Anthropic |
CLAUDE_CODE_USE_BEDROCK, …_USE_VERTEX, …_USE_FOUNDRY, …_USE_MANTLE, …_USE_ANTHROPIC_AWS | Selects Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry, the Bedrock Mantle endpoint, or Claude Platform on AWS |
ANTHROPIC_BEDROCK_BASE_URL, ANTHROPIC_VERTEX_BASE_URL, ANTHROPIC_FOUNDRY_BASE_URL, ANTHROPIC_AWS_BASE_URL | Overrides that provider's endpoint, for a custom region or a gateway in front of it |
CLAUDE_CODE_SKIP_BEDROCK_AUTH, …_SKIP_VERTEX_AUTH, …_SKIP_FOUNDRY_AUTH, …_SKIP_MANTLE_AUTH, …_SKIP_ANTHROPIC_AWS_AUTH | Leaves that provider's credentials to something in front of Claude Code, such as a gateway or a proxy that signs requests |
Provider setup is a page of its own. Region, credential and model ID for each provider are in the Bedrock, Vertex and gateway guide, and the local-model route is in the local models guide. This page only lists the switches.
Timeouts, retries and how much comes back
These turn a stall into a readable error, or a truncation into the whole file.
| Variable | Default | What it changes |
|---|---|---|
API_TIMEOUT_MS | 600000 | How long one API attempt has to receive its response headers, not how long a stream may run after that; 0 removes the limit from v2.1.305 |
CLAUDE_CODE_MAX_RETRIES | 10 | Failed request retries, capped at 15 from v2.1.186 unless the retry watchdog is on |
CLAUDE_CODE_RETRY_WATCHDOG | unset | Set to 1 for unattended runs: retries capacity errors indefinitely instead of giving up |
CLAUDE_STREAM_IDLE_TIMEOUT_MS | unset | Before the streaming idle watchdogs close a stalled connection; an explicit value is clamped up to a 5-minute floor and the byte-level watchdog caps it at 30 minutes |
CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS | unset | The deadline for the first byte of a streaming response |
CLAUDE_CODE_MAX_OUTPUT_TOKENS | per model | Maximum output tokens for most requests; a value above the model's own cap is lowered to it |
BASH_DEFAULT_TIMEOUT_MS | 120000 | The default timeout for a foreground shell command |
BASH_MAX_TIMEOUT_MS | 600000 | The largest timeout the model may ask for on a foreground command |
BASH_MAX_OUTPUT_LENGTH | 30000 | Characters of shell output read back into a command's result, up to 150000; a bashOutputMaxChars setting overrides it |
CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS | 25000 | Token limit for a file read |
MAX_MCP_OUTPUT_TOKENS | 25000 | Token limit for one MCP tool response, with a warning past 10,000 |
Two can be overruled from elsewhere, which matters when a change appears to do nothing: a bashOutputMaxChars setting overrides BASH_MAX_OUTPUT_LENGTH, and CLAUDE_CODE_RETRY_WATCHDOG raises the retry default and removes the cap for work nobody is watching.
Context, compaction and thinking
| Variable | What it does |
|---|---|
CLAUDE_CODE_AUTO_COMPACT_WINDOW | Sets how full the context gets before compaction, between 100000 and 1000000 tokens; a form such as 200k needs v2.1.304 |
CLAUDE_AUTOCOMPACT_PCT_OVERRIDE | The percentage of that window at which compaction fires; it can bring compaction earlier and can never push it later |
DISABLE_AUTO_COMPACT | Turns off automatic and idle compaction; /compact still works |
DISABLE_COMPACT | Turns off all compaction, the manual command included |
CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS | The context size at which idle compaction applies, 200000 by default and floored at 100000 |
CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING | Turns adaptive reasoning off on Opus 4.6 and Sonnet 4.6 and falls back to the fixed MAX_THINKING_TOKENS budget; later models ignore it |
DISABLE_PROMPT_CACHING | Turns prompt caching off for every model |
ENABLE_PROMPT_CACHING_1H | Asks for a one-hour cache lifetime instead of the default five minutes |
FORCE_PROMPT_CACHING_5M | Forces the five-minute lifetime back, whatever else set the longer one |
Subagents, background work and workflows
The numbers below are Claude Code's own defaults for its own machinery.
| Variable | Default | What it changes |
|---|---|---|
CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS | 20 | How many subagents may run at once before the Agent tool refuses another; it can be lowered or raised, never switched off |
CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH | 3 | How many subagent layers are allowed below the main conversation; 1 turns nesting off |
CLAUDE_CODE_SUBAGENT_MODEL | unset | The model for subagents, teammates and workflow agents that were not given one another way |
CLAUDE_CODE_SUBAGENT_MODEL_FORCE | unset | Set to 1 to impose one model on all of them, over the per-agent choice |
CLAUDE_CODE_MAX_TURNS | unset | Caps agentic turns when no explicit limit is passed; --max-turns wins when both are set |
CLAUDE_CODE_DISABLE_BACKGROUND_TASKS | unset | Removes background running from the shell and subagent tools, and stops Claude Code moving long calls there on its own |
CLAUDE_AUTO_BACKGROUND_TASKS | unset | Set to 1 to move a subagent to the background after about two minutes |
CLAUDE_CODE_WORKER_CHECKIN_SCHEDULE | unset | With auto-backgrounding on, the waits before each reminder to check on a still-running agent |
CLAUDE_CODE_GOAL_CHECKIN_MINUTES | 30 | How long background work may keep a goal waiting before a check-in; 0 turns the check-in off |
CLAUDE_CODE_WORKFLOW_MAX_CONCURRENT_AGENTS | 16 | Agents one workflow run executes at once, from 1 to 256, fewer on a machine with fewer processors |
CLAUDE_CODE_DISABLE_WORKFLOWS | unset | Turns workflows off, the same as the disableWorkflows setting |
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS | unset | Set to 1 to enable agent teams, which are experimental and off by default |
CLAUDE_CODE_ENABLE_TASKS | unset | 0 swaps the Task tools for the older single TodoWrite tool |
MCP servers
| Variable | Default | What it changes |
|---|---|---|
MCP_TIMEOUT | 30000 | How long a server has to start |
MCP_TOOL_TIMEOUT | 100000000 | How long one tool call may run; on an HTTP, SSE or connector server each request also has its own 60-second limit unless this is raised past 60000 |
MCP_CONNECTION_NONBLOCKING | non-blocking | 0 makes startup wait for servers to connect before the first query |
MCP_PROTOCOL_NEGOTIATION | unset | legacy keeps every server on the earlier handshake, auto probes the newer revision where it is supported |
MCP_SERVER_CONNECTION_BATCH_SIZE | 3 | How many local stdio servers connect in parallel at startup |
MCP_OAUTH_CALLBACK_PORT | unset | A fixed port for the OAuth redirect when adding a server with pre-configured credentials |
MCP_CLIENT_SECRET | unset | The client secret for a server that needs pre-configured OAuth credentials |
A per-server timeout in .mcp.json beats MCP_TOOL_TIMEOUT for that server, and a value of at least 1000 there also sets a floor for its idle window.
What the tools may do
| Variable | What it does |
|---|---|
CLAUDE_CODE_DISABLE_WEB_FETCH | Turns off WebFetch; WebSearch stays available |
CLAUDE_CODE_WEBFETCH_DEADLINE_MS | Upper bound on one page download including redirects, 300000 by default, 0 for no limit |
CLAUDE_CODE_WEBFETCH_CACHE_TTL_MS | How long a fetched page stays cached, 900000 by default; read once per launch |
CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION | Cap on WebSearch calls, 200 by default and raisable but never removable |
USE_BUILTIN_RIPGREP | 0 uses the rg installed on the machine instead of the one Claude Code ships |
CLAUDE_CODE_SHELL | Path to the bash or zsh binary the shell tool runs commands in; anything else is ignored and detection resumes |
CLAUDE_CODE_GIT_BASH_PATH | Windows only: the bash.exe to use when Git Bash is installed but not on PATH |
CLAUDE_CODE_USE_POWERSHELL_TOOL | Controls the PowerShell tool, whose default differs by platform and by how you signed in |
CLAUDE_CODE_SUBPROCESS_ENV_SCRUB | 1 strips credentials from the environments of the subprocesses Claude Code starts, by variable name or by the shape of the value; GitHub tokens, proxy credentials and anything that does not look like a secret stay |
Telemetry, privacy and what leaves the machine
Four of these read as ordinary on/off switches and are not: for CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC, DISABLE_TELEMETRY, DISABLE_ERROR_REPORTING and CLAUDE_CODE_TMUX_TRUECOLOR, Claude Code reads only whether the variable is set, so 0 or false still turns the behaviour on, and the only way back is to unset it or set it empty.
| Variable | What it does |
|---|---|
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC | Stops update checks, telemetry, error reporting, release notes, the pull request badge checks and background plugin commands |
DISABLE_TELEMETRY | Opts out of telemetry; the events carry no code, file paths or commands |
DISABLE_ERROR_REPORTING | Opts out of error reporting |
DO_NOT_TRACK | 1 does what DISABLE_TELEMETRY does, read as an ordinary boolean, so 0 leaves telemetry on |
CLAUDE_CODE_DISABLE_FEATURE_FLAGS | Turns off feature-flag fetching; needs v2.1.319 or later, and on v2.1.124 to v2.1.318 the older DISABLE_GROWTHBOOK name is the only one read |
CLAUDE_CODE_ENABLE_TELEMETRY | Opens OpenTelemetry collection, the step before any exporter is configured |
CLAUDE_CODE_SUBPROCESS_ENV_SCRUB | With 1, credentials are stripped from the environment of the subprocesses Claude Code starts, so a prompt injection has less to read; it is one layer rather than a boundary, because GitHub tokens and proxy credentials are left in place on purpose |
Turning feature flags off has the widest reach, and it is the one people set without noticing. Any of CLAUDE_CODE_DISABLE_FEATURE_FLAGS, DISABLE_TELEMETRY, DO_NOT_TRACK or CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC stops the fetch, and with it go Remote Control, messaging sessions on other machines, claude import, /skill-doctor and the other features in that list.
Sessions on a third-party provider skip the fetch too unless the embedding platform says otherwise.
Files, logs, plugins and updates
| Variable | What it does |
|---|---|
CLAUDE_CONFIG_DIR | Moves the configuration directory from ~/.claude, carrying settings, history and plugins with it; cannot be set from project or local settings |
CLAUDE_CODE_TMPDIR | Moves the temp directory internal files are written under |
CLAUDE_CODE_DEBUG_LOGS_DIR | A file path for the debug log, not a directory, and it logs nothing on its own: debug mode must be on separately |
CLAUDE_CODE_PLUGIN_DIRS | Extra plugin directories for this session, separated by : on Unix and ; on Windows, each an absolute path |
CLAUDE_CODE_PLUGIN_CACHE_DIR | The parent directory for marketplaces and the plugin cache, ~/.claude/plugins by default |
DISABLE_AUTOUPDATER | Stops the background update; claude update still works |
DISABLE_UPDATES | Blocks every update, the manual command included |
CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE | Lets Claude Code run Homebrew's or WinGet's upgrade command in the background when a newer version exists |
CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL | Skips registering the official marketplace, and the skip is permanent once taken |
The terminal
| Variable | What it does |
|---|---|
CLAUDE_CODE_NO_FLICKER | 1 turns on fullscreen rendering, the research preview that keeps memory flat in long conversations |
CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN | 1 returns to the classic renderer, so the conversation stays in the terminal's own scrollback; it beats the variable above |
CLAUDE_CODE_ACCESSIBILITY | 1 keeps the native terminal cursor visible so a screen magnifier can follow it |
CLAUDE_CODE_DISABLE_MOUSE | 1 turns off mouse tracking in fullscreen mode, keeping the terminal's copy-on-select |
CLAUDE_CODE_SCROLL_SPEED | Mouse wheel multiplier in fullscreen mode, up to 20, fractional values allowed |
FORCE_HYPERLINK | 1 turns on clickable terminal links when the terminal supports them but is not detected |
CLAUDE_CODE_DISABLE_TERMINAL_TITLE | Stops the window title following the conversation, which also skips the small request that names the session |
CLAUDE_CODE_TMUX_TRUECOLOR | Allows 24-bit colour inside tmux, which Claude Code otherwise clamps to 256 colours |
NO_COLOR and FORCE_COLOR in a settings file's env block reach only the subprocesses Claude Code starts. For Claude Code's own interface colours, set them in your shell before you launch it.
The CLAUDE_CODE_DISABLE_ family
More than fifty of Anthropic's variables begin this way, and the naming is the whole documentation: each removes a behaviour for that session. These are the ones a team usually sets on purpose.
CLAUDE_CODE_DISABLE_CLAUDE_MDS— loads no CLAUDE.md memory files at all, including auto memoryCLAUDE_CODE_DISABLE_AUTO_MEMORY— stops auto memory being created or loaded;0forces it on insteadCLAUDE_CODE_DISABLE_CRON— stops session-scheduled tasks, including ones already runningCLAUDE_CODE_DISABLE_BUNDLED_SKILLS— removes the skills and workflows shipped with Claude CodeCLAUDE_CODE_DISABLE_FILE_CHECKPOINTING— turns checkpointing off, so/rewindcannot restore file changesCLAUDE_CODE_DISABLE_WEB_FETCH— turns off WebFetch and leaves WebSearch aloneCLAUDE_CODE_DISABLE_FAST_MODE— turns fast mode offCLAUDE_CODE_DISABLE_BACKGROUND_TASKS— removes background running from the shell and subagent toolsCLAUDE_CODE_DISABLE_WORKFLOWS— turns workflows offCLAUDE_CODE_DISABLE_STRUCTURED_OUTPUTS— stops sending the structured-output field and its beta header, for a gateway whose upstream rejects themCLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS— stops sending pre-release beta headers to a gateway
A handful are read only from the environment that launched Claude Code, ignored from every settings file, including the approval-skipping and file-deletion ones. That is deliberate: a checked-out repository should never be able to relax the protections that apply to the account reading it.
Variables that stopped working, and three that only look retired
Older guides, blog posts and scripts still set these, and Anthropic still lists them, but they change nothing. Setting one is harmless and completely silent — the worst combination when you are debugging.
| Variable | Status | Use instead |
|---|---|---|
CLAUDE_CODE_CONNECT_TIMEOUT_MS | No-op since v2.1.186 | API_TIMEOUT_MS, or CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS for the first byte |
CLAUDE_CODE_MAX_SUBAGENTS_PER_SESSION | No-op since v2.1.224 | CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS for the at-once limit |
CLAUDE_SUBAGENT_BG_SHELL_MAX_MS | No-op since v2.1.260 | Nothing replaces it; a background command's own lifetime rules apply |
TASK_MAX_OUTPUT_LENGTH | No-op since v2.1.277, with the tool it sized | Read the background task's output file directly |
CLAUDE_CODE_AUTO_BACKGROUND_WORKER_CHECKIN_SECONDS | Removed in v2.1.283 | CLAUDE_CODE_WORKER_CHECKIN_SCHEDULE |
CLAUDE_CODE_OPUS_4_6_FAST_MODE_OVERRIDE | No-op since v2.1.160 | Nothing; Opus 4.6 no longer supports fast mode |
CLAUDE_CODE_ENABLE_OPUS_4_7_FAST_MODE | Removed in v2.1.142 | Nothing; the default moved on with it |
CLAUDE_CODE_ENABLE_AUTO_MODE | Accepted for compatibility, no effect; auto mode is on by default. It is already on for every provider | Nothing; the requirement it served ended with v2.1.206 |
Three names read as though they belong in that list and do not — a trap in the other direction. ANTHROPIC_SMALL_FAST_MODEL is deprecated rather than dead: Anthropic's own ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION row still treats it as one of the two ways to pin the Haiku-class model on Bedrock.
ENABLE_PROMPT_CACHING_1H_BEDROCK is deprecated in favour of ENABLE_PROMPT_CACHING_1H and still takes effect everywhere except a Claude apps gateway. SLASH_COMMAND_TOOL_CHAR_BUDGET keeps a legacy name and is still read.
Why your variable looked ignored
Almost every report of "the variable does nothing" is one of these five, in the order that costs least to check.
- You exported it after the session started. Shell variables are read at startup, so an export in that terminal never reaches a running session. Launch a new one.
- It is in a project or local settings file and belongs to the protected group. Claude Code drops it; an interactive session shows a startup notice. A
-prun shows nothing, so check/statusrather than the absence of a warning. - The launch environment already set it. When a desktop app or a self-hosted runner builds the environment, its value wins over every settings file, and the debug log names each variable it overrode.
- You edited the wrong file.
claude --debugwrites to~/.claude/debug/<session-id>.txtrather than the terminal, and names what it loaded. The settings.json guide has the proof procedure for which file a session read. - The variable is one of the no-ops above. Nothing errors, because nothing reads it.
One trap deserves its own line: an empty string is not the same as unset for everything.
Claude Code treats an empty value as unset when it selects a provider, which is how you cancel a stray export, but every subprocess it starts still inherits that empty value, and a tool reading a boolean from it may read it as set.
On Windows, and in an IDE terminal
The names are identical on every platform; only the way you set one differs. This window only, in PowerShell:
$env:API_TIMEOUT_MS = "1200000"
claudeEvery window after you open a new terminal, in PowerShell:
[Environment]::SetEnvironmentVariable("API_TIMEOUT_MS", "1200000", "User")In Command Prompt, set NAME=value covers the window and setx NAME "value" covers the machine. The assignment prints nothing when it works, so print the value back in the same shell rather than assuming it took.
Two Windows-specific variables matter even if you set nothing else. CLAUDE_CODE_GIT_BASH_PATH points at bash.exe when Git Bash is installed but not on PATH, and a path given to it that does not exist is ignored with a warning under --debug rather than an exit, and CLAUDE_CODE_USE_POWERSHELL_TOOL decides whether the PowerShell tool runs alongside Git Bash.
In an IDE, a variable in your shell profile may not reach the extension, because the IDE was started by the desktop and inherited that environment instead. Put the value in ~/.claude/settings.json and it reaches the extension, the terminal and anything a background process starts. That is the same rule as everywhere else on this page.
Where Omniscio fits
Omniscio is the desktop app for running several Claude Code sessions in one window, and it touches Claude Code's own settings in exactly one place: the environment it hands a session when it starts one.
That environment copies the app's own, removes a fixed list, and stamps the app's identity on top. Two things on that list surprise people: a key you exported does not reach the session, and everything else you exported does.
The fixed list:
NODE_OPTIONS.- The
ELECTRON_,VITE_,CHROME_,CHROMIUM_andNPM_PACKAGE_prefixes. - The continuous-integration markers, such as
CIandGITHUB_ACTIONS. - The secret tokens
GITHUB_TOKEN,GH_TOKEN,GITLAB_TOKENandNPM_TOKEN. CLAUDECODE, the marker Anthropic documents as set in the subprocesses Claude Code spawns — stripped by the app, whose code notes that a session refuses to start when it is set.
It also removes the three credential variables — ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN and CLAUDE_CODE_OAUTH_TOKEN — so a key exported in your shell does not reach an Omniscio session; the app supplies the credential itself.
Read the login section above as being about Claude Code on its own: inside the app, which account a session uses is an app setting, not a variable.
Variables that point at the app's own live data directory go too, so a build or a test a session runs cannot write into the app's own database. The app then stamps its session identity on, so a session can call its local control server.
One consequence looks like a bug the first time. If you need one of those removed names inside a session, setting it in your shell will not work, and the app offers no per-session passthrough: the environment a session receives is fixed when it starts.
The features page describes the app and the download page has the installers.
Sources
Every variable name, default and version note on this page comes from Anthropic's own documentation, read in Markdown form on November 10, 2026. The counts are read from the same files.
- Environment variables, the whole variable table, the shell and settings instructions, the precedence rules, the subprocess environment scrub and the feature-flag list. Read November 10, 2026.
- Settings reference, for how an
envvalue interacts with your shell, when Claude Code appliesenvvalues, and the group of variables a project or local settings file cannot set. Read November 10, 2026. - Settings and CLI reference, for where each settings file lives and for the flags that beat a variable. Read November 10, 2026.
- Enterprise network configuration, Gateway compatibility and Model configuration, for the endpoint and provider variables. Read November 10, 2026.
- Tools reference, Subagents and MCP, for the per-tool limits each variable changes. Read November 10, 2026.
The two things here that are ours are the grouping, and the section on variables that no longer do anything, which is a reading of the status column in Anthropic's own table rather than a claim from any other source.
Nothing on this page was measured by running Claude Code with each variable set: the defaults are Anthropic's published ones, and where this page gives a number it is the number their documentation gives.
Common questions
Where do I set a Claude Code environment variable?
In two places that behave differently. An export in your shell reaches only the claude you launch from that shell, and only once, at startup. The env block of a settings.json file reaches every session that file applies to, and a running session picks up a saved change to it. For anything you want to keep, the settings file is the reliable one.
How do I set a Claude Code environment variable on Windows?
In PowerShell set it for the one window with $env:API_TIMEOUT_MS = "1200000" and launch claude from that same window. For every window, run [Environment]::SetEnvironmentVariable with User scope and open a new terminal, or use setx from Command Prompt. There is no separate Windows variable name: Claude Code reads the same names on every platform.
Is there an environment variable for my API key?
Yes, ANTHROPIC_API_KEY. It is sent as the X-Api-Key header and, when set, it is used instead of a Claude subscription even if you are logged in. In a -p run the key is always used when present; interactively you approve it once. To go back to your subscription, unset the variable.
Why is my environment variable being ignored?
Five causes cover almost every case. Claude Code read the shell value at startup, so a later export never reaches a running session. A project or local settings file tried to set a name Claude Code protects, and it was dropped. A launch environment, such as the one a desktop app builds, already set the variable, so every settings file value for it is ignored. The file being edited is not the one being loaded, which claude --debug names. Or the variable is one Anthropic has retired and nothing reads it any more.
How do I turn telemetry off in Claude Code?
Set DISABLE_TELEMETRY to any non-empty value. Be careful with the value: 0 and false do not turn it back on, because for this variable Claude Code reads whether it is set at all, so an empty or unset variable is the only way to re-enable telemetry. DO_NOT_TRACK=1 has the same effect and does read 0 as off. Both also stop feature-flag fetching.
Can I set these variables in a settings file inside my project?
Yes for most of them, and they apply after you trust the workspace. A protected group cannot be set there at all: things that choose where Claude Code writes its files, Windows machine variables, the OpenTelemetry exporter and content variables, the claude.ai sign-in tokens, and the variables that change how Claude Code starts or syncs. Claude Code drops those from project and local settings and names them in the debug log, with one exception: a value that turns telemetry off, such as none for an exporter selector, still applies.
Do environment variables override settings.json, or the other way round?
It depends on the pair you are setting, and each variable's own row says which. For a model name, ANTHROPIC_MODEL is read first and the model setting is used only when the variable is unset. For an env block entry and the same name exported in your shell, the settings file wins in most sessions, because Claude Code writes each entry into the process environment over the inherited value.