claude-code - 💡(How to fix) Fix [FEATURE] Support `default` field in plugin `userConfig` entries [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#46477Fetched 2026-04-11 06:19:16
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
labeled ×2

Code Example

{
  "userConfig": {
    "work_dir": {
      "description": "Working directory for job outputs",
      "default": "/scratch/orchestrate",
      "sensitive": false
    },
    "container_dir": {
      "description": "Path to Apptainer/Singularity container images",
      "default": "/large_storage/ctc/public/apptainer",
      "sensitive": false
    },
    "api_token": {
      "description": "API authentication token",
      "sensitive": true
    }
  }
}
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • This is a single feature request (not multiple features)

Problem Statement

The userConfig field in plugin.json is the correct mechanism for prompting users to provide per-user configuration values when enabling a plugin. However, userConfig entries only support description and sensitive — there is no way to specify a default value.

This means that every userConfig key is effectively required: the user must provide a value at enable time, even when a sensible default would work for the majority of users. For plugins distributed via private organizational marketplaces, this creates unnecessary friction during onboarding, especially when most users would accept the same default.

Proposed Solution

Proposed Solution

Add an optional default field to userConfig entries:

{
  "userConfig": {
    "work_dir": {
      "description": "Working directory for job outputs",
      "default": "/scratch/orchestrate",
      "sensitive": false
    },
    "container_dir": {
      "description": "Path to Apptainer/Singularity container images",
      "default": "/large_storage/ctc/public/apptainer",
      "sensitive": false
    },
    "api_token": {
      "description": "API authentication token",
      "sensitive": true
    }
  }
}

Behavior

  • When a default is provided, the prompt at enable time pre-fills or displays the default, and the user can accept it by pressing Enter
  • If the user provides no value and a default exists, the default is used
  • If no default is specified, current behavior is unchanged (user must provide a value)
  • ${user_config.KEY} substitution and CLAUDE_PLUGIN_OPTION_<KEY> export work the same regardless of whether the value came from user input or the default

Alternative Solutions

We maintain a private marketplace with plugins that launch MCP servers on a shared HPC cluster. Most users share common paths for container images and scratch directories, but some users need to override them. Today, every user must manually enter these values at enable time, even though the defaults would work for 90% of the team. A default field would let us ship sensible values while still allowing per-user customization.

Priority

Medium - Would be very helpful

Feature Category

CLI commands and flags

Use Case Example

No response

Additional Context

No response

extent analysis

TL;DR

Add an optional default field to userConfig entries in plugin.json to allow for pre-filled or displayed default values during plugin enablement.

Guidance

  • Review the proposed solution and consider adding a default field to userConfig entries to reduce friction during onboarding.
  • Verify that the default field does not introduce any security concerns, especially for sensitive fields.
  • Test the proposed behavior to ensure it works as expected, including pre-filling or displaying default values and using them when no user input is provided.
  • Consider the impact of this change on existing plugins and users, and plan for a smooth transition.

Example

{
  "userConfig": {
    "work_dir": {
      "description": "Working directory for job outputs",
      "default": "/scratch/orchestrate",
      "sensitive": false
    }
  }
}

Notes

The proposed solution seems to address the issue, but it's essential to consider potential edge cases and security implications before implementing the change.

Recommendation

Apply the proposed workaround by adding an optional default field to userConfig entries, as it provides a sensible solution to reduce friction during onboarding while still allowing for per-user customization.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING