claude-code - 💡(How to fix) Fix [BUG] extraKnownMarketplaces directory source resolves against main repo root instead of worktree root [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#49669Fetched 2026-04-17 08:34:40
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

Error Message

Error Messages/Logs

Code Example

❯ test-local (project)
      Marketplace file not found at /private/tmp/worktree-plugin-bug/main-repo/.claude-plugins/.claude-plugin/marketplace.json

   ✘ hello-plugin @ test-local (project)
      Plugin "hello-plugin" not found in marketplace "test-local"
      Plugin may not exist in marketplace "test-local"

---

mkdir /tmp/worktree-plugin-bug && cd /tmp/worktree-plugin-bug
git init main-repo && cd main-repo
git commit --allow-empty -m "init"
git worktree add ../worktree -b test-branch
cd ../worktree

---

mkdir -p .claude-plugins/.claude-plugin
mkdir -p .claude-plugins/hello-plugin/.claude-plugin

cat > .claude-plugins/.claude-plugin/marketplace.json << 'EOF'
{
  "name": "test-local",
  "owner": { "name": "Test", "email": "[email protected]" },
  "metadata": { "description": "Test local marketplace" },
  "plugins": [
    { "name": "hello-plugin", "source": "./hello-plugin" }
  ]
}
EOF

cat > .claude-plugins/hello-plugin/.claude-plugin/plugin.json << 'EOF'
{
  "name": "hello-plugin",
  "version": "1.0.0",
  "description": "Test plugin"
}
EOF

---

mkdir -p .claude
cat > .claude/settings.json << 'EOF'
{
  "extraKnownMarketplaces": {
    "test-local": {
      "source": {
        "source": "directory",
        "path": ".claude-plugins"
      }
    }
  },
  "enabledPlugins": {
    "hello-plugin@test-local": true
  }
}
EOF
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

When running Claude Code from a manually created git worktree, the extraKnownMarketplaces setting with a relative "path" resolves against the main repository root instead of the current worktree root. This causes local plugin marketplaces to fail to load.

The path resolves from the main repo root: Marketplace file not found at /path/to/main-repo/.claude-plugins/.claude-plugin/marketplace.json

What Should Happen?

The relative path .claude-plugins resolves from the worktree root, loading the marketplace at <worktree>/.claude-plugins/.claude-plugin/marketplace.json.

Error Messages/Logs

❯ test-local (project)
      Marketplace file not found at /private/tmp/worktree-plugin-bug/main-repo/.claude-plugins/.claude-plugin/marketplace.json

   ✘ hello-plugin @ test-local (project)
      Plugin "hello-plugin" not found in marketplace "test-local"
      Plugin may not exist in marketplace "test-local"

Steps to Reproduce

  1. Create a test repo and a worktree:
mkdir /tmp/worktree-plugin-bug && cd /tmp/worktree-plugin-bug
git init main-repo && cd main-repo
git commit --allow-empty -m "init"
git worktree add ../worktree -b test-branch
cd ../worktree
  1. Create a local marketplace with one plugin
mkdir -p .claude-plugins/.claude-plugin
mkdir -p .claude-plugins/hello-plugin/.claude-plugin

cat > .claude-plugins/.claude-plugin/marketplace.json << 'EOF'
{
  "name": "test-local",
  "owner": { "name": "Test", "email": "[email protected]" },
  "metadata": { "description": "Test local marketplace" },
  "plugins": [
    { "name": "hello-plugin", "source": "./hello-plugin" }
  ]
}
EOF

cat > .claude-plugins/hello-plugin/.claude-plugin/plugin.json << 'EOF'
{
  "name": "hello-plugin",
  "version": "1.0.0",
  "description": "Test plugin"
}
EOF
  1. Configure Claude to use it
mkdir -p .claude
cat > .claude/settings.json << 'EOF'
{
  "extraKnownMarketplaces": {
    "test-local": {
      "source": {
        "source": "directory",
        "path": ".claude-plugins"
      }
    }
  },
  "enabledPlugins": {
    "hello-plugin@test-local": true
  }
}
EOF
  1. Launch claude from the worktree claude /plugin and tab across to errors

Symlinking the marketplace into main-repo makes the plugin load successfully.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.112 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

No response

extent analysis

TL;DR

The issue can be fixed by changing the relative path in the extraKnownMarketplaces setting to an absolute path that points to the worktree root.

Guidance

  • The problem arises because the relative path .claude-plugins is resolved against the main repository root instead of the current worktree root.
  • To verify the issue, create a test repo and worktree, and configure Claude to use a local marketplace with a relative path.
  • To mitigate the issue, try using an absolute path in the extraKnownMarketplaces setting, such as /path/to/worktree/.claude-plugins.
  • Consider symlinking the marketplace into the main repo as a temporary workaround, as it has been reported to make the plugin load successfully.

Example

No code snippet is provided, as the issue is related to configuration and path resolution.

Notes

The root cause of the issue is likely due to the way Claude Code resolves relative paths in the extraKnownMarketplaces setting. The fix should involve changing the path resolution to use the worktree root instead of the main repository root.

Recommendation

Apply a workaround by using an absolute path in the extraKnownMarketplaces setting, as this has been reported to resolve the issue. This is a temporary solution until the root cause is fully understood and addressed.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] extraKnownMarketplaces directory source resolves against main repo root instead of worktree root [1 comments, 2 participants]