Skip to content

claude-code template: init-plugins.sh moves every plugin to its marketplace's HEAD on each run, unpinned, before the sandbox firewall #248

Open

Description

@gatezh

Summary

Since #158, claude-code/.devcontainer/init-plugins.sh runs claude plugin marketplace update and then claude plugin update for every plugin, on every run. That fixed the frozen-plugin problem. But it now pulls whatever each marketplace's default branch holds at that moment, with no pin, no delay and no review step. In the sandbox variant this happens before the firewall is up.

Plugins are third-party code that runs inside Claude Code, with the same access as the agent. That includes the gh login persisted on the ~/.config/gh volume.

Where

  • claude-code/.devcontainer/init-plugins.sh: the "~/.claude is a persistent volume" block, marketplace update followed by a plugin update loop over PLUGINS.
  • The marketplaces (anthropics/claude-plugins-official, umputun/ralphex, GoogleChrome/modern-web-guidance, AgriciDaniel/claude-seo, cloudflare/skills, rubberduck-studio/typescript-native-lsp) are added by owner/repo with no ref.
  • claude-code/.devcontainer/claude-sandbox/devcontainer.json: postCreateCommand runs init-plugins.sh, and only then does postStartCommand run init-firewall, as the comment there says.

Why it matters

  • A compromised or broken plugin release reaches every container on its next rebuild, automatically. One poisoned push to any of the six marketplaces' default branches is enough.
  • The sandbox's network restriction doesn't cover this step. The update runs while the container still has unrestricted egress, so the firewall can't help even when its allow-list would have blocked a plugin host.
  • It's inconsistent with how downstream projects treat other dependencies. At least one downstream project pins exact npm versions and refuses any release younger than 7 days (minimumReleaseAge), yet takes plugin code at HEAD.

Possible directions (not mutually exclusive)

  1. Make updating a deliberate act. Keep [BUG] init-plugins.sh never updates plugins — install no-ops against the persistent ~/.claude volume #158's update loop, but behind an opt-in: an env var such as PLUGIN_AUTO_UPDATE=1, or a separate update-plugins.sh the user runs. A rebuild then installs missing plugins without silently moving existing ones.
  2. In the sandbox, update after the firewall is up, so the allow-list governs it, or skip the update step there entirely.
  3. Pin marketplaces to a reviewed ref, if claude plugin marketplace add supports a ref or tag (unverified). Bumping the ref then becomes a reviewable change, like any other dependency bump.
  4. Add a release-age delay if the plugin CLI ever exposes version metadata. I didn't find one; noting it for parity with package managers.

Option 1 is the smallest change that keeps #158's benefit: plugins still update when asked, but never as a side effect of a rebuild.

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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions