Plugin install with source-type git-subdir creates empty destination directory (subdir contents not copied)
Summary
When a plugin uses source: { source: "git-subdir", url: ..., path: ..., ref: ... } in its marketplace manifest, /plugin install creates the destination directory but does not populate it with the contents of the specified subdir. The marketplace itself loads fine (schema validation passes — distinct from already-resolved schema bugs in #33828, #36848, #40595, #33172, etc.).
This is downstream of the marketplace clone — that step works correctly here. The failure is in the plugin install step's subdir-copy phase.
Environment
- Claude Code v2.1.139
- macOS (Darwin 24.6.0, Apple Silicon)
- zsh
Repro
Marketplace manifest at https://github.com/FirstPersonSF/cp-engine (repo root) → .claude-plugin/marketplace.json:
{
"name": "cp-engine",
"version": "0.8.0",
"description": "Slash commands for the Context Protocol Engine.",
"owner": {
"name": "First Person + Canonic",
"url": "https://github.com/FirstPersonSF"
},
"plugins": [
{
"name": "cp-engine",
"description": "Capture development sessions back to the Context Protocol working tree.",
"author": { "name": "First Person + Canonic" },
"category": "development",
"source": {
"source": "git-subdir",
"url": "https://github.com/FirstPersonSF/cp-engine.git",
"path": "plugin",
"ref": "main"
},
"homepage": "https://github.com/FirstPersonSF/cp-engine"
}
]
}
The plugin/ subdir at the repo root contains:
plugin/
├── plugin.json
├── README.md
├── commands/
│ ├── cp-context.md
│ └── cp-summarize.md
└── hooks/
├── hooks.json
└── sync-cli-version.sh
Steps:
- Add the marketplace:
/plugin marketplace add FirstPersonSF/cp-engine - Install the plugin:
/plugin install cp-engine@cp-engine - Observe:
~/.claude/plugins/data/cp-engine-cp-engine/exists but is empty. - Reload plugins (
/plugin reload); the plugin's slash commands (/cp-context,/cp-summarize) do not appear.
Expected
After install, ~/.claude/plugins/data/cp-engine-cp-engine/ should contain the contents of the repo's plugin/ subdir at ref main — i.e. plugin.json, README.md, commands/, hooks/ — and the slash commands should be loaded.
Workaround
Manually clone the repo and copy the subdir contents:
git clone https://github.com/FirstPersonSF/cp-engine.git /tmp/cp-engine
cp -R /tmp/cp-engine/plugin/* ~/.claude/plugins/data/cp-engine-cp-engine/
Then /plugin reload. Commands appear correctly.
Why this seems to be a real install-flow bug, not a config issue
- The marketplace clone at
~/.claude/plugins/marketplaces/cp-engine/is populated correctly — the underlying git access works. - The same repo, same ref, manually cloned + copied, produces a fully functional plugin (verified — commands appear after
/plugin reload). - The destination directory is created during install (so the code path knows to do something); only the file copy is missing.
- Schema validation passes (no errors surfaced during install — distinct from prior
git-subdirschema bugs that produced explicit validation errors).
Related but distinct
- #45653 (marketplace git clones empty) — different layer; that's the registry clone failing. Here the registry succeeds; the plugin subdir copy fails.
- #33828 / #36848 / #40595 / #33172 — closed
git-subdirschema-validation bugs. Schema validation works for me; this is a runtime install-flow bug.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗