Skip to content

[BUG] init-plugins.sh never updates plugins — install no-ops against the persistent ~/.claude volume #158

Closed

Description

@gatezh

Summary

init-plugins.sh provisions Claude Code plugins with claude plugin install
only, and claude plugin install is a no-op once a plugin is present. Because
devcontainer.json mounts /home/node/.claude as a named volume, the
plugin cache survives every rebuild — so the install loop finds every plugin
already there and silently does nothing, forever.

The net effect: plugin versions freeze at whatever was latest on the day the
volume was first created, and "Dev Containers: Rebuild Container" never
updates them
. Nothing in postCreateCommand, postStartCommand or
updateContentCommand ever calls claude plugin update or
claude plugin marketplace update.

This is easy to miss because the script's header comment — "Idempotent — safe
to run multiple times" — is true, and is precisely the reason the drift is
invisible. It is also not cosmetic: a stale plugin ships a stale skill. In our
container the bundled modern-web-guidance skill was 19 releases behind and
actively told the agent its guidance was out of date mid-task.

Reproduction

  1. Create a container from the claude-code template; postCreateCommand runs
    init-plugins.sh and installs the plugin list at their then-latest versions.
  2. Leave the container in use for a few weeks (or just wait for upstream plugin
    releases).
  3. Run "Dev Containers: Rebuild Container" — postCreateCommand re-runs.
  4. Observe every plugin is still at its original version. The /home/node/.claude
    volume was never recreated, so the cache was never empty.
$ claude plugin install "modern-web-guidance@googlechrome"
Installing plugin "modern-web-guidance@googlechrome"...✔ Plugin
"modern-web-guidance@googlechrome" is already installed (scope: user)

$ ls ~/.claude/plugins/cache/googlechrome/modern-web-guidance/
0.0.170/

…while the upstream package was at 0.0.189. The stale copy pins a skill
version that its own CLI rejects:

PROBLEM DETECTED: The modern-web-guidance skill is very out-of-date. It requires
an update to ensure top-quality performance.
Your version: 2026_05_16-c5e7870
Latest version: 2026_09_04-7de96777

Verification

The install-is-a-no-op claim and the fix were both confirmed in a running
container:

# 1. install does not refresh an already-installed plugin
claude plugin install "modern-web-guidance@googlechrome"
# -> "is already installed (scope: user)"; cache stays at 0.0.170

# 2. update does, but only after the marketplace index is refreshed
claude plugin marketplace update
# -> "Successfully updated 3 marketplace(s)"
claude plugin update "modern-web-guidance@googlechrome"
# -> "updated from 0.0.170 to 0.0.189 for scope user. Restart to apply changes."

# 3. the refreshed plugin carries the current skill
grep -o "skill-version [0-9_a-z-]*" \
  ~/.claude/plugins/cache/googlechrome/modern-web-guidance/0.0.189/skills/modern-web-guidance/SKILL.md
# -> skill-version 2026_09_04-7de96777

Note that step 2 needs both commands: claude plugin update alone resolves
against the cached marketplace index, so a stale index makes it a no-op too.

Suggested fix

Follow the install loop in init-plugins.sh with a refresh pass. claude plugin update is safe on an already-current plugin, so this stays idempotent:

 for plugin in "${PLUGINS[@]}"; do
     if claude plugin install "$plugin" 2>&1; then
         echo "✔ Installed: $plugin"
     else
         echo "⚠ Failed to install: $plugin" >&2
     fi
 done

+# Plugins live in the persistent /home/node/.claude volume, so `install` above is
+# a no-op on every run after the first. Without this, plugin versions freeze at
+# whatever was latest when the volume was created — rebuilds included.
+# The marketplace index must be refreshed first, or `update` resolves against a
+# stale index and reports no update available.
+claude plugin marketplace update 2>&1 || echo "⚠ Marketplace refresh failed" >&2
+
+for plugin in "${PLUGINS[@]}"; do
+    claude plugin update "$plugin" 2>&1 || echo "⚠ Update check failed: $plugin" >&2
+done

Two alternatives, if a postCreateCommand-time refresh is considered too slow:

  • Move the refresh pass into postStartCommand, beside
    /usr/local/bin/patch-playwright-mcp, so plugins refresh on every container
    start rather than only on create.
  • Leave the loop as-is and document the gap in the template README, so consumers
    know claude plugin update is theirs to run. This is the weakest option — the
    whole point of init-plugins.sh is that provisioning is not manual.

Worth noting for whichever option is chosen: claude plugin update prints
"Restart to apply changes", so a refresh during postCreateCommand applies
cleanly on the first interactive session, whereas one in postStartCommand
applies to the next start.

Affected files in this repo

  • claude-code/.devcontainer/init-plugins.sh:62 — the claude plugin install
    loop, with no update counterpart anywhere in the script.
  • claude-code/.devcontainer/devcontainer.json:105 — the
    …-claude-config-…:/home/node/.claude named volume that makes the cache
    outlive the container.
  • claude-code/.devcontainer/devcontainer.json:124 — postStartCommand runs
    only patch-playwright-mcp; no plugin refresh on start either.

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions