Skip to content

Add version field to 27 local-sourced plugins#1050

Open
dicksontsai wants to merge 1 commit intomainfrom
dickson/add-plugin-versions
Open

Add version field to 27 local-sourced plugins#1050
dicksontsai wants to merge 1 commit intomainfrom
dickson/add-plugin-versions

Conversation

@dicksontsai
Copy link
Copy Markdown
Collaborator

Problem

27 local-path plugins (where source is a string like "./plugins/foo" in marketplace.json) have no version field in their .claude-plugin/plugin.json. This causes claude-cli to cache them at ~/.claude/plugins/cache/{marketplace}/{plugin}/unknown/ forever.

The cache check in copyPluginToVersionedCache (pluginLoader.ts) sees pathExists(.../unknown/) → true → skips re-extraction, even after the marketplace content updates. Users are stuck with stale plugin files until they manually delete the cache. This is currently blocking the exec-bit preservation fix from reaching users with already-cached 644 hook scripts.

Fix

Add "version": "1.0.0" to all 27 affected manifests.

This works because calculatePluginVersion reads the manifest from the freshly-synced marketplace tree (not the stale cache), and manifest.version is priority #1 in version resolution. New version → new cache path → cache miss → re-extract.

Why this instead of anthropics/claude-cli-internal#24773 (GCS SHA fallback)

GCS SHA fallback This PR
Granularity All 27 re-extract on every marketplace push Only bumped plugins re-extract
Disk usage Accumulates one cache dir per GCS SHA × 27 plugins (no cleanup logic) One dir per actual plugin version
Coverage Only fixes migrateFromEnabledPlugins; runtime calculatePluginVersion still returns 'unknown' Fixes both paths (manifest.version is priority #1 everywhere)
claude-cli change +43/-22 None

The marketplace updates far more often than any individual plugin — using the marketplace SHA as a per-plugin cache key is the wrong granularity.

Affected plugins

plugins/ (15): agent-sdk-dev, code-review, commit-commands, explanatory-output-style, feature-dev, frontend-design, hookify, learning-output-style, mcp-server-dev, playground, plugin-dev, pr-review-toolkit, ralph-loop, security-guidance, skill-creator

external_plugins/ (12): asana, context7, firebase, github, gitlab, greptile, laravel-boost, linear, playwright, serena, supabase, terraform

Remote-sourced plugins (github/git/url in marketplace.json) already get a git SHA version and are unaffected.

Follow-up (not in this PR)

  • 12 LSP plugins + autofix-bot have no manifest at all — separate issue
  • Consider a CI check that fails when a plugin's content changes but its version doesn't, to enforce the bump discipline going forward

Local-path plugins (source is a string like "./plugins/foo" in
marketplace.json) without a manifest version cache at
~/.claude/plugins/cache/{marketplace}/{plugin}/unknown/ forever.

The cache check in claude-cli's copyPluginToVersionedCache sees
pathExists(.../unknown/) → true → skips re-extraction, even after
the marketplace content updates. Users are stuck with stale plugin
files until they manually delete the cache.

Adding "version": "1.0.0" fixes this because calculatePluginVersion
reads the manifest from the freshly-synced marketplace tree (not the
stale cache), and manifest.version is priority #1 in version
resolution. New version → new cache path → cache miss → re-extract.

This is preferable to the GCS-SHA fallback approach
(anthropics/claude-cli-internal#24773) because:
- Per-plugin granularity: only bumped plugins re-extract, not all
  27 on every marketplace push
- No disk accumulation from unrelated marketplace churn
- Fixes both the runtime loader path AND the migration path
  (manifest.version is priority #1 in both)
- No claude-cli code change needed

Remote-sourced plugins (github/git/url) already get a git SHA as
their version and are unaffected.
Copy link
Copy Markdown
Collaborator

@tobinsouth tobinsouth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

fatcatMaoFei pushed a commit to fatcatMaoFei/claude-plugins-official that referenced this pull request Mar 29, 2026
Complements anthropics#1050 which covers 27 plugins. These 3 were missed:
- external_plugins/slack
- plugins/example-plugin
- plugins/math-olympiad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants