Omniscio

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.

Where a variable goes, and which layer wins

The place decides who it reaches.

Where you set itWho it reachesWhen it takes effect
Your shell, before launching claudeThe session you started from that shellAt launch, and never again: a running session does not pick up a later export
The env block of ~/.claude/settings.jsonYou, in every projectAt 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.jsonThe project, or just you in itAfter you trust the workspace, or at startup in a -p run
Managed settings, deployed by an administratorEveryone in the organisationAt startup, and again when a saved change alters the merged values
A launch environment built by a desktop app or a self-hosted runnerThat one sessionImmediately, 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.

VariableWhat it does
ANTHROPIC_API_KEYSent 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_TOKENValue for the Authorization header, prefixed with Bearer for you
CLAUDE_CODE_OAUTH_TOKENA 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_SCOPESSpace-separated scopes the refresh token was issued with; required alongside CLAUDE_CODE_OAUTH_REFRESH_TOKEN
ANTHROPIC_PROFILEThe Anthropic profile to authenticate with, such as one made by ant auth login
ANTHROPIC_ORGANIZATION_IDOrganization for Workload Identity Federation, set together with ANTHROPIC_FEDERATION_RULE_ID
ANTHROPIC_WORKSPACE_IDWorkspace for that federation exchange, when the rule covers more than one
CLAUDE_CODE_API_KEY_HELPER_TTL_MSHow often the credentials produced by an apiKeyHelper are refreshed
ANTHROPIC_CUSTOM_HEADERSExtra 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.

VariableWhat it does
ANTHROPIC_MODELThe model to use. It is read before the model setting, which applies only while the variable is unset
ANTHROPIC_DEFAULT_MODELThe 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_MODELThe 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 partnersAdds one extra entry to the /model picker, so a gateway model can be chosen without replacing a built-in alias
CLAUDE_CODE_EFFORT_LEVELSets the effort level, and beats --effort, /effort and both effort settings
MAX_THINKING_TOKENSA fixed extended-thinking budget, capped one token below the request's output limit and never below 1,024
CLAUDE_CODE_MAX_CONTEXT_TOKENSOverrides the context window Claude Code assumes for the active model
CLAUDE_CODE_DISABLE_1M_CONTEXTRemoves [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.

VariableWhat it does
ANTHROPIC_BASE_URLPoints requests at a proxy or gateway instead of Anthropic
CLAUDE_CODE_USE_BEDROCK, …_USE_VERTEX, …_USE_FOUNDRY, …_USE_MANTLE, …_USE_ANTHROPIC_AWSSelects 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_URLOverrides 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_AUTHLeaves 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.

VariableDefaultWhat it changes
API_TIMEOUT_MS600000How 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_RETRIES10Failed request retries, capped at 15 from v2.1.186 unless the retry watchdog is on
CLAUDE_CODE_RETRY_WATCHDOGunsetSet to 1 for unattended runs: retries capacity errors indefinitely instead of giving up
CLAUDE_STREAM_IDLE_TIMEOUT_MSunsetBefore 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_MSunsetThe deadline for the first byte of a streaming response
CLAUDE_CODE_MAX_OUTPUT_TOKENSper modelMaximum output tokens for most requests; a value above the model's own cap is lowered to it
BASH_DEFAULT_TIMEOUT_MS120000The default timeout for a foreground shell command
BASH_MAX_TIMEOUT_MS600000The largest timeout the model may ask for on a foreground command
BASH_MAX_OUTPUT_LENGTH30000Characters of shell output read back into a command's result, up to 150000; a bashOutputMaxChars setting overrides it
CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS25000Token limit for a file read
MAX_MCP_OUTPUT_TOKENS25000Token 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

VariableWhat it does
CLAUDE_CODE_AUTO_COMPACT_WINDOWSets how full the context gets before compaction, between 100000 and 1000000 tokens; a form such as 200k needs v2.1.304
CLAUDE_AUTOCOMPACT_PCT_OVERRIDEThe percentage of that window at which compaction fires; it can bring compaction earlier and can never push it later
DISABLE_AUTO_COMPACTTurns off automatic and idle compaction; /compact still works
DISABLE_COMPACTTurns off all compaction, the manual command included
CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENSThe context size at which idle compaction applies, 200000 by default and floored at 100000
CLAUDE_CODE_DISABLE_ADAPTIVE_THINKINGTurns 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_CACHINGTurns prompt caching off for every model
ENABLE_PROMPT_CACHING_1HAsks for a one-hour cache lifetime instead of the default five minutes
FORCE_PROMPT_CACHING_5MForces 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.

VariableDefaultWhat it changes
CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS20How 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_DEPTH3How many subagent layers are allowed below the main conversation; 1 turns nesting off
CLAUDE_CODE_SUBAGENT_MODELunsetThe model for subagents, teammates and workflow agents that were not given one another way
CLAUDE_CODE_SUBAGENT_MODEL_FORCEunsetSet to 1 to impose one model on all of them, over the per-agent choice
CLAUDE_CODE_MAX_TURNSunsetCaps agentic turns when no explicit limit is passed; --max-turns wins when both are set
CLAUDE_CODE_DISABLE_BACKGROUND_TASKSunsetRemoves background running from the shell and subagent tools, and stops Claude Code moving long calls there on its own
CLAUDE_AUTO_BACKGROUND_TASKSunsetSet to 1 to move a subagent to the background after about two minutes
CLAUDE_CODE_WORKER_CHECKIN_SCHEDULEunsetWith auto-backgrounding on, the waits before each reminder to check on a still-running agent
CLAUDE_CODE_GOAL_CHECKIN_MINUTES30How long background work may keep a goal waiting before a check-in; 0 turns the check-in off
CLAUDE_CODE_WORKFLOW_MAX_CONCURRENT_AGENTS16Agents one workflow run executes at once, from 1 to 256, fewer on a machine with fewer processors
CLAUDE_CODE_DISABLE_WORKFLOWSunsetTurns workflows off, the same as the disableWorkflows setting
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMSunsetSet to 1 to enable agent teams, which are experimental and off by default
CLAUDE_CODE_ENABLE_TASKSunset0 swaps the Task tools for the older single TodoWrite tool

MCP servers

VariableDefaultWhat it changes
MCP_TIMEOUT30000How long a server has to start
MCP_TOOL_TIMEOUT100000000How 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_NONBLOCKINGnon-blocking0 makes startup wait for servers to connect before the first query
MCP_PROTOCOL_NEGOTIATIONunsetlegacy keeps every server on the earlier handshake, auto probes the newer revision where it is supported
MCP_SERVER_CONNECTION_BATCH_SIZE3How many local stdio servers connect in parallel at startup
MCP_OAUTH_CALLBACK_PORTunsetA fixed port for the OAuth redirect when adding a server with pre-configured credentials
MCP_CLIENT_SECRETunsetThe 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

VariableWhat it does
CLAUDE_CODE_DISABLE_WEB_FETCHTurns off WebFetch; WebSearch stays available
CLAUDE_CODE_WEBFETCH_DEADLINE_MSUpper bound on one page download including redirects, 300000 by default, 0 for no limit
CLAUDE_CODE_WEBFETCH_CACHE_TTL_MSHow long a fetched page stays cached, 900000 by default; read once per launch
CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSIONCap on WebSearch calls, 200 by default and raisable but never removable
USE_BUILTIN_RIPGREP0 uses the rg installed on the machine instead of the one Claude Code ships
CLAUDE_CODE_SHELLPath to the bash or zsh binary the shell tool runs commands in; anything else is ignored and detection resumes
CLAUDE_CODE_GIT_BASH_PATHWindows only: the bash.exe to use when Git Bash is installed but not on PATH
CLAUDE_CODE_USE_POWERSHELL_TOOLControls the PowerShell tool, whose default differs by platform and by how you signed in
CLAUDE_CODE_SUBPROCESS_ENV_SCRUB1 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.

VariableWhat it does
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFICStops update checks, telemetry, error reporting, release notes, the pull request badge checks and background plugin commands
DISABLE_TELEMETRYOpts out of telemetry; the events carry no code, file paths or commands
DISABLE_ERROR_REPORTINGOpts out of error reporting
DO_NOT_TRACK1 does what DISABLE_TELEMETRY does, read as an ordinary boolean, so 0 leaves telemetry on
CLAUDE_CODE_DISABLE_FEATURE_FLAGSTurns 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_TELEMETRYOpens OpenTelemetry collection, the step before any exporter is configured
CLAUDE_CODE_SUBPROCESS_ENV_SCRUBWith 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

VariableWhat it does
CLAUDE_CONFIG_DIRMoves the configuration directory from ~/.claude, carrying settings, history and plugins with it; cannot be set from project or local settings
CLAUDE_CODE_TMPDIRMoves the temp directory internal files are written under
CLAUDE_CODE_DEBUG_LOGS_DIRA 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_DIRSExtra plugin directories for this session, separated by : on Unix and ; on Windows, each an absolute path
CLAUDE_CODE_PLUGIN_CACHE_DIRThe parent directory for marketplaces and the plugin cache, ~/.claude/plugins by default
DISABLE_AUTOUPDATERStops the background update; claude update still works
DISABLE_UPDATESBlocks every update, the manual command included
CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATELets Claude Code run Homebrew's or WinGet's upgrade command in the background when a newer version exists
CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALLSkips registering the official marketplace, and the skip is permanent once taken

The terminal

VariableWhat it does
CLAUDE_CODE_NO_FLICKER1 turns on fullscreen rendering, the research preview that keeps memory flat in long conversations
CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN1 returns to the classic renderer, so the conversation stays in the terminal's own scrollback; it beats the variable above
CLAUDE_CODE_ACCESSIBILITY1 keeps the native terminal cursor visible so a screen magnifier can follow it
CLAUDE_CODE_DISABLE_MOUSE1 turns off mouse tracking in fullscreen mode, keeping the terminal's copy-on-select
CLAUDE_CODE_SCROLL_SPEEDMouse wheel multiplier in fullscreen mode, up to 20, fractional values allowed
FORCE_HYPERLINK1 turns on clickable terminal links when the terminal supports them but is not detected
CLAUDE_CODE_DISABLE_TERMINAL_TITLEStops the window title following the conversation, which also skips the small request that names the session
CLAUDE_CODE_TMUX_TRUECOLORAllows 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 memory
  • CLAUDE_CODE_DISABLE_AUTO_MEMORY — stops auto memory being created or loaded; 0 forces it on instead
  • CLAUDE_CODE_DISABLE_CRON — stops session-scheduled tasks, including ones already running
  • CLAUDE_CODE_DISABLE_BUNDLED_SKILLS — removes the skills and workflows shipped with Claude Code
  • CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING — turns checkpointing off, so /rewind cannot restore file changes
  • CLAUDE_CODE_DISABLE_WEB_FETCH — turns off WebFetch and leaves WebSearch alone
  • CLAUDE_CODE_DISABLE_FAST_MODE — turns fast mode off
  • CLAUDE_CODE_DISABLE_BACKGROUND_TASKS — removes background running from the shell and subagent tools
  • CLAUDE_CODE_DISABLE_WORKFLOWS — turns workflows off
  • CLAUDE_CODE_DISABLE_STRUCTURED_OUTPUTS — stops sending the structured-output field and its beta header, for a gateway whose upstream rejects them
  • CLAUDE_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.

VariableStatusUse instead
CLAUDE_CODE_CONNECT_TIMEOUT_MSNo-op since v2.1.186API_TIMEOUT_MS, or CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS for the first byte
CLAUDE_CODE_MAX_SUBAGENTS_PER_SESSIONNo-op since v2.1.224CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS for the at-once limit
CLAUDE_SUBAGENT_BG_SHELL_MAX_MSNo-op since v2.1.260Nothing replaces it; a background command's own lifetime rules apply
TASK_MAX_OUTPUT_LENGTHNo-op since v2.1.277, with the tool it sizedRead the background task's output file directly
CLAUDE_CODE_AUTO_BACKGROUND_WORKER_CHECKIN_SECONDSRemoved in v2.1.283CLAUDE_CODE_WORKER_CHECKIN_SCHEDULE
CLAUDE_CODE_OPUS_4_6_FAST_MODE_OVERRIDENo-op since v2.1.160Nothing; Opus 4.6 no longer supports fast mode
CLAUDE_CODE_ENABLE_OPUS_4_7_FAST_MODERemoved in v2.1.142Nothing; the default moved on with it
CLAUDE_CODE_ENABLE_AUTO_MODEAccepted for compatibility, no effect; auto mode is on by default. It is already on for every providerNothing; 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.

  1. 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.
  2. 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 -p run shows nothing, so check /status rather than the absence of a warning.
  3. 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.
  4. You edited the wrong file. claude --debug writes to ~/.claude/debug/<session-id>.txt rather than the terminal, and names what it loaded. The settings.json guide has the proof procedure for which file a session read.
  5. 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"
claude

Every 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_ and NPM_PACKAGE_ prefixes.
  • The continuous-integration markers, such as CI and GITHUB_ACTIONS.
  • The secret tokens GITHUB_TOKEN, GH_TOKEN, GITLAB_TOKEN and NPM_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.

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.