[Feature Request] Support extraKnownMarketplaces in headless/print mode for CI/CD workflows

Resolved 💬 3 comments Opened Dec 4, 2025 by alexey-pelykh Closed Feb 5, 2026

Summary

The extraKnownMarketplaces setting in project-level .claude/settings.json does not work in headless/print mode (-p), making it impossible to use for CI/CD automation.

Current Behavior

According to the documentation:

"When team members trust the repository folder, Claude Code automatically installs these marketplaces and any plugins specified in the enabledPlugins field."

However, in print mode (-p), the trust dialog is skipped (as documented), which means:

  1. The extraKnownMarketplaces processing never triggers
  2. Project-defined marketplaces are completely invisible to plugin commands
  3. claude plugin marketplace list only shows user-level marketplaces from ~/.claude/plugins/known_marketplaces.json

Evidence

Detailed investigation with reproduction steps: https://gist.github.com/alexey-pelykh/566a4e5160b305db703d543312a1e686

Key findings:

  • claude plugin marketplace list ignores project extraKnownMarketplaces
  • --setting-sources user,project,local flag has no effect on plugin subcommands
  • Manually setting hasTrustDialogAccepted: true in ~/.claude.json doesn't trigger auto-installation
  • The auto-install logic is tied to the interactive trust dialog event handler

Proposed Solution

Add a CLI flag to enable processing of project settings in headless mode, for example:

claude -p --trust-project-settings "prompt"

Or support a flag specifically for plugin subcommands:

claude plugin --trust-project-settings marketplace list

This would:

  1. Process extraKnownMarketplaces from project .claude/settings.json
  2. Auto-install defined marketplaces (as happens in interactive mode)
  3. Process enabledPlugins if present

Use Case

Teams want to:

  1. Define plugin marketplaces in their repository's .claude/settings.json
  2. Have CI/CD workflows automatically use those marketplaces
  3. Ensure consistent plugin availability across team members and automation

Current Workarounds

  1. Use claude plugin marketplace add ./ explicitly in CI
  2. Pre-populate ~/.claude/plugins/known_marketplaces.json
  3. Use GitHub Action's plugin_marketplaces input

These workarounds defeat the purpose of having repository-level configuration.

Environment

  • Claude Code version: 2.0.58
  • Platform: Linux (GitHub Actions), macOS

Related

This is related to the trust dialog behavior documented in the -p flag help:

"The workspace trust dialog is skipped when Claude is run with the -p mode. Only use this flag in directories you trust."

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗