Plugin Loading
The loader finds plugins, copies them into a cache, and turns their parts on.
This page lists the paths, the variables a plugin can use, and the env vars and settings that change loading.
For example, ${CLAUDE_PLUGIN_ROOT} in a hook command is the folder of the plugin.
Loading runs by itself at session start. Env vars and settings change the paths, timeouts, and rules. The switches are enabledPlugins, CLAUDE_CODE_PLUGIN_DIRS, and syncClaudeAiPlugins.
Paths
Source: Plugin Loading Reference and the program for the rows marked Undocumented.
| Path | Status | What It Is | How It Works |
|---|---|---|---|
~/. | Documented | The plugins root. | CLAUDE_ sets this parent folder, not the cache itself. |
plugins/ | Documented | The folder behind ${CLAUDE_. | Made on first use. Survives updates. In <id>, every character other than letters, digits, _, and - becomes -. Deleted on the last uninstall unless you use --. |
plugins/ | Undocumented | One copy of each installed version. | A cache path with these three parts is parsed this way. A . version is excluded. |
., ., ., . | Documented | State marker files in a version folder. | . is written only inside the cache root and not on a symlinked version. |
plugins/ | Undocumented | Install records. | Fields: version, installed, last, install, git, resolved, auto (set for a dependency install). |
plugins/ | Undocumented | Marketplace records. | Fields: source, install, last, auto. Clones live in plugins/. |
Registry files installed, marketplaces, flagged, catalog, in | Undocumented | Named files of the plugin registry. | The names come from a list in the program. |
~/. | Documented | Plugins synced from claude.ai. | The id is <name>@synced. Turn off with sync. |
Variables
Source: Plugin Manifest Reference and Plugin Loading Reference.
| Variable | Status | What It Is | Where You Can Use It |
|---|---|---|---|
${CLAUDE_ | Documented | The installed plugin folder. It changes on update, so do not write state there. | Hook command and args, monitor command, MCP stdio command, args, env, MCP remote url, headers, headers, LSP fields, skill and agent text |
${CLAUDE_ | Documented | The data folder. Claude Code exports it to hooks, MCP stdio servers, and LSP servers. | The same places |
${CLAUDE_ | Documented | The project root. Claude Code exports it to hooks and LSP servers. | The same places |
${user_ | Documented | A saved user value. | MCP, LSP, exec-form hook args, skill and agent text. Not in shell-form hooks, monitor commands, or headers. |
CLAUDE_ | Documented | The same value as an env var, with the key in upper case. | Hooks |
These variables are not in the env of commands the Bash tool runs for Claude. In a skill, write the reference as Markdown text instead.
Claude Code saves non-sensitive values in pluginConfigs of user settings.
Sensitive values go to the credential store.
Env Vars
Source: Environment Variables and the program. See also Plugin and MCP Env Vars.
| Env Var | Status | What It Does | How It Works |
|---|---|---|---|
CLAUDE_ | Documented | Gives plugin folders for the session. | Like --. Separate paths with a colon on Unix and a semicolon on Windows. |
CLAUDE_ | Documented | Sets the git timeout. | Default 120000. |
CLAUDE_ | Documented | Keeps the old checkout when a refresh fails. | Set to 1. |
CLAUDE_ | Documented | Clones GitHub shorthand over HTTPS. | Set to 1. |
CLAUDE_ | Documented | Gives read-only seed folders. | Registers marketplaces at start and uses the plugins already cached there. |
CLAUDE_ | Documented | Reloads a mod when its file changes. | On by default in interactive sessions and off in non-interactive ones. 0 turns it off everywhere. |
FORCE_ | Documented | Updates plugins even when DISABLE_ is set. | Set to 1. |
CLAUDE_, CLAUDE_ and their _ forms | Documented | Sync claude.ai plugins in headless runs. | The exact effects are not documented. In print mode, CLAUDE_ makes the stream carry plugin_ messages. |
CLAUDE_, CLAUDE_, CLAUDE_, CLAUDE_, CLAUDE_ | Undocumented | Plugin env names found in the program. | Only the names are known. A message in the program mentions "zip cache mode". |
CLAUDE_, CLAUDE_, CLAUDE_, CLAUDE_ | Undocumented | Skip plugin MCP servers, exempt some, skip local servers, or skip MCPB bundles. | See MCP Env Vars. |
Settings Keys
| Key | Status | What It Does | How It Works |
|---|---|---|---|
enabled | Documented | Turns plugins on or off. | "name@marketplace":. Order of layers: user, project, local, flag, policy. To turn off a project plugin for yourself, set false in .. It also holds extended version-constraint forms. |
plugin | Documented | Stores saved options by plugin id. | Holds options and mcp. |
strict | Documented | Limits customization to plugins. | Managed. An array of surfaces such as skills or hooks, or true. |
disable | Documented | Rejects the sideload flags. | Managed. Covers --, --, --, --. |
prepend, append | Differs | Set the hook order of managed plugins. | Managed only, per the schema. Listed ids run outermost or innermost. See Hooks and Plugins Settings. |
allowed, plugin | Documented | Allow channel plugins, and add trust text. | Managed. |
Marketplace keys are on the Marketplaces page.
Example
Seed a locked-down machine so that users need no network for a plugin.
export CLAUDE_CODE_PLUGIN_SEED_DIR=/opt/claude/plugin-seed
export CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS=60000
claude --plugin-dir ./my-plugin
{ "enabledPlugins": { "deploy-tools@team-tools": false } }