Plugin harness resolves skill base directory to marketplaces/ instead of cache/ path
Bug
The plugin harness resolves a skill's base directory to ~/.claude/plugins/marketplaces/<repo>/ instead of the installPath recorded in ~/.claude/plugins/installed_plugins.json (which points to ~/.claude/plugins/cache/).
Observed behavior
When invoking a plugin skill (e.g. /kk:document), the harness injects a "Base directory" that points to the marketplaces path:
Base directory for this skill: ~/.claude/plugins/marketplaces/claude-toolbox/klaude-plugin/skills/document
But installed_plugins.json records the plugin's install path under cache:
{
"plugins": {
"kk@claude-toolbox": [
{
"scope": "project",
"installPath": "~/.claude/plugins/cache/claude-toolbox/kk/0.17.3",
"version": "0.17.3"
}
]
}
}
The agent then uses the marketplaces path for all subsequent Read calls within that skill invocation. This means ${CLAUDE_PLUGIN_ROOT} (substituted at plugin-load time) may resolve to a different directory than what installed_plugins.json reports.
Expected behavior
The harness should resolve the skill's base directory consistently — ideally to the installPath recorded in installed_plugins.json.
Impact
- LLMs that need the plugin root at runtime (outside of
${CLAUDE_PLUGIN_ROOT}substitution context) have no single reliable source for the path. They sometimes derivecache/and sometimesmarketplaces/, leading toENOENTerrors or reading stale content. - Hook scripts that reference
${CLAUDE_PLUGIN_ROOT}may resolve to a different location than runtimeReadcalls within the same session.
Environment
- Claude Code CLI (latest stable as of 2026-06-01)
- Plugin installed via:
claude plugin install kk@claude-toolbox --scope project - OS: Linux
This issue is created by claude-code from a session where I observed that it read from marketplaces:
❯ I noticed when you were running document skill you also read from 'marketplace' dir. Why is that?
Ha — that's the exact problem you're fixing, caught in the wild. Look at the skill's base directory from that invocation:
Base directory for this skill: /home/sergio/.claude/plugins/marketplaces/claude-toolbox/klaude-plugin/skills/document
But installed_plugins.json says the install path is:
/home/sergio/.claude/plugins/cache/claude-toolbox/kk/0.17.3
The harness loaded the skill from marketplaces/ instead of cache/. That's the inconsistency your PR is addressing — and it happened right in front of us during this session.
✻ Brewed for 11s
❯ So you're saying the current harness points you to marketplaces?
Yes — that's what the skill-load output showed. The harness handed me this as the base directory:
/home/sergio/.claude/plugins/marketplaces/claude-toolbox/klaude-plugin/skills/document
And that's the path I used for the Read call to shared-profile-detection.md. I didn't choose it — the harness resolved it there.
Meanwhile installed_plugins.json records the install at /home/sergio/.claude/plugins/cache/claude-toolbox/kk/0.17.3.
So it's not just LLMs guessing wrong — the harness itself is pointing to two different locations depending on the context.This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗