Marketplace installation doesn't clone git submodules

Status Fixed / completed
Reported on v2.1.3
Maintainer reply None cached
Activity 5 comments · opened Jan 10, 2026 · closed Mar 3, 2026

When installing a marketplace that uses git submodules to include multiple plugins, Claude Code clones the repository but doesn't initialize or update submodules. This leaves empty placeholder directories where the plugin content should be.

Steps to Reproduce

  1. Create a marketplace repo that uses git submodules (e.g., to include multiple independent plugin repos)
  2. Install the marketplace via Claude Code
  3. Check the installed directory at ~/.claude/plugins/marketplaces/<name>/

Expected Behavior

Submodules should be cloned along with the main repo, equivalent to:

git clone --recurse-submodules <repo-url>
# or
git clone <repo-url> && git submodule update --init --recursive

Actual Behavior

Submodule directories exist but are empty. Running git submodule status shows all submodules with - prefix (uninitialized):

-640fa097d878e015d8547e89ab788211064b6b58 hiivmind-corpus
-821b2331131bed6fbf870856b95aee5b874383ca hiivmind-corpus-airtable
-c0d30fe4d4a366ec7237875bb18b519e8f4fb7d3 hiivmind-corpus-atproto
...

Environment

Workaround

Manually initialize submodules after installation:

cd ~/.claude/plugins/marketplaces/<name>
git submodule update --init --recursive

View original on GitHub ↗

5 Comments

discreteds · 7 months ago

Why This Matters

Without submodule support, marketplaces are effectively forced to be monorepos. This limits the plugin ecosystem in several ways:

  • No composition: Marketplace maintainers can't aggregate plugins from independent repositories - everything must live in one repo
  • No independent versioning: Individual plugins can't have their own release cycles, tags, or changelogs
  • No plugin reuse: The same plugin can't be included in multiple marketplaces without copy-pasting code
  • Single point of ownership: All plugins must be maintained by whoever controls the marketplace repo, rather than by independent authors
  • Contributor friction: Contributors need write access to the entire marketplace to update a single plugin

Submodule support enables a federated model where:

  • Marketplaces curate and aggregate plugins from across the ecosystem
  • Plugin authors maintain their own repos with independent CI/releases
  • The same plugin can appear in multiple marketplaces
  • Marketplace maintainers can pin specific plugin versions

For example, this is how the hiivmind-marketplace is structured - 16 independent plugin repos composed into a single installable marketplace.

---

Investigation Findings

I investigated this issue by examining the bundled CLI at cli.js in the @anthropic-ai/claude-code npm package.

Root Cause Identified

There are two git clone functions in the codebase that handle repository cloning:

| Function | Type | Used For | Error Message |
|----------|------|----------|---------------|
| ru8 | SSH clone | Marketplace installation | "Failed to clone marketplace repository" |
| Bm8 | HTTPS clone | Plugin installation (github/url sources) | "Failed to clone repository" |

Marketplace clone (SSH):

let G=["-c","core.sshCommand=ssh -o BatchMode=yes -o StrictHostKeyChecking=accept-new","clone","--depth","1"];
if(B)G.push("--branch",B);
G.push(A,Q);

Called from:

hR(G,`Cloning repository: ${A}${I}`);
let Y=await ru8(A,Q,B);
if(Y.code!==0)throw Error(`Failed to clone marketplace repository: ${Y.stderr}`);
hR(G,"Clone complete, validating marketplace…");

Plugin clone (HTTPS):

let G=["clone","--depth","1"];
if(B)G.push("--branch",B);
G.push(A,Q);

Called from plugin installation switch:

switch(A.source){
  case"npm":await Qm8(A.package,I);break;
  case"github":await Gm8(A.repo,I,A.ref);break;
  case"url":await F1B(A.url,I,A.ref);break;
  ...
}

Neither function includes --recurse-submodules, so submodules are left uninitialized.

Suggested Fix

Add --recurse-submodules to both clone commands. With --depth 1, you may also want --shallow-submodules for efficiency:

let G=["clone","--depth","1","--recurse-submodules","--shallow-submodules"];

Alternatively, run git submodule update --init --recursive after cloning, though this would require an additional process spawn.

Workaround

Until fixed, users can manually initialize submodules after installation:

cd ~/.claude/plugins/marketplaces/<name>
git submodule update --init --recursive
github-actions[bot] · 6 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

discreteds · 6 months ago

This is still a required feature. Hopefully part of a broader support of git-based deployment patterns in CC, as also requested by https://github.com/anthropics/claude-code/issues/18659

discreteds · 6 months ago

Seems this was implemented in v2.1.7, according to #27251

github-actions[bot] · 5 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.