[BUG] Plugin update doesn't advance git submodule checkout, resulting in stale plugin cache
Summary
When a marketplace uses git submodules for plugins, the plugin update process pulls the marketplace repo but never runs git submodule update, leaving the submodule checkout at a stale commit. The plugin cache is then populated from this stale checkout with outdated files.
Related to #17293 (initial clone doesn't init submodules), but this is about the update path — even when the submodule was previously initialized, subsequent updates don't advance it.
Steps to Reproduce
- Have a marketplace repo that uses a git submodule for a plugin
- Install the marketplace and plugin — submodule gets cloned at commit A
- Push a new commit B to the plugin repo with changes
- Update the marketplace repo's submodule pointer to commit B
- Trigger a plugin update in Claude Code
Expected Behavior
The submodule checkout should advance from commit A to commit B, and the plugin cache should reflect commit B.
Actual Behavior
- The marketplace repo itself updates (submodule pointer moves to commit B)
- The submodule checkout stays at commit A —
git submodule updateis never run - The plugin cache is populated from the stale commit A checkout
Evidence
# Marketplace repo correctly references the new commit
$ git -C ~/.claude/plugins/marketplaces/<marketplace> \
ls-tree HEAD plugins/<plugin>
160000 commit 7d8814e... plugins/<plugin> # pointer is correct
# But the submodule is still checked out at the old commit
$ git -C ~/.claude/plugins/marketplaces/<marketplace>/plugins/<plugin> \
rev-parse HEAD
43d2f01... # stale
# git submodule status confirms the mismatch (+ prefix = wrong commit)
$ git -C ~/.claude/plugins/marketplaces/<marketplace> \
submodule status
+43d2f01... plugins/<plugin> (heads/main-4-g43d2f01)
Environment
- Claude Code version: 2.1.41
- OS: macOS (Darwin 24.6.0)
Suggested Fix
After pulling the marketplace repo, run:
git submodule update --init --recursive
This would fix both the initial clone (#17293) and the update path.
Workaround
Manually update the submodule:
cd ~/.claude/plugins/marketplaces/<marketplace>
git submodule update --init --recursive
Then reinstall or update the plugin so the cache is refreshed.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗