What Claude Code plugin userConfig does
Claude Code plugin userConfig is a key in your plugin's manifest, .claude-plugin/plugin.json, that lists the values your plugin needs from the person installing it. Claude Code turns that list into a configuration dialog, stores the answers for them (secrets in secure storage, not in a settings file), and substitutes the values into your MCP servers, hooks and skills. Nobody has to open settings.json, and nobody has to paste a token into a file that might get committed.
Before userConfig, the usual pattern for a plugin that needed an API key was a README line saying export this variable before you start Claude Code. That works for the author and fails for everyone else. The first plugin I hand a teammate that needs a value now declares it in userConfig, because the dialog is the README nobody can skip.
The userConfig field schema
Each key under userConfig is one option. Keys are made of letters, digits and underscores, and cannot start with a digit. Each option is a strict object: an unknown field fails validation and the plugin does not load.
userConfig option fields
| Field | Required | What it does |
|---|---|---|
| type | Yes | One of string, number, boolean, directory or file |
| title | Yes | The label shown in the configuration dialog |
| description | Yes | Help text shown under the field |
| required | No | When true, the dialog will not accept an empty value |
| default | No | Used when the user gives nothing: a string, number, boolean or array of strings |
| options | No | For a string, a fixed list of values shown as a picker in /config. Needs Claude Code v2.1.271 or later |
| multiple | No | For a string, allows an array of strings |
| sensitive | No | When true, masks the input and stores the value in secure storage instead of settings.json |
| min / max | No | Bounds for a number |
A plugin that talks to a team API needs two options: an endpoint and a token. In the manifest that is an api_url option with type string, title API URL and a one-line description, and an api_token option with the same three fields plus sensitive set to true. That is the whole declaration. Claude Code builds the dialog from it.
When the configuration dialog appears
The dialog belongs to the interactive /plugin interface. It opens for any option that is not set yet when the user installs the plugin in /plugin, runs /plugin install <plugin>@<marketplace> inside a session, or enables the plugin from the Installed tab. They can reopen it at any time with /plugin configure <plugin>@<marketplace>.
If you work in the desktop app, you install plugins from the + button next to the prompt box. Whichever surface you installed from, a plugin installed at user scope reads its saved answers from your user settings, so you can check and set them from a terminal with the commands below.
How each install route handles userConfig
| Install route | Does it ask for values? | What to do |
|---|---|---|
| /plugin in a session, or the Discover tab | Yes, the dialog is part of the install | Fill it in |
| The VS Code extension's Manage plugins dialog | Yes, as a form after the install | A gear icon on the plugin's row opens the form again |
| claude plugin install in your shell | Never | Pass --config KEY=VALUE for each option, or set them afterwards |
The shell route is the one that catches people. claude plugin install saves any --config values you pass, and when options are still unset it prints a line saying how many userConfig options are not yet set, with (M required) when some of them are required. If you script plugin installs for a team, check for that line.
- claude plugin configure <plugin>@<marketplace> lists each option as required or optional, sensitive if it is, and set or not set. It never prints saved values. It needs Claude Code v2.1.285 or later and only accepts the full name@marketplace id.
- To save values from a script, put them in a JSON file and run claude plugin configure <plugin>@<marketplace> --values-stdin < values.json. Options you leave out keep their saved values.
- Each value is checked against the option's declared type. On success you see Configuration saved. Restart Claude Code to apply it. If any key is undeclared or any value fails, nothing is saved and the command exits 1.
Where the answers and secrets are stored
Non-sensitive answers go into pluginConfigs in your user settings.json, keyed by plugin ID, with each answer under an options object. For a deployer plugin from an acme-tools marketplace that looks like pluginConfigs, then deployer@acme-tools, then options, then api_url. Claude Code writes it when you fill in the dialog, so you never need to edit it by hand.
Sensitive answers never touch settings.json. Claude Code stores them in the macOS Keychain, falls back to ~/.claude/.credentials.json when the Keychain rejects the write, and uses ~/.claude/.credentials.json on platforms without a supported keychain.
When a plugin is uninstalled from the last scope it was installed at, Claude Code also deletes its stored options and secrets along with its data directory. Removing the marketplace a plugin came from does the same where it can. If you reinstall later, expect the dialog again. For the rest of the settings files and their scopes, see Claude Code settings.json.
How your plugin reads a saved value
There are two ways in, and which one works depends on the component.
Where each userConfig reference works
| Component | How it gets the value | Notes |
|---|---|---|
| MCP server config | ${user_config.KEY} | Substituted in the server's config, such as its env |
| LSP server config | ${user_config.KEY} | Substituted in the server's config |
| Exec-form hook | ${user_config.KEY} in args | Each value becomes one argument, with no shell in between |
| Any hook process | CLAUDE_PLUGIN_OPTION_<KEY> environment variable | Exported for every option, with the key uppercased, so api_token arrives as CLAUDE_PLUGIN_OPTION_API_TOKEN |
| Skill and agent content | ${user_config.KEY} in the Markdown | Only non-sensitive values. A sensitive value becomes a placeholder |
| Monitor command | Not available | Monitor processes do not receive CLAUDE_PLUGIN_OPTION_<KEY> either. The script has to get the value on its own |
The skill row matters more than it looks. Anything substituted into a skill enters Claude's context, which is why sensitive values are replaced with a placeholder there. Put endpoints, project names and preferences into skills. Keep tokens in the MCP server's env or a hook's environment, where Claude never reads them.
If your plugin ships a chat bridge as a channel, each channels entry can carry its own userConfig in the same shape, and those values substitute into ${user_config.KEY} references in the bound MCP server's env.
The shell-safety rule that breaks first attempts
Shell-form hook commands, monitor commands and an MCP server's headersHelper reject ${user_config.*}. A configured value containing $(...), backticks or a semicolon would run as code once a shell re-parsed it, so Claude Code refuses to start the component instead of substituting the value. Before v2.1.207 the value was substituted. Now the check runs on the command template, so you get the error even before anyone has configured a value.
A shell-form hook that breaks the rule fails with a message that starts Hook from plugin <plugin> references ${user_config.*} in a shell-form command. The fix depends on the component:
- Hook: add an args array so it runs in exec form, with each ${user_config.KEY} as its own argument. Or drop the reference and read $CLAUDE_PLUGIN_OPTION_<KEY> inside the script.
- Monitor: drop the reference and have the monitor script read the value from a config file.
- headersHelper: move ${user_config.KEY} into the server's headers field, which is not shell-parsed, or read the value inside the helper script.
My default for any plugin I publish: hooks run in exec form, secrets reach hooks only through CLAUDE_PLUGIN_OPTION_<KEY>, and nothing a user typed into a dialog is ever pasted into a string a shell will parse. That rule is what the error enforces anyway, so building to it from the start saves a round of debugging. More on hook forms in Claude Code hooks.
The CCC userConfig checklist before you publish
- Every value a user would otherwise export or paste is declared in userConfig, with a title and a description that says where to find it.
- Every token, password and key is sensitive: true.
- No sensitive value is referenced in skill or agent content.
- No ${user_config.*} appears in a shell-form hook, a monitor command or a headersHelper. claude plugin validate reports a reference to an option the manifest does not declare, so run it.
- If you use options, you accept that users before v2.1.271 cannot load the plugin.
- Your README tells shell installers to pass --config KEY=VALUE, or to run /plugin configure <plugin>@<marketplace> afterwards.
If you distribute to a team, pair this with a private plugin marketplace and the controls in Claude Code managed plugins, so everyone gets the same plugin and only has to answer the dialog once.
Short, practical drops on skills, MCP, agents, prompts, and more. No spam, unsubscribe anytime.
Frequently asked questions
What is userConfig in a Claude Code plugin?
userConfig is a key in a plugin's .claude-plugin/plugin.json that declares the values the plugin needs from the user, such as an API URL or token. Claude Code shows a configuration dialog for them and stores the answers, so users do not edit settings.json themselves.
Where does Claude Code store plugin settings and secrets?
Non-sensitive answers go under pluginConfigs in your user settings.json, keyed by plugin ID. Options marked sensitive go to the macOS Keychain, falling back to ~/.claude/.credentials.json, and never into settings.json.
Why does claude plugin install not ask for my plugin's options?
The claude plugin install shell command never prompts for userConfig values. Pass each one with --config KEY=VALUE, run /plugin configure <plugin>@<marketplace> in a session, or pipe a JSON file to claude plugin configure --values-stdin.
How do I change a Claude Code plugin's settings after install?
Run /plugin configure <plugin>@<marketplace> in a session to reopen the dialog. From a terminal, claude plugin configure <plugin>@<marketplace> shows which options are set and saves new values from stdin, then you restart Claude Code to apply them.
Why does my plugin hook fail with references ${user_config.*} in a shell-form command?
A shell would re-parse the substituted value, so a value containing $(...), backticks or a semicolon could run as code. Switch the hook to exec form with an args array, or read the value from the CLAUDE_PLUGIN_OPTION_<KEY> environment variable inside the script.
Can a plugin's skill read a sensitive userConfig value?
No. In skill and agent content only non-sensitive values are substituted, and a sensitive value becomes a placeholder. Use sensitive values in MCP server config or hook environments instead.
Last reviewed by David Iya on November 27, 2026


