relevance block to the plugin’s entry in marketplace.json.
A marketplace operator writes the relevance entries. An administrator then allowlists the marketplace in managed settings. Users see no suggestions from a marketplace until it’s allowlisted.
These cases are covered on other pages:
- You want to install plugins: see Install and manage plugins
- You want to turn suggestions off: see Understand how plugin relevance works
- Marketplace operators: read how suggestions work, then add relevance to a plugin entry and validate your marketplace
- Administrators: enable suggestions in managed settings
Understand how plugin relevance works
Each plugin entry inmarketplace.json can include a relevance object. The object names a topic and one or more signals. A signal is a pattern that Claude Code tests against the current session, such as the working directory or files Claude has read.
Signal matching happens locally on the user’s machine and adds no network traffic. Claude Code doesn’t report which signals matched or their values to Anthropic or to the marketplace operator.
When a signal matches and the plugin isn’t already installed, Claude Code suggests the plugin in these places:
- Spinner tip: a message with the
/plugin installcommand appears below the spinner while Claude is responding. - Session-start notification: if a
cwdsignal matches the working directory, a one-line notification appears before the user sends a first message. /pluginDiscover tab: the plugin is pinned to the top of the Discover list.
spinnerTipsEnabled to false, or when a spinnerTipsOverride with excludeDefault replaces the built-in tips. The Discover-tab pin isn’t affected by either setting.
Add relevance to a plugin entry
Add arelevance object to the plugin’s entry in your marketplace.json. The following example declares that the terraform-helpers plugin is relevant when Claude reads a .tf file or runs terraform:
Field reference
Therelevance object and its nested signals object accept the fields in the following tables.
Older clients still load a marketplace that uses relevance fields they don’t recognize, because unknown fields under relevance and relevance.signals are ignored at load time. A recognized field whose value exceeds its limit in the field reference invalidates the whole plugin entry, and users can’t install that plugin from the marketplace until you fix it; claude plugin validate reports the same limits.
relevance
The
topic is often the product name, for example Terraform. Use a domain such as design when the plugin name doesn’t sound natural as a topic.
relevance.signals
The signals object accepts the following fields.
The
filesRead and manifestDeps signals also match against files Claude has written or edited this session and against the project’s auto-loaded CLAUDE.md memory files.
Working directory matching
cwd is the only signal that can match at session start, before the user sends a first message.
Claude Code matches each cwd pattern as follows:
- The pattern is matched against the working directory as an absolute path. When the session is inside a git repository, it’s also matched against the working directory’s path relative to the repository root.
- Matching is forward-slash normalized and case-insensitive.
- Every pattern matches the directory itself and everything under it, so
infra,infra/, andinfra/**behave identically.
Command name matching
Claude Code records one command name for each shell command Claude runs: the first token after any leading environment variable assignments andsudo. Compound commands contribute only their leading command, so cd infra && terraform plan records cd, not terraform.
Manifest dependency matching
EachmanifestDeps entry pairs two JavaScript RegExp source strings:
file: matched case-insensitively against the manifest file’s path. The path is typically absolute, so anchor the pattern at the end rather than the start. Paths aren’t separator-normalized for this signal, so Windows paths use backslashes.pattern: matched case-sensitively against that file’s contents.
manifestDeps to suggest your plugin once Claude has read a package.json that depends on your SDK’s npm package, named your-sdk here.
file pattern uses [/\\\\] so it matches both forward-slash and backslash path separators, and \\. so the dot is literal. In JSON, each backslash in the regular expression is written twice.
Validate your marketplace
In your shell, runclaude plugin validate against your marketplace directory to check the relevance block before publishing:
relevance block, including these:
- Reports unknown keys under
relevanceandrelevance.signalsas warnings - Flags a
relevancevalue that isn’t an object - Rejects a
signals.hostsentry that includes a scheme, port, or path
Validation passed, Validation passed with warnings, or Validation failed.
Enable suggestions in managed settings
Users see no suggestions from a marketplace until an administrator allowlists it in managed settings, even when itsmarketplace.json declares relevance.
To allowlist a marketplace, edit your managed settings as follows:
- Add the marketplace name to
pluginSuggestionMarketplaces. - For any marketplace other than the official Anthropic marketplace, also declare the marketplace source, either as that name’s entry in
extraKnownMarketplacesor as an entry instrictKnownMarketplaces.
managed-settings.json registers an org marketplace from a GitHub repository and enables its suggestions:
Preview what the user sees
When a plugin’srelevance signal matches during a session, the tip below the spinner reads:
cwd signal matches at session start, the one-line notification reads:
/plugin Discover tab, the plugin is pinned above the other results with an annotation that names the matching signal, such as suggested for this directory or suggested for terraform commands.
Claude Code limits how often it suggests a given plugin:
- The suggestion appears at most once every three sessions across the spinner tip and the session-start notification combined.
- The session-start notification stops appearing once the spinner tip and the notification have shown the plugin a combined total of two times.
- Neither the spinner tip nor the session-start notification repeats once the plugin is installed.
- The Discover tab pins the plugin the first time the user opens the tab while the plugin’s signals match. Claude Code records that in
~/.claude.json, so every later time the user opens/pluginon that machine, the plugin appears in normal order.
See also
- Host a marketplace: run the marketplace that hosts your plugins
- Marketplace reference: every field a plugin entry accepts
- Recommend your plugin from your CLI: prompt users from your own CLI instead of from Claude Code’s session signals
- Manage plugins for your organization:
extraKnownMarketplaces,strictKnownMarketplaces, and the rest of the plugin policy keys