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 92 variables. MCP_TIMEOUT and MCP_TOOL_TIMEOUT are common. Switch rows take 1.

Example​

~/.claude/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_MANIFESTSUndocumentedTurns 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_PREFIXDocumentedSkips 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_SYNCUndocumentedStarts 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_SYNCUndocumentedStarts 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_RESCANUndocumentedFolds 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_SURFACEUndocumentedSet 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_SKILLS_PLUGIN_DIRUndocumentedGives 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_SKILLSDocumentedRemoves 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_PROMPTDocumentedKeeps 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_SKILLUndocumentedTurns off the bundled claude-api skill when Claude Code registers its bundled skills.On or offAll sessions
CLAUDE_CODE_DISABLE_CLAUDE_CODE_SKILLUndocumentedTurns off the bundled Claude Code skill when Claude Code registers its bundled skills.On or offAll sessions
CLAUDE_CODE_DISABLE_HOOK_FORWARDINGUndocumentedMarks 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_AUTOINSTALLDocumentedStops 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_HOOKSDocumentedStops 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_FORWARDINGUndocumentedTurns 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_SKILLSDocumentedSkips skills from the system-wide managed skills directory.On or off. The loader skips the policySettings sourceAll sessions
CLAUDE_CODE_DISABLE_WORKFLOWSDocumentedTurns 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_REFRESHDocumentedRefreshes 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_TOOLSUndocumentedAdds 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_NAMEUndocumentedTells 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_THREADUndocumentedRuns 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_SKILL_CATALOGUndocumentedGives the host skill catalog as JSON with a skills list of 1 to 64 folder names. A bad value is ignored 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_PRISMUndocumented GatedTurns on a feature flag path by env. Probe: 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_MAX_MCP_DESCRIPTION_LENGTHDocumentedSets 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 limitAll sessions, MCP. Project env can set it before trust
CLAUDE_CODE_MCP_ALLOWLIST_ENVDocumented DiffersStarts 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 entrypointStdio MCP servers
CLAUDE_CODE_MCP_ALWAYS_LOAD_JOIN_BEFORE_INPUTUndocumentedJoins 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_HOSTUndocumentedDeclares 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_MSDocumented Differs GatedSets 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 flagAll sessions, MCP tool calls
CLAUDE_CODE_MCP_CONNECTOR_PREWAIT_MSUndocumentedSets 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 checkRemote SDK-URL sessions
CLAUDE_CODE_MCP_MEMORY_CGROUPUndocumented GatedTurns 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 offLinux
CLAUDE_CODE_MCP_PREWAIT_SERVERSUndocumentedNames 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_MSUndocumentedSets 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_SERVE_AUTH_TOKENUndocumentedGives the MCP serve mode a bearer value for its auth. Without it the mode uses a stdout reader.Text (a secret). Read from the env once and then removed. Also cleared from child process envMCP serve mode
CLAUDE_CODE_MCP_SERVE_INTERFACE_MIN_VERSIONUndocumentedAsks for a minimum anthropic/toolHostInterface version. A value that differs from the real one is ignored and logged.Text. The log event is launch_min_version_ignoredMCP serve mode
CLAUDE_CODE_MCP_SERVE_SETTINGSUndocumentedGives 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_OUTPUTUndocumentedLets 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_ROOTUndocumentedSets 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_NAMEDocumentedGives the MCP server name to a headersHelper script.Text. Set by Claude Code in the env of the headersHelper processMCP servers with a headersHelper
CLAUDE_CODE_MCP_SERVER_URLDocumentedGives the MCP server URL to a headersHelper script.Text. Set by Claude Code in the env of the headersHelper processMCP servers with a headersHelper
CLAUDE_CODE_MCP_STARTUP_WAIT_MSDocumentedSets 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 waitNon-interactive sessions
CLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUTDocumentedSets the idle timeout of MCP tool calls.A number. Whole number. Defaults 300000 for network servers and 1800000 for stdioMCP tool calls except IDE and SDK servers
CLAUDE_CODE_PLUGIN_ATTRIBUTIONUndocumentedSupplies 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_ASSETSUndocumented GatedTurns 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_DIRDocumentedSets 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_WATCHDocumentedTurns 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_DIRSDocumentedLoads plugin dirs for the session like --plugin-dir. Probe: Loads the plugin dir like --plugin-dir (same plugins list in init). See Probes.Text. Relative paths are skipped with a warning. Claude Code writes the cleaned list back to the varAll sessions
CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MSDocumentedSets 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_FAILUREDocumentedKeeps 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_PREFER_HTTPSDocumentedClones 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_DIRDocumentedNames 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_CACHEUndocumentedTurns 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_NONCEUndocumentedAdds a nonce to the JSON result line of plugin commands.Text. Read once at startup and then removed from the envPlugin commands
CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MSDocumentedOverrides 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_ATTRIBUTIONUndocumentedSupplies a JSON map that attributes skills to plugins or sources. Claude Code looks up each skill in it.JSON text. Bad entries are logged and ignored. Removed from the env of child processesSkill loading, hosts
CLAUDE_CODE_SKILL_PROPOSALSUndocumentedTurns 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_PLUGIN_LOCAL_MCP_SERVERSUndocumentedLoads 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_BUNDLESUndocumentedSkips 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_SERVERSUndocumentedSkips 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 pluginAll plugin loading
CLAUDE_CODE_SKIP_PLUGIN_MCP_SERVERS_EXCEPTUndocumentedLists 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 ignoredAll plugin loading
CLAUDE_CODE_STOP_HOOK_BLOCK_CAPDocumentedSets 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_INSTALLDocumentedMakes 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_MSDocumentedBounds 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_PLUGINSDocumentedTurns 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_DOWNLOADUndocumentedDownloads 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_STALL_MSUndocumentedSets 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_MSUndocumentedSets 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_MSUndocumentedSets 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_MSUndocumentedSets a window in ms in which a recent sync stamp is reused. Details of the stamp were not read.A number of milliseconds. Integer 0 to 86400000. A value of 0 or less turns reuse offPlugin and skills sync
CLAUDE_CODE_SYNC_SESSION_REFSUndocumentedTurns 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_SKILLSDocumentedMakes 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 matchPrint mode -p
CLAUDE_CODE_SYNC_SKILLS_INSTALL_TIMEOUT_MSDocumentedSets 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_MSDocumentedSets 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_USE_COWORK_PLUGINSUndocumentedMakes Claude Code read cowork_settings.json and the cowork_plugins folder in place of settings.json and plugins. A Probes run did not run the hooks of settings.json.On or offCowork hosts
CLAUDE_PLUGIN_DATADocumentedGives a plugin hook command the path of the data directory of that plugin. No visible effect in a print-mode probe (Probes).--
CLAUDE_PLUGIN_ROOTDocumentedGives a plugin hook command the path of the plugin root directory. No visible effect in a print-mode probe (Probes).--
CLAUDE_PROJECT_DIRDocumentedGives each hook command the project directory.A path-
ENABLE_CLAUDEAI_MCP_SERVERSDocumentedStops 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_FILESUndocumentedWhen false, large MCP tool results are truncated and not saved 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_PLUGINSDocumentedKeeps 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_MSDocumentedSets how long blocking MCP startup waits for the connection batch.A number of milliseconds-
MCP_CONNECTION_NONBLOCKINGDocumentedControls whether startup waits for MCP servers before the first query.--
MCP_DISCOVERY_CACHEDocumented GatedTurns the MCP discovery cache on with 1 or off with 0.--
MCP_DISCOVERY_CACHE_MAX_STALE_SDocumentedSets the maximum age of a discovery-cache entry in seconds.--
MCP_DISCOVERY_CACHE_STRIKESDocumentedSets how many failed background refreshes in a row discard a cache entry.--
MCP_DISCOVERY_CACHE_TTL_SDocumentedSets how long a cache entry is used without a background refresh.--
MCP_PROTOCOL_NEGOTIATIONDocumentedChooses whether the v2 MCP client probes servers for the newer protocol revision.--
MCP_REMOTE_SERVER_CONNECTION_BATCH_SIZEDocumentedSets how many remote (HTTP or SSE) MCP servers connect in parallel at startup.A number-
MCP_SDK_GENERATIONDocumentedPins the MCP client runtime to v1 or v2.--
MCP_SERVER_CONNECTION_BATCH_SIZEDocumentedSets how many local (stdio) MCP servers connect in parallel at startup.A number-
MCP_TIMEOUTDocumentedSets the startup connect timeout of one MCP server in milliseconds.--
MCP_TOOL_TIMEOUTDocumentedSets the timeout of an MCP tool call in milliseconds.--
MCP_TRUNCATION_PROMPT_OVERRIDEUndocumentedChooses the prompt for large MCP output saved to a file. Any value except legacy picks the new prompt.--

How It Works​

Plugins and MCP servers start when a session starts, so these variables are read early. Some variables are passed to MCP server and hook processes. Claude Code can strip credentials first when CLAUDE_CODE_SUBPROCESS_ENV_SCRUB is on.

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