Plugin marketplace update/refresh forces HTTPS and fails even when the existing clone works fine over SSH
Environment:
- Linux (RHEL 8/9-based),
gh auth loginconfigured with Git protocol =ssh - No HTTPS
credential.helperregistered in git config - Private GitHub marketplace repo (
p4components/rwc-claude-marketplace)
Description:
When a plugin marketplace is added via /plugin marketplace add <owner>/<repo>, Claude Code correctly clones it over SSH (matching the gh CLI's configured protocol), and the local clone's origin remote is git@github.com:<owner>/<repo>.git. This clone works fine — git fetch origin against it succeeds with no errors.
However, when Claude Code later tries to refresh/update that same marketplace (either via /plugin marketplace update <name>, /plugin marketplace update with no args, or the automatic refresh that runs on /plugin), it fails with:
Failed to refresh marketplace '<name>': Failed to clone marketplace repository:
HTTPS authentication failed. Please ensure your credential helper is configured
(e.g., gh auth login).
This happens even though:
- The existing local clone already has a working SSH remote for the exact same repo.
gh auth statusshowsGit operations protocol: sshand a valid, active login.- A manual
git fetch originin the marketplace's install directory succeeds immediately (exit 0).
By contrast, a bare HTTPS operation against the same repo on the same machine fails immediately with fatal: could not read Username for 'https://github.com': No such device or address — there is no HTTPS credential helper configured, only SSH. This confirms the update/refresh code path is attempting an HTTPS clone/fetch instead of reusing the already-working SSH remote (or otherwise respecting the protocol gh is configured for), while the add code path correctly resolves to SSH.
Repro steps:
- On a machine where
gh auth loginis configured with SSH protocol only (no HTTPS credential helper). /plugin marketplace add <owner>/<private-repo>— succeeds, clones over SSH./plugin marketplace update <name>(or just run/plugin, which auto-refreshes) — fails with "HTTPS authentication failed."/plugin marketplace remove <name>then/plugin marketplace add <owner>/<private-repo>again — succeeds again, because it's a fresh clone using the same (working) SSH-based resolution as step 2.
Expected: Refresh/update should reuse the same protocol/remote that the existing clone already has working (or otherwise respect gh's configured protocol), so it doesn't fail for users who only have SSH configured.
Actual: Refresh/update appears to hardcode or reconstruct an HTTPS URL, ignoring the working SSH remote, and fails outright — with the only workaround being to remove and re-add the marketplace every time an update is needed.
Workaround: Run gh auth setup-git to additionally register an HTTPS credential helper, or remove/re-add the marketplace whenever a refresh is needed.