Plugin install fails with malformed marketplace path after marketplace remove/re-add in same session

Status Open
Reported on v2.1.220
Maintainer reply None cached
Activity 0 comments · opened Jul 28, 2026

Environment

  • Claude Code version: 2.1.220
  • Platform: macOS (Darwin 25.5.0)
  • Shell: zsh

Description

After removing and re-adding a plugin marketplace within the same interactive session, /plugin install fails from the plugin selection menu with a malformed path error:

Marketplace file not found at /Users/mcneill/.claude/plugins/marketplaces/epik-agent-Epik/Users/mcneill/Projects/Epik/Epik

The path is the sanitized marketplace source string (epik-agent/Epikepik-agent-Epik) joined with the current project directory (/Users/mcneill/Projects/Epik/Epik) — i.e. something like path.join(marketplacesDir, sanitizedSource, cwd). Neither component matches the actual install location.

Steps to reproduce

Inside an interactive session whose working directory is the marketplace's own source repo (which contains .claude-plugin/marketplace.json):

  1. /plugin marketplace update epik (marketplace previously registered from GitHub repo epik-agent/Epik)
  2. /plugin marketplace remove epik
  3. /plugin marketplace add epik-agent/Epik — succeeds, clones to ~/.claude/plugins/marketplaces/epik
  4. /plugin install epik@epik from the selection menu — fails with the error above

Expected behavior

The install should read the marketplace from its registered installLocation (~/.claude/plugins/marketplaces/epik), which is exactly what happens outside the session.

Evidence that on-disk state was healthy

  • ~/.claude/plugins/known_marketplaces.json had the correct entry: source github: epik-agent/Epik, installLocation ~/.claude/plugins/marketplaces/epik
  • That clone existed, was on the current head commit, and its .claude-plugin/marketplace.json was valid (plugin source ./plugin, relative)
  • The malformed path (epik-agent-Epik + project dir) appeared in no config file — only in session history, so it was computed at runtime from stale in-session state
  • Running claude plugin install epik@epik from a fresh CLI process succeeded immediately with no changes to any files

Suspected cause

Stale in-memory marketplace state after a remove/re-add cycle in the same session, with the path computed from the sanitized source argument and the session cwd instead of the registered installLocation. Possibly aggravated by the cwd itself being a marketplace source repo.

View original on GitHub ↗