Skip to content

init-plugins.sh: all plugin installs fail silently — missing marketplace registration + wrong ralphex repo + ARM64 patch targets wrong path #74

Closed

Description

@gatezh

Summary

init-plugins.sh installs zero plugins because:

  1. The claude-plugins-official marketplace is never registered before claude plugin install is called
  2. The ralphex marketplace uses the wrong GitHub repo path (ralphex/ralphex — doesn't exist)
  3. The Playwright ARM64 .mcp.json patch targets the marketplace source directory, but Claude Code reads from the cache directory at runtime

All failures are invisible because 2>/dev/null || true suppresses every error.

Environment

  • Claude Code CLI: 2.1.104
  • Image: ghcr.io/gatezh/devcontainers/claude-code:latest (and claude-code-sandbox)
  • Arch: aarch64 (Apple Silicon) and amd64

Steps to reproduce

  1. Build a devcontainer from the claude-code template
  2. Let postCreateCommand run init-plugins.sh
  3. Open a Claude Code session
$ claude plugin marketplace list
No marketplaces configured

$ claude plugin list
No plugins installed. Use `claude plugin install` to install a plugin.

All 11 plugin installs failed silently.

Root cause

Bug 1 — Missing marketplace registration

The script jumps straight to claude plugin install "<name>@claude-plugins-official" without first running claude plugin marketplace add. The official marketplace is not auto-configured — it must be added explicitly:

claude plugin marketplace add anthropics/claude-plugins-official

Per the official plugin docs, marketplace registration is a prerequisite for plugin installation.

Bug 2 — Wrong ralphex repo path

The script references ralphex/ralphex which returns "Repository not found" on GitHub. The correct path is umputun/ralphex:

# WRONG — repo doesn't exist
claude plugin marketplace add ralphex/ralphex

# CORRECT
claude plugin marketplace add umputun/ralphex

Bug 3 — Playwright ARM64 patch targets wrong path

The script patches:

~/.claude/plugins/marketplaces/claude-plugins-official/external_plugins/playwright/.mcp.json

But Claude Code reads the config from the cache directory:

~/.claude/plugins/cache/claude-plugins-official/playwright/<version-hash>/.mcp.json

These are independent copies (not symlinks). The patch has no runtime effect. The cache path includes a version hash that changes on updates, so it must be resolved dynamically:

PLAYWRIGHT_MCP_CACHE=$(claude plugin list --json 2>/dev/null \
    | jq -r '.[] | select(.id == "playwright@claude-plugins-official") | .installPath')

Bug 4 — Silent error suppression

claude plugin install "$plugin" 2>/dev/null || true

This swallows all stderr output and ignores all non-zero exit codes. When every plugin install fails, the script reports success with zero output. This makes the first three bugs invisible.

Suggested fix

# ── Claude Code marketplaces ────────────────────────────────────────────────
# Register marketplaces before installing plugins. The official marketplace is
# NOT auto-configured — it must be added explicitly.
MARKETPLACES=(
    "anthropics/claude-plugins-official"
    "umputun/ralphex"
)

for marketplace in "${MARKETPLACES[@]}"; do
    if claude plugin marketplace add "$marketplace" 2>&1; then
        echo "✔ Marketplace added: $marketplace"
    else
        echo "⚠ Failed to add marketplace: $marketplace" >&2
    fi
done

# ── Claude Code plugins ─────────────────────────────────────────────────────
PLUGINS=(
    "frontend-design@claude-plugins-official"
    "code-review@claude-plugins-official"
    "typescript-lsp@claude-plugins-official"
    "code-simplifier@claude-plugins-official"
    "playwright@claude-plugins-official"
    "superpowers@claude-plugins-official"
    "explanatory-output-style@claude-plugins-official"
    "claude-md-management@claude-plugins-official"
    "claude-code-setup@claude-plugins-official"
    "posthog@claude-plugins-official"
    "ralphex@ralphex"
)

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

# ── Playwright MCP: use Chromium on ARM64 ───────────────────────────────────
# Resolve the cache path dynamically — it includes a version hash.
if [ "$(uname -m)" = "aarch64" ]; then
    PLAYWRIGHT_MCP_CACHE=$(claude plugin list --json 2>/dev/null \
        | jq -r '.[] | select(.id == "playwright@claude-plugins-official") | .installPath')
    if [ -n "$PLAYWRIGHT_MCP_CACHE" ] && [ -f "$PLAYWRIGHT_MCP_CACHE/.mcp.json" ]; then
        jq '.playwright.args = ["@playwright/mcp@latest", "--browser", "chromium"]' \
            "$PLAYWRIGHT_MCP_CACHE/.mcp.json" > /tmp/playwright-mcp.json \
            && mv /tmp/playwright-mcp.json "$PLAYWRIGHT_MCP_CACHE/.mcp.json"
    fi
fi

All three commands (marketplace add, plugin install, plugin list --json) are idempotent — safe to re-run.

Impact

  • All devcontainer users get zero plugins installed (default + sandbox variants)
  • ARM64 users don't get the Chromium fallback even if plugins were somehow manually installed
  • Failures are completely silent — users discover the problem only when skills are missing at runtime

Activity

  1. gatezh commented on Apr 14, 2026

    @gatezh
    OwnerAuthor

    Analysis

    Investigated against the current code and latest official plugin docs. Here's what holds up and what doesn't:

    Bug 1 — Missing marketplace registration

    Fix is correct, but the reasoning is inaccurate. The docs state: "The official Anthropic marketplace (claude-plugins-official) is automatically available when you start Claude Code." It IS auto-configured — but only on first interactive launch. Since init-plugins.sh runs in postCreateCommand (before any interactive session), the marketplace isn't available yet. So adding it explicitly is still the right fix, just for a different reason.

    Notably, the root repo's own .devcontainer/init-plugins.sh already does this correctly — it registers both marketplaces before installing. The claude-code image script was written earlier and never updated to match.

    Bug 2 — Wrong ralphex repo path

    Partially valid. The issue says the script "references ralphex/ralphex" — that path doesn't appear in the code. What's actually missing is the claude plugin marketplace add call entirely. The plugin array has ralphex@ralphex (line 32) but no marketplace is ever registered for it. The root repo's script correctly uses umputun/ralphex.

    Bug 3 — Playwright ARM64 patch targets wrong path

    Valid. The docs confirm plugins run from cache (~/.claude/plugins/cache), not the marketplace source directory. The current patch at line 42 has no runtime effect.

    However, the suggested claude plugin list --json with .installPath is not documented anywhere in the official CLI reference. The only documented path mechanism is ${CLAUDE_PLUGIN_ROOT} (available inside plugin hooks/configs, not external scripts). Using a find-based lookup against the cache directory is more robust than relying on undocumented CLI output.

    Bug 4 — Silent error suppression

    Fully valid. 2>/dev/null || true hides everything. The root repo's script already uses a better pattern with warning logs.

    Summary

    Bug Valid? Suggested Fix
    1. Missing marketplace ✅ Fix correct, reasoning slightly off ✅ Good
    2. Wrong ralphex path ✅ Missing marketplace add (not wrong path) ✅ Good
    3. ARM64 patch path ✅ Valid ⚠️ claude plugin list --json is undocumented — using find instead
    4. Silent errors ✅ Fully valid ✅ Good

    Fix incoming.

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