[BUG] Marketplace clone permanently wedged after remote default-branch rename - update fetches a deleted branch but reports success

Open 💬 0 comments Opened Jul 10, 2026 by KTMetcalfe

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

A git-sourced marketplace clone is created single-branch, with its fetch refspec pinned to whatever the repo's default branch was at add time. If the remote's default branch is later renamed (our repo went main -> master), every existing clone keeps fetching the deleted branch forever:

  • claude plugin marketplace update <name> prints Successfully updated marketplace: <name> but the clone's HEAD never moves.
  • autoUpdate: true does nothing for the same reason.
  • Installed plugins stay pinned at the last pre-rename version indefinitely. Our whole team sat on a months-old plugin while believing updates were flowing, because the CLI kept reporting success.

This is distinct from #60772 (autoUpdate never pulls) and #73673 / #72162 (update no-ops): here even the MANUAL update path false-succeeds, and the failure is permanent until the clone's git config is repaired by hand.

The clone's state after the rename:

$ git -C ~/.claude/plugins/marketplaces/<name> config --get remote.origin.fetch
+refs/heads/main:refs/remotes/origin/main

$ git -C ~/.claude/plugins/marketplaces/<name> fetch origin --prune
fatal: couldn't find remote ref refs/heads/main

$ claude plugin marketplace update <name>
✔ Successfully updated marketplace: <name>     <- same state, nothing fetched

Steps to Reproduce

  1. Create a GitHub repo with default branch main containing a valid .claude-plugin/marketplace.json and a plugin.
  2. claude plugin marketplace add <owner>/<repo> and install the plugin.
  3. On GitHub, rename the default branch main -> master.
  4. Push new plugin commits (with a version bump) to master.
  5. Run claude plugin marketplace update <name>: it reports success, but the clone HEAD and the installed plugin are unchanged. Repeat forever.

What Should Happen?

  1. The update path should verify the fetch actually resolved the tracked ref, and report an error instead of success when it didn't (git fetch exits non-zero with couldn't find remote ref here - the exit code is being ignored or never produced).
  2. Ideally, update should re-resolve the remote's current default branch (git ls-remote --symref origin HEAD) and repoint the refspec when the tracked branch no longer exists, so a default-branch rename self-heals.

Recovery that worked for us, per machine:

git -C <clone> config remote.origin.fetch '+refs/heads/master:refs/remotes/origin/master'
git -C <clone> fetch origin --prune
git -C <clone> remote set-head origin master
git -C <clone> checkout -B master origin/master

Environment

  • Claude Code 2.1.206, macOS (Darwin 25.3.0)
  • Marketplace source: {"source": "git", "url": "git@github.com:<org>/<repo>.git"} with autoUpdate: true in a checked-in project .claude/settings.json

View original on GitHub ↗