Skip to content

claude-code template: declare marketplaces and disabled plugins in settings instead of init-plugins.sh loops #297

Open

Description

@gatezh

Summary

init-plugins.sh adds marketplaces and disables conflicting plugins with claude plugin … loops at container start. Claude Code now declares both in settings. Moving them there makes the config visible and diffable, and Claude Code applies it on every start. A start-up script applies it only when it runs, which is #171's problem, and its failures only print a warning.

Loop in init-plugins.sh Settings equivalent (project .claude/settings.json)
claude plugin marketplace add <repo> extraKnownMarketplaces: { "<name>": { "source": { "source": "github", "repo": "<repo>" } } }
claude plugin disable <plugin> (conflicts) enabledPlugins: { "<plugin>@<marketplace>": false }

Not a replacement for #248's concern

Each entry also takes an optional autoUpdate, which refreshes the marketplace and updates its plugins in the background after startup. When omitted, it defaults to true for claude-plugins-official and most other official Anthropic marketplaces, and to false for third-party ones.

Setting it to true on the third-party marketplaces would recreate #248's unpinned-HEAD updates. The settings reference documents no ref or commit pin for a github or git source, so pinning stays an open question for #248. Leave autoUpdate unset.

Keep

Keep the install loop. For project settings, the settings reference says enabledPlugins "doesn't install them, so each user installs them". claude plugin install is still needed on a fresh volume.

Caveat

Claude Code honors a repository's extraKnownMarketplaces only after the folder's workspace trust dialog is accepted. In an untrusted folder, including a -p run, it ignores the entries without a message. A devcontainer opened through VS Code is normally trusted on first use. Still, keep the script's marketplace add as a fallback, or note the trust step in the template's README.

References

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