claude-code - 💡(How to fix) Fix Bug: /plugin marketplace add writes trailing comma in known_marketplaces.json, breaking subsequent runs

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…

When adding a marketplace via /plugin marketplace add, Claude Code appends a trailing comma after the last entry in ~/.claude/plugins/known_marketplaces.json. This makes the file invalid JSON, causing all subsequent /plugin marketplace add calls to fail.

Error Message

Error: Failed to load marketplace configuration: JSON Parse error: Property name must be a string literal

Root Cause

Root Cause (suspected)

Fix Action

Workaround

Manually remove the trailing comma from ~/.claude/plugins/known_marketplaces.json.

Code Example

Error: Failed to load marketplace configuration: JSON Parse error: Property name must be a string literal

---

{
  "some-marketplace": { ... },
  "last-marketplace": { ... },   <-- trailing comma
}
RAW_BUFFERClick to expand / collapse

Description

When adding a marketplace via /plugin marketplace add, Claude Code appends a trailing comma after the last entry in ~/.claude/plugins/known_marketplaces.json. This makes the file invalid JSON, causing all subsequent /plugin marketplace add calls to fail.

Steps to Reproduce

  1. Add one or more marketplaces using /plugin marketplace add <url>
  2. Check ~/.claude/plugins/known_marketplaces.json — the last entry has a trailing comma
  3. Run /plugin marketplace add <another-url> again

Expected Behavior

The command succeeds.

Actual Behavior

Error: Failed to load marketplace configuration: JSON Parse error: Property name must be a string literal

Root Cause (suspected)

The code that writes known_marketplaces.json appends entries with a trailing comma, producing invalid JSON like:

{
  "some-marketplace": { ... },
  "last-marketplace": { ... },   <-- trailing comma
}

Workaround

Manually remove the trailing comma from ~/.claude/plugins/known_marketplaces.json.

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