claude-code - 💡(How to fix) Fix [FEATURE] Marketplace-level dependencies — declarative `dependentMarketplaces` and/or marketplace lifecycle hooks [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#54057Fetched 2026-04-28 06:40:24
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
labeled ×2

Error Message

  • Compatibility check (warn if Claude Code version is too old).

Root Cause

  • extraKnownMarketplaces in a project's .claude/settings.json fires only on local repo trust. Consumers who use /plugin marketplace add owner/repo never trigger it because they don't clone the marketplace repo locally.
  • allowCrossMarketplaceDependenciesOn in marketplace.json is a guard (allowing plugins to depend on plugins from another marketplace), not a trigger — both marketplaces still must already be registered before dependency resolution runs.
  • Per-plugin hooks fire after a plugin is installed and on every SessionStart, but they're per-plugin (users who haven't installed the right plugin never see them) and indirect (a plugin doing marketplace-management feels wrong).
  • setup.sh convention is purely manual — requires consumers to read README and run a script.

Code Example

{
  "name": "team-tools",
  "owner": { "...": "..." },
  "plugins": [ "..." ],
  "dependentMarketplaces": [
    {
      "name": "shared-foundations",
      "kind": "recommended",
      "source": {
        "source": "github",
        "repo": "your-org/shared-foundations"
      },
      "reason": "team-tools plugins integrate with shared-foundations utilities; many work better when both are registered."
    }
  ]
}

---

{
  "name": "team-tools",
  "hooks": {
    "MarketplaceAdd": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "${CLAUDE_MARKETPLACE_ROOT}/scripts/post-install.sh"
          }
        ]
      }
    ]
  }
}
RAW_BUFFERClick to expand / collapse

Problem / Intent

Marketplaces frequently have meaningful relationships with each other: a "team" marketplace federates with an "organization" marketplace, a domain marketplace builds on a shared-foundations marketplace, etc. Today there is no way for a marketplace author to express "consumers of my marketplace also benefit from these other marketplaces" and have Claude Code surface that to users.

The closest existing primitives don't actually solve this:

  • extraKnownMarketplaces in a project's .claude/settings.json fires only on local repo trust. Consumers who use /plugin marketplace add owner/repo never trigger it because they don't clone the marketplace repo locally.
  • allowCrossMarketplaceDependenciesOn in marketplace.json is a guard (allowing plugins to depend on plugins from another marketplace), not a trigger — both marketplaces still must already be registered before dependency resolution runs.
  • Per-plugin hooks fire after a plugin is installed and on every SessionStart, but they're per-plugin (users who haven't installed the right plugin never see them) and indirect (a plugin doing marketplace-management feels wrong).
  • setup.sh convention is purely manual — requires consumers to read README and run a script.

Result: marketplace authors who want to recommend or require companion marketplaces rely on documentation and hope users follow it. Per-plugin federation via git-subdir handles the tightly-coupled case but doesn't help when the companion marketplace is genuinely separate.

Proposed primitive A — dependentMarketplaces (preferred)

Add a declarative field to marketplace.json that lists companion marketplaces, using the same source schema as extraKnownMarketplaces:

{
  "name": "team-tools",
  "owner": { "...": "..." },
  "plugins": [ "..." ],
  "dependentMarketplaces": [
    {
      "name": "shared-foundations",
      "kind": "recommended",
      "source": {
        "source": "github",
        "repo": "your-org/shared-foundations"
      },
      "reason": "team-tools plugins integrate with shared-foundations utilities; many work better when both are registered."
    }
  ]
}

Behavior on /plugin marketplace add team-tools:

  • Claude Code parses dependentMarketplaces.
  • For each entry, presents a prompt:

    team-tools recommends installing shared-foundations. Reason: (reason text). Add it now? [Y/n]

  • kind: "required" makes the prompt non-skippable; kind: "recommended" is opt-in default.
  • On /plugin marketplace update, re-evaluate in case the dep list changed.

This is the 80% case, purely declarative — no shell, no scripts, no hooks. Maps cleanly onto the existing extraKnownMarketplaces schema for source resolution.

Proposed primitive B — Marketplace lifecycle hooks (alternative or complement)

Introduce hook events for marketplace lifecycle:

EventWhen it fires
MarketplaceAddAfter /plugin marketplace add completes
MarketplaceUpdateAfter /plugin marketplace update completes
MarketplaceRemoveBefore /plugin marketplace remove

Hooks are defined on marketplace.json at the marketplace level (mirroring how plugin hooks are declared on plugin.json):

{
  "name": "team-tools",
  "hooks": {
    "MarketplaceAdd": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "${CLAUDE_MARKETPLACE_ROOT}/scripts/post-install.sh"
          }
        ]
      }
    ]
  }
}

Use cases beyond dependentMarketplaces:

  • Compatibility check (warn if Claude Code version is too old).
  • Telemetry, with user consent.
  • One-time data migrations across marketplace updates.
  • Custom UX during install (multi-step wizards).

Recommendation

Ship A first — solves the documented use case declaratively with no security surface beyond what extraKnownMarketplaces already has. B can land later as a more general extensibility primitive if/when use cases beyond dependency declaration emerge.

Real-world scenario

I maintain two marketplaces in a federated relationship: a team marketplace and a broader organization marketplace. Per-plugin federation via git-subdir works for individual plugins (one federated, ~60 not). For the rest, every new consumer has to:

  1. Run /plugin marketplace add <team-marketplace> — adds the team catalog.
  2. Be told via README that they should also /plugin marketplace add <org-marketplace> to access the broader catalog.
  3. Manually run that second command.

Step 3 is where adoption breaks. With dependentMarketplaces, the prompt happens automatically and consistently; the step users miss disappears.

Related

  • #9444 (plugin-level dependencies) — different scope, related thinking.
  • extraKnownMarketplaces in project settings — closest existing mechanism; doesn't apply to consumer-side /plugin marketplace add flow.
  • allowCrossMarketplaceDependenciesOn — guard, not trigger; needed alongside this for plugin-dep scenarios.

extent analysis

TL;DR

Implement the proposed dependentMarketplaces field in marketplace.json to enable marketplace authors to declaratively specify companion marketplaces.

Guidance

  • Add a dependentMarketplaces field to marketplace.json with a list of companion marketplaces, including their source and reason for dependency.
  • Update Claude Code to parse dependentMarketplaces and present a prompt to users when adding a marketplace, allowing them to install recommended or required companion marketplaces.
  • Consider implementing marketplace lifecycle hooks as a complementary solution to handle additional use cases beyond dependency declaration.
  • Test the implementation with various scenarios, including required and recommended companion marketplaces, to ensure correct behavior.

Example

{
  "name": "team-tools",
  "owner": { "...": "..." },
  "plugins": [ "..." ],
  "dependentMarketplaces": [
    {
      "name": "shared-foundations",
      "kind": "recommended",
      "source": {
        "source": "github",
        "repo": "your-org/shared-foundations"
      },
      "reason": "team-tools plugins integrate with shared-foundations utilities; many work better when both are registered."
    }
  ]
}

Notes

The proposed solution assumes that the dependentMarketplaces field will be parsed and handled correctly by Claude Code. Additional testing and validation may be necessary to ensure compatibility with existing marketplace functionality.

Recommendation

Apply the dependentMarketplaces workaround to enable declarative specification of companion marketplaces, as it solves the documented use case with minimal security surface.

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