Skip to main content

Plugins and MCP

These variables change how Claude Code loads plugins, runs MCP servers, finds skills, and runs hooks. They set time limits, token limits, cache paths, and marketplace behavior. Use them to tune slow MCP servers or to lock down plugin loading.

This page lists 102 variables. MCP_TIMEOUT and MCP_TOOL_TIMEOUT are common. Switch rows take 1.

Example​

~/.claude/settings.json
{
"$schema": "https://clawdipedia.cc/schemas/claude-code-settings.json",
"env": {
"MCP_TIMEOUT": "30000",
"MCP_TOOL_TIMEOUT": "120000"
}
}

A server gets 30 seconds to start, and a tool call gets two minutes.

Variables​

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

VariableStatusWhat it doesValues and defaultNotes
CLAUDE_AGENT_SDK_DISABLE_MCP_MANIFESTS
Undocumented: Only the program shows this item. It can change without notice.
Turns off the capture of SDK MCP server manifests in the session setup.On or off. The code passes captureSdkMcpManifests as false when the value is setSDK hosts. Not set from project env before trust
CLAUDE_AGENT_SDK_MCP_NO_PREFIX
Documented: An official docs page names this item.
Skips the mcp__<server>__ prefix on tool names from SDK-created MCP servers.On or off. Applies to MCP servers of type sdk and to auto mode toolAliasesSDK use only. Not set from project env before trust
CLAUDE_CODE_CCR_EARLY_PLUGINS_SYNC
Undocumented: Only the program shows this item. It can change without notice.
Starts the first plugin sync early in a cloud session. No visible effect in a print-mode probe (Probes).On or off. Applies only to non-interactive sessionsCloud sessions
CLAUDE_CODE_CCR_EARLY_SKILLS_SYNC
Undocumented: Only the program shows this item. It can change without notice.
Starts the first skills sync early in a cloud session.On or off. Applies only to non-interactive sessionsCloud sessions
CLAUDE_CODE_CCR_FOLD_FIRST_TURN_RESCAN
Undocumented: Only the program shows this item. It can change without notice.
Folds the command rescan into the first turn when plugin startup is still pending. Else it refreshes commands right after the skills sync.On or offCloud sessions
CLAUDE_CODE_CCR_SURFACE
Undocumented: Only the program shows this item. It can change without notice.
Set to tag to add the claude-tag-plugins default marketplace to plugin download and plugin search requests.Text. Only the value tag has an effectCloud sessions
CLAUDE_CODE_DESKTOP_CONNECTOR_NAMES
Undocumented: Only the program shows this item. It can change without notice.
Gives the names of the desktop connectors to Claude Code, then Claude Code removes it from the environment. New in 2.1.310.TextDesktop app
CLAUDE_CODE_DESKTOP_SKILLS_PLUGIN_DIR
Undocumented: Only the program shows this item. It can change without notice.
Gives the desktop skills plugin folder to Claude Code, then Claude Code removes it from the environment. A Probes run saw no effect.TextDesktop app
CLAUDE_CODE_DISABLE_BUNDLED_SKILLS
Documented: An official docs page names this item.
Removes bundled skills and workflows. Same effect as the disableBundledSkills setting.On or off. Messages name both the setting and the variableAll sessions. Project env can set it before trust
CLAUDE_CODE_DISABLE_CFC_PROMPT
Documented: An official docs page names this item.
Keeps the Chrome tools but empties the Chrome system prompt section and disables the /claude-in-chrome skill.On or offClaude in Chrome
CLAUDE_CODE_DISABLE_CLAUDE_API_SKILL
Undocumented: Only the program shows this item. It can change without notice.
Turns off the bundled claude-api skill when Claude Code registers its bundled skills.On or offAll sessions
CLAUDE_CODE_DISABLE_CLAUDE_CODE_SKILL
Undocumented: Only the program shows this item. It can change without notice.
Turns off the bundled Claude Code skill when Claude Code registers its bundled skills.On or offAll sessions
CLAUDE_CODE_DISABLE_HOOK_FORWARDING
Undocumented: Only the program shows this item. It can change without notice.
Marks hook forwarding as disabled in the hook admission check. Also turns off a hook forwarding gate on non-Windows systems. No visible effect in a print-mode probe (Probes).On or off, off by defaultSDK and remote sessions
CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL
Documented: An official docs page names this item.
Stops the automatic registration of the official plugin marketplace.On or off. Read when the install is about to runAll sessions
CLAUDE_CODE_DISABLE_PERMISSION_PROMPT_NOTIFY_HOOKS
Documented: An official docs page names this item.
Stops Notification hooks for unanswered permission requests sent to canUseTool.On or off. The helper returns a no-op when setDesktop and IDE hosts using the SDK
CLAUDE_CODE_DISABLE_PLUGIN_FORWARDING
Undocumented: Only the program shows this item. It can change without notice.
Turns off forwarding of local plugins to cloud sessions. It hides the cloud-plugins command. No visible effect in a print-mode probe (Probes).On or off, off by default. Also passed as disabled to the plugin admission checkCloud and remote sessions
CLAUDE_CODE_DISABLE_POLICY_SKILLS
Documented: An official docs page names this item.
Skips skills from the system-wide managed skills directory.On or off. The loader skips the policySettings sourceAll sessions
CLAUDE_CODE_DISABLE_WORKFLOWS
Documented: An official docs page names this item.
Turns off workflows. Same as the disableWorkflows setting.On or off. An env value is reported as a managed source, not a user settingAll sessions. Project env can set it before trust
CLAUDE_CODE_ENABLE_BACKGROUND_PLUGIN_REFRESH
Documented: An official docs page names this item.
Refreshes plugin state at turn boundaries after a background install finishes. No visible effect in a print-mode probe (Probes).On or off, off by default. Stored as backgroundRefreshEnabled at first messageNon-interactive mode
CLAUDE_CODE_ENABLE_REFRESH_MCP_TOOLS
Undocumented: Only the program shows this item. It can change without notice.
Adds the RefreshMcpTools tool, which re-queries connected MCP servers for their tools.On or off, off by default. Read when the tool list is builtAll sessions
CLAUDE_CODE_HIDE_REPLY_SERVER_NAME
Undocumented: Only the program shows this item. It can change without notice.
Tells the model not to name the app's own reply tool server or its failure, and not to ask the user to reconnect it.On or off. Counts only when the MCP server is the built-in app server. Changes the status text sent to the modelDesktop or host apps with a built-in reply server
CLAUDE_CODE_HOOKS_SAME_THREAD
Undocumented: Only the program shows this item. It can change without notice.
Runs plugin hooks modules on the main thread instead of a worker thread.On or off. Unset uses a worker. The test harness for hooks modules also sets itAll sessions, plugin hooks modules
CLAUDE_CODE_HOST_GUARDS_ARTIFACTS_MCP
Undocumented: Only the program shows this item. It can change without notice.
Lets Claude Code add its Artifacts MCP entry in a desktop host session. Without it, the program skips that entry with the reason desktop_host. Added in 2.1.312.On or off, off by default. A true value is the only one that lifts the skip. Other checks still applyDesktop host sessions
CLAUDE_CODE_HOST_SKILL_CATALOG
Undocumented: Only the program shows this item. It can change without notice.
Gives the host skill catalog as JSON with a skills list of 1 to 64 folder names. Claude Code ignores a bad value with a warning.Text. Read only with CLAUDE_CODE_REMOTE_SESSION_ID and then removed from the envRemote sessions with a host
CLAUDE_CODE_LANTERN_PRISM
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 feature flag path by env. In a probe, it adds the skill-doctor skill to the init event. See Probes.On or off. The name sits next to the claude plugin eval textAll sessions
CLAUDE_CODE_MARKETPLACE_NAME
Undocumented: Only the program shows this item. It can change without notice.
Claude Code sets it in the environment of a marketplace headersHelper command. It holds the name of the marketplace.Text. Claude Code sets it for the helper, only when the name is knownMarketplace headers helper only
CLAUDE_CODE_MARKETPLACE_URL
Undocumented: Only the program shows this item. It can change without notice.
Claude Code sets it in the environment of a marketplace headersHelper command. It holds the URL of the marketplace.Text. Claude Code sets it for the helperMarketplace headers helper only
CLAUDE_CODE_MAX_MCP_DESCRIPTION_LENGTH
Documented: An official docs page names this item.
Sets the longest MCP tool description and server instructions text sent to the model.A number. Whole number min 1, digits only. Replaces the defaults 4096 and the larger tool-search limit. Replaces both defaults (4096 and 16384). Since 2.1.280All sessions, MCP. Project env can set it before trust
CLAUDE_CODE_MCP_ALLOWLIST_ENV
Documented: An official docs page names this item.
Differs: The official docs and the program disagree. The row says how. The official docs and the program disagree. The row says how.
Starts stdio MCP servers with a safe base env plus the server env. Docs omit that the local-agent entrypoint turns it on by default.Text. A true value turns it on, a false value turns it off, unset is on only for the local-agent entrypoint. 1 gives only a safe baseline plus the server envStdio MCP servers
CLAUDE_CODE_MCP_ALWAYS_LOAD_JOIN_BEFORE_INPUT
Undocumented: Only the program shows this item. It can change without notice.
Joins the connection of alwaysLoad MCP servers before the first input, when other checks pass.On or off. Used in the MCP connect planner next to the alwaysLoad fieldMCP startup
CLAUDE_CODE_MCP_APPS_HOST
Undocumented: Only the program shows this item. It can change without notice.
Declares MCP Apps support to MCP servers by adding the io.modelcontextprotocol/ui extension and the text/html MIME type with the mcp-app profile.On or off. Also on the list of vars that force a copy of the envMCP client, host apps
CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS
Documented: An official docs page names this item.
Differs: The official docs and the program disagree. The row says how. The official docs and the program disagree. The row says how.
Gated: Works only behind a flag or a server gate. Works only behind a feature flag or server gate
Sets the time before a running MCP tool call moves to the background. Docs omit the gates below.A number of milliseconds. Whole number, 0 turns it off, capped at a max. Unset follows a feature flag. Default 120000. Since 2.1.212All sessions, MCP tool calls
CLAUDE_CODE_MCP_CONNECTOR_PREWAIT_MS
Undocumented: Only the program shows this item. It can change without notice.
Sets how long the first turn waits for claude.ai connectors, capped at a built-in max.A number of milliseconds. Whole number min 1. Read only for sessions with an SDK URL that are not under the CLAUDE_CODE_ENVIRONMENT_KIND is bridge check. Capped at 2147483647Remote SDK-URL sessions
CLAUDE_CODE_MCP_MEMORY_CGROUP
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 memory cgroup limit for MCP server processes when set to a false value or to none.Text. Otherwise a feature flag set to false also turns it off. Linked to the Linux tool memory cap. Sets the memory cap class of MCP processesLinux
CLAUDE_CODE_MCP_PREWAIT_SERVERS
Undocumented: Only the program shows this item. It can change without notice.
Names MCP servers to wait for at start-up. Servers with no --mcp-config row are listed and not waited for.Text. Read only for sessions with an SDK URL. Works with CLAUDE_CODE_MCP_PREWAIT_SERVERS_MSRemote SDK-URL sessions
CLAUDE_CODE_MCP_PREWAIT_SERVERS_MS
Undocumented: Only the program shows this item. It can change without notice.
Sets how long to wait for the servers in CLAUDE_CODE_MCP_PREWAIT_SERVERS.A number of milliseconds. Whole number min 0, digits only. Read only for sessions with an SDK URLRemote SDK-URL sessions
CLAUDE_CODE_MCP_REGISTRY_FETCH_AT_STARTUP
Undocumented: Only the program shows this item. It can change without notice.
Fetches the list of official MCP registry URLs at startup. Without it, some cloud sessions wait for the first https:// MCP server URL check. Added in 2.1.311.On or off, off by default. The wait applies in a tool container daemon, a ccs tenant, or a hosted worker session. Elsewhere the list is fetched at onceCloud sessions
CLAUDE_CODE_MCP_SERVE_AUTH_TOKEN
Undocumented: Only the program shows this item. It can change without notice.
Gives the MCP serve mode a bearer value for its auth. Without it the mode uses a stdout reader.Text (a secret). Claude Code reads it from the env once and then removes it. It also clears it from the child process envMCP serve mode
CLAUDE_CODE_MCP_SERVE_INTERFACE_MIN_VERSION
Undocumented: Only the program shows this item. It can change without notice.
Asks for a minimum anthropic/toolHostInterface version. Claude Code ignores and logs a value that differs from the real one.Text. The log event is launch_min_version_ignoredMCP serve mode
CLAUDE_CODE_MCP_SERVE_SETTINGS
Undocumented: Only the program shows this item. It can change without notice.
Gives launch settings as JSON with permissions.allow and permissions.deny rules. Without readable settings the server runs nothing.Text. Also on the list of vars that force a copy of the envMCP serve mode
CLAUDE_CODE_MCP_SERVE_TOOL_OUTPUT
Undocumented: Only the program shows this item. It can change without notice.
Lets the MCP serve mode return tool output objects. Needs launch rules from CLAUDE_CODE_MCP_SERVE_SETTINGS.On or off. Boolean, true only as true. Otherwise the server refuses calls that ask for an output objectMCP serve mode
CLAUDE_CODE_MCP_SERVE_WORKSPACE_ROOT
Undocumented: Only the program shows this item. It can change without notice.
Sets the workspace root of the MCP serve mode. It must be an absolute path of at most 4096 characters.Text. A bad path gives the fault bad_pathMCP serve mode
CLAUDE_CODE_MCP_SERVER_NAME
Documented: An official docs page names this item.
Gives the MCP server name to a headersHelper script.Text. Claude Code sets it in the env of the headersHelper processMCP servers with a headersHelper
CLAUDE_CODE_MCP_SERVER_URL
Documented: An official docs page names this item.
Gives the MCP server URL to a headersHelper script.Text. Claude Code sets it in the env of the headersHelper processMCP servers with a headersHelper
CLAUDE_CODE_MCP_STARTUP_WAIT_MS
Documented: An official docs page names this item.
Sets how long the first turn of a non-interactive session waits for MCP servers that still connect.A number of milliseconds. Whole number min 0, capped at a built-in max. 0 skips the wait. Since 2.1.274Non-interactive sessions
CLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUT
Documented: An official docs page names this item.
Sets the idle timeout of MCP tool calls.A number. Whole number. Defaults 300000 for network servers and 1800000 for stdio. 0 turns it offMCP tool calls except IDE and SDK servers
CLAUDE_CODE_PLUGIN_ARCHIVE_URL
Undocumented: Only the program shows this item. It can change without notice.
Claude Code sets it in the environment of a plugin headersHelper command. It holds the archive URL of the plugin.Text. Claude Code sets it for the helperPlugin headers helper only
CLAUDE_CODE_PLUGIN_ATTRIBUTION
Undocumented: Only the program shows this item. It can change without notice.
Supplies attribution data per plugin ID, such as the marketplace name. It wins over the normal lookup. A Probes run saw no effect.Text. Bad fields log a warning. Claude Code removes it from the env of shell subprocessesAll sessions
CLAUDE_CODE_PLUGIN_BINARY_ASSETS
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 fetching of binary plugin assets from a marketplace. It is also on when a feature flag is true. No visible effect in a print-mode probe (Probes).On or off. Failures raise a PluginAssetFetchError. Assets are cached under the plugin asset cache dirPlugins from some marketplaces
CLAUDE_CODE_PLUGIN_CACHE_DIR
Documented: An official docs page names this item.
Sets the plugins root dir. No visible effect in a print-mode probe (Probes).Text. Default is plugins under the config dir (cowork_plugins in cowork mode). Also the base dir of the zip cacheAll sessions
CLAUDE_CODE_PLUGIN_DIR_WATCH
Documented: An official docs page names this item.
Turns on reload of plugins loaded with --plugin-dir when files change. No visible effect in a print-mode probe (Probes).On, off, or unset. Default is on in interactive sessions and off in non-interactive ones. 0 turns it off everywhereAll sessions
CLAUDE_CODE_PLUGIN_DIRS
Documented: An official docs page names this item.
Loads plugin dirs for the session like --plugin-dir. In a probe, it loads the plugin dir like --plugin-dir (same plugins list in init). See Probes.Text. Claude Code skips relative paths with a warning. Claude Code writes the cleaned list back to the varAll sessions
CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS
Documented: An official docs page names this item.
Sets the timeout for a plugin marketplace git clone or refresh. No visible effect in a print-mode probe (Probes).A number of milliseconds, 120000 by default. Whole number in ms above 0. The timeout error text names this varAll sessions
CLAUDE_CODE_PLUGIN_KEEP_MARKETPLACE_ON_FAILURE
Documented: An official docs page names this item.
Keeps the existing marketplace clone when the remote is unreachable at refresh. No visible effect in a print-mode probe (Probes).On or off. Logs a warning and returns a kept-stale result instead of re-cloningAll sessions
CLAUDE_CODE_PLUGIN_NAME
Undocumented: Only the program shows this item. It can change without notice.
Claude Code sets it in the environment of a plugin headersHelper command. It holds the name of the plugin.Text. Claude Code sets it for the helperPlugin headers helper only
CLAUDE_CODE_PLUGIN_PREFER_HTTPS
Documented: An official docs page names this item.
Clones GitHub shorthand sources over HTTPS and not SSH. No visible effect in a print-mode probe (Probes).On or off. The same check is also true when CLAUDE_CODE_REMOTE is set, which the docs do not sayAll sessions
CLAUDE_CODE_PLUGIN_SEED_DIR
Documented: An official docs page names this item.
Names read-only plugin seed dirs for containers. No visible effect in a print-mode probe (Probes).Text. Each path is normalizedAll sessions
CLAUDE_CODE_PLUGIN_USE_ZIP_CACHE
Undocumented: Only the program shows this item. It can change without notice.
Turns on the plugin zip cache. It needs CLAUDE_CODE_PLUGIN_CACHE_DIR. A Probes run saw no effect.On or off. Without the cache dir the zip cache code throws Plugin zip cache is not enabledAll sessions
CLAUDE_CODE_RESULT_NONCE
Undocumented: Only the program shows this item. It can change without notice.
Adds a nonce to the JSON result line of plugin commands.Text. Claude Code reads it once at startup and then removes it from the envPlugin commands
CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS
Documented: An official docs page names this item.
Overrides the time budget in ms for SessionEnd hooks. Without it the budget is 1.5 s, raised to the highest hook timeout up to 60 s.A number of milliseconds. Integer 1 or more. Org-defined hooks read it through a managed-source pathSession exit, /clear, /resume
CLAUDE_CODE_SKILL_ATTRIBUTION
Undocumented: Only the program shows this item. It can change without notice.
Supplies a JSON map that attributes skills to plugins or sources. Claude Code looks up each skill in it.JSON text. Claude Code logs and ignores bad entries. It removes the variable from the env of child processesSkill loading, hosts
CLAUDE_CODE_SKILL_PROPOSALS
Undocumented: Only the program shows this item. It can change without notice.
Turns on the skill proposals tool and its prompt text, which let the model propose skills for the user to save.On or off. Needs CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPE to be set and skill sync to be offRemote environments
CLAUDE_CODE_SKIP_MCP_DEBUG_LOG_FILES
Undocumented: Only the program shows this item. It can change without notice.
Stops MCP server debug messages from going to the per-server debug log files in an Anthropic-hosted cloud session. They still go to the debug log. Added in 2.1.311.On or off, off by default. Applies when CLAUDE_CODE_REMOTE is true and CLAUDE_CODE_ENVIRONMENT_KIND is unsetAnthropic-hosted cloud sessions
CLAUDE_CODE_SKIP_PLUGIN_LOCAL_MCP_SERVERS
Undocumented: Only the program shows this item. It can change without notice.
Loads only sse, http, and ws MCP servers from plugins, so local servers are skipped. The program logs "only sse, http and ws servers load while CLAUDE_CODE_SKIP_PLUGIN_LOCAL_MCP_SERVERS is set".On or offAll plugin loading
CLAUDE_CODE_SKIP_PLUGIN_MCP_BUNDLES
Undocumented: Only the program shows this item. It can change without notice.
Skips MCPB bundle sources of plugins. The program logs Skipping MCPB source and names this variable or CLAUDE_CODE_SKIP_PLUGIN_LOCAL_MCP_SERVERS.On or offAll plugin loading
CLAUDE_CODE_SKIP_PLUGIN_MCP_SERVERS
Undocumented: Only the program shows this item. It can change without notice.
Skips MCP server discovery for plugins, except for plugins in the _EXCEPT list. A Probes run saw an empty mcp_servers list.On or off. The skip is logged per plugin. The log says (CLAUDE_CODE_SKIP_PLUGIN_MCP_SERVERS is set)All plugin loading
CLAUDE_CODE_SKIP_PLUGIN_MCP_SERVERS_EXCEPT
Undocumented: Only the program shows this item. It can change without notice.
Lists plugins that keep their MCP servers when CLAUDE_CODE_SKIP_PLUGIN_MCP_SERVERS is set. No visible effect in a print-mode probe (Probes).A comma-separated list. Empty items are ignored. The log says exempted viaAll plugin loading
CLAUDE_CODE_STOP_HOOK_BLOCK_CAP
Documented: An official docs page names this item.
Sets how many times in a row a Stop or SubagentStop hook may block the turn end before Claude Code ends the turn anyway.A number, 8 by default. Integer, default 8. 0 turns the cap offStop and SubagentStop hooks
CLAUDE_CODE_SYNC_PLUGIN_INSTALL
Documented: An official docs page names this item.
Makes a non-interactive run wait for plugin install before the first query. A Probes run saw plugin_install events in stream-json.On or off. Takes effect only in a mode with a storage backend. Pair with the timeout variablePrint mode -p
CLAUDE_CODE_SYNC_PLUGIN_INSTALL_TIMEOUT_MS
Documented: An official docs page names this item.
Bounds the wait for synchronous plugin install. After the limit Claude Code goes on without plugins and logs an error. No visible effect in a print-mode probe (Probes).A number of milliseconds. Integer 1 or more. Default is 0, which means no limitPrint mode -p
CLAUDE_CODE_SYNC_PLUGINS
Documented: An official docs page names this item.
Turns on the sync of the account plugin list from the Claude server. The sync downloads plugins before use. No visible effect in a print-mode probe (Probes).On or off. It also turns on the sync gates for session refsRemote and account plugin sync
CLAUDE_CODE_SYNC_PLUGINS_BUFFERED_DOWNLOAD
Undocumented: Only the program shows this item. It can change without notice.
Downloads synced plugins as one buffered request. Without it the download uses a stream with a stall guard. No visible effect in a print-mode probe (Probes).On or offPlugin sync
CLAUDE_CODE_SYNC_PLUGINS_DOWNLOAD_CONCURRENCY
Undocumented: Only the program shows this item. It can change without notice.
Sets how many synced plugins download at the same time.A number, 6 by default. Since 2.1.309Plugin sync
CLAUDE_CODE_SYNC_PLUGINS_DOWNLOAD_STALL_MS
Undocumented: Only the program shows this item. It can change without notice.
Sets how long a plugin download stream may get no data before it is cut. The error says the stream stalled. No visible effect in a print-mode probe (Probes).A number of milliseconds, 60000 by default. Integer 1 or more, default 60000 msPlugin sync
CLAUDE_CODE_SYNC_PLUGINS_INSTALL_TIMEOUT_MS
Undocumented: Only the program shows this item. It can change without notice.
Sets the time limit in ms for the install step of the plugin sync. No visible effect in a print-mode probe (Probes).A number of milliseconds, 30000 by default. Integer 1 or more, default 30000Plugin sync
CLAUDE_CODE_SYNC_PLUGINS_MCP_TIMEOUT_MS
Undocumented: Only the program shows this item. It can change without notice.
Sets the time limit in ms for the MCP step of the plugin sync. No visible effect in a print-mode probe (Probes).A number of milliseconds, 10000 by default. Integer 0 or more, default 10000Plugin sync
CLAUDE_CODE_SYNC_REUSE_WITHIN_MS
Undocumented: Only the program shows this item. It can change without notice.
Sets a window in ms in which the plugin and skills sync can skip a round. The program keeps a stamp file .last-complete-round that holds a token and the list of sync kinds it covers. A round writes it. A startup sync reuses the last round when the file is younger than this window.A number of milliseconds. Integer 0 to 86400000. A value of 0 or less turns reuse offPlugin and skills sync
CLAUDE_CODE_SYNC_SESSION_REFS
Undocumented: Only the program shows this item. It can change without notice.
Turns on sync of the plugins and skills that a remote session lists. It needs a CCR session ID.On or off. Counts as a switch for both plugin sync and skills syncRemote sessions
CLAUDE_CODE_SYNC_SKILLS
Documented: An official docs page names this item.
Makes a -p run download the skills enabled for your claude.ai account and wait for the list before the first query.On or off. Needs claude.ai auth. Docs match. Since 2.1.311, with feature-flag fetching off, a session reuses a claude.ai skills list that another session on the machine fetched, when the list is up to 10 minutes oldPrint mode -p
CLAUDE_CODE_SYNC_SKILLS_INSTALL_TIMEOUT_MS
Documented: An official docs page names this item.
Sets the timeout in ms for the mid-session skills resync when an SDK app reloads skills. Late skills finish in the background.A number of milliseconds, 30000 by default. Integer. A value of 0 or less uses the default 30000Agent SDK apps
CLAUDE_CODE_SYNC_SKILLS_WAIT_TIMEOUT_MS
Documented: An official docs page names this item.
Sets how long the first query waits for the first skill list when CLAUDE_CODE_SYNC_SKILLS is set.A number of milliseconds, 5000 by default. Integer. A value of 0 or less uses the default 5000 msPrint mode -p
CLAUDE_CODE_TERMINAL_MCP_TOOLS
Undocumented: Only the program shows this item. It can change without notice.
Lists MCP tool names. A turn that ends with these tool results is checked.Text. Comma-separated-
CLAUDE_CODE_USE_COWORK_PLUGINS
Undocumented: Only the program shows this item. It can change without notice.
Makes Claude Code read and write cowork_settings.json in place of the user settings.json (hooks, env, enabledPlugins, and marketplaces too). It also makes Claude Code keep plugins in the cowork_plugins folder in place of plugins. Project env cannot set it.On or offCowork hosts
CLAUDE_PLUGIN_DATA
Documented: An official docs page names this item.
Gives a plugin hook command the path of the data directory of that plugin. No visible effect in a print-mode probe (Probes).--
CLAUDE_PLUGIN_ROOT
Documented: An official docs page names this item.
Gives a plugin hook command the path of the plugin root directory. No visible effect in a print-mode probe (Probes).--
CLAUDE_PROJECT_DIR
Documented: An official docs page names this item.
Gives each hook command the project directory.A path. Also set in a stdio MCP server env-
ENABLE_CLAUDEAI_MCP_SERVERS
Documented: An official docs page names this item.
Stops the fetch of claude.ai MCP servers when set to false.On, off, or unset. false/0/no/off disables and logs "Disabled via env var"Logged-in users. Not set from project env before trust
ENABLE_MCP_LARGE_OUTPUT_FILES
Undocumented: Only the program shows this item. It can change without notice.
When false, Claude Code truncates large MCP tool results and does not save them to a file.On, off, or unset. Only false is checked. The event reason is env_disabledMCP tool results. Not set from project env before trust
FORCE_AUTOUPDATE_PLUGINS
Documented: An official docs page names this item.
Keeps plugin auto-update on when the main auto-updater is off. No visible effect in a print-mode probe (Probes).On or off. Checked first in the plugin auto-update skip checkAll sessions. Not set from project env before trust
MCP_CONNECT_TIMEOUT_MS
Documented: An official docs page names this item.
Sets how long blocking MCP startup waits for the connection batch.A number of milliseconds. Default 5000. Applies with MCP_CONNECTION_NONBLOCKING=0 or alwaysLoad-
MCP_CONNECTION_NONBLOCKING
Documented: An official docs page names this item.
Controls whether startup waits for MCP servers before the first query.Startup does not wait by default. 0 waits for servers before the first query. alwaysLoad servers still wait-
MCP_DISCOVERY_CACHE
Documented: An official docs page names this item.
Gated: Works only behind a flag or a server gate. Off by default unless a rollout enables it
Turns the MCP discovery cache on with 1 or off with 0.1 on, 0 off. Off by default unless a rollout enables it-
MCP_DISCOVERY_CACHE_MAX_STALE_S
Documented: An official docs page names this item.
Sets the maximum age of a discovery-cache entry in seconds.Default 14400, capped at 7 days-
MCP_DISCOVERY_CACHE_STRIKES
Documented: An official docs page names this item.
Sets how many failed background refreshes in a row discard a cache entry.Default 1-
MCP_DISCOVERY_CACHE_TTL_S
Documented: An official docs page names this item.
Sets how long a cache entry is used without a background refresh.Default 900-
MCP_PROTOCOL_NEGOTIATION
Documented: An official docs page names this item.
Chooses whether the v2 MCP client probes servers for the newer protocol revision.auto or legacy. Probes for revision 2026-07-28. v2 runtime only-
MCP_REMOTE_SERVER_CONNECTION_BATCH_SIZE
Documented: An official docs page names this item.
Sets how many remote (HTTP or SSE) MCP servers connect in parallel at startup.A number. Default 20-
MCP_SDK_GENERATION
Documented: An official docs page names this item.
Pins the MCP client runtime to v1 or v2.v1 or v2. Read once per process. Since 2.1.218-
MCP_SERVER_CONNECTION_BATCH_SIZE
Documented: An official docs page names this item.
Sets how many local (stdio) MCP servers connect in parallel at startup.A number. Default 3-
MCP_TIMEOUT
Documented: An official docs page names this item.
Sets the startup connect timeout of one MCP server in milliseconds.Default 30000-
MCP_TOOL_TIMEOUT
Documented: An official docs page names this item.
Sets the timeout of an MCP tool call in milliseconds.Default 100000000 (about 28 hours). Values below 1000 become 1 s. The per-server timeout wins. Remote servers also have a 60 s per-request timer-
MCP_TRUNCATION_PROMPT_OVERRIDE
Undocumented: Only the program shows this item. It can change without notice.
Chooses the prompt for large MCP output saved to a file. Any value except legacy picks the new prompt.legacy selects the old prompt. Not set follows a flag-

How It Works​

Plugins and MCP servers start when a session starts. Claude Code reads these variables early. Claude Code passes some variables to MCP server and hook processes. It can strip credentials first when CLAUDE_CODE_SUBPROCESS_ENV_SCRUB is on.

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