[BUG] Claude Code generates invalid source type in known_marketplaces.json for local plugins
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When setting up local plugins, Claude Code writes "source": "local" to the marketplace config, but "local" is not a valid discriminator value (valid options are url, github, git, npm, file, directory)
Error: ConfigParseError: Invalid discriminator value. Expected 'url' | 'github' | 'git' | 'npm' | 'file' | 'directory'
Fix: Change "local" to "directory" with a path property
This is a self-inflicted crash which is particularly problematic since users can't easily use Claude Code to fix it when Claude Code won't start.
What Should Happen?
When setting up local plugins, Claude Code should generate valid configuration that allows it to start successfully.
Error Messages/Logs
071 | Reads a specific resource from an MCP server, identified by server name and resource URI.
1072 |
1073 | Parameters:
1074 | - server (required): The name of the MCP server from which to read the resource
1075 | - uri (required): The URI of the resource to read
1076 | `)$()}return AyT.trim(H)}Xc_.exports=nO7});var Kc_=V((aB$,Lc_)=>{var u6R=PWA(),aO7=Qc_(),nB$=yWA();function Zc_(T){return T===void 0||T===null}function rO7(T){var R={};for(var A in T)R[A]=T[A];return R}function Ec_(T){T=rO7(T||{}),T.whiteList=T.whiteList||u6R.whiteList,T.onAttr=T.onAttr||u6R.onAttr,T.onIgnoreAttr=T.onIgnoreAttr||u6R.onIgnoreAttr,T.safeAttrValue=T.safeAttrValue||u6R.safeAttrValue,this.options=T}Ec_.prototype.process=function(T){if(T=T||"",T=T.toString(),!T)return"";var R=this,A=R.options,=A.whiteList,B=A.onAttr,D=A.onIgnoreAttr,H=A.safeAttrValue,$=aO7(T,function(C,q,G,W,J){var O=[G],I=!1;if(O===!0)I=O;else if(typeof O==="function")I=O(W);else if(O instanceof RegExp)I=O.test(W);if(I!==!0)I=!1;if(W=H(G,W),!W)return;var X={position:q,sourcePosition:C,source:J,isWhite:I};if(I){var Q=B(G,W,X);if(Zc_(Q))return G+":"+W;else return Q}else{var Q=D(G,W,X);if(!Zc_(Q))return Q}});return $};Lc_.exports=Ec_});var d6R=V((m6R,kWA)=>{var Nc_=PWA(),Yc_=Kc_();function oO7(T,R){var A=new Yc_(R);return A.process | ... truncated
ConfigParseError: Marketplace configuration file is corrupted: local-plugins.source.source: Invalid discriminator value. Expected 'url' | 'github' | 'git' | 'npm' | 'file' | 'directory'
filePath: "/Users/iaco/.claude/plugins/known_marketplaces.json",
defaultConfig: {
"claude-plugins-official": [Object ...],
"local-plugins": [Object ...],
},
at aH (/$bunfs/root/claude:1076:61304)
at aH (/$bunfs/root/claude:1076:61497)
at QN7 (/$bunfs/root/claude:1136:5454)
at QN7 (/$bunfs/root/claude:1136:6027)
at <anonymous> (/$bunfs/root/claude:1136:14801)
at <anonymous> (/$bunfs/root/claude:1136:15163)
at A (/$bunfs/root/claude:11:6978)
at gP (/$bunfs/root/claude:1136:21986)
at gP (/$bunfs/root/claude:1136:23043)
at <anonymous> (/$bunfs/root/claude:5025:810)
Bun v1.3.5 (macOS arm64)
iaco@Iacopos-Mac-mini broker-hub % claude
1071 | Reads a specific resource from an MCP server, identified by server name and resource URI.
1072 |
1073 | Parameters:
1074 | - server (required): The name of the MCP server from which to read the resource
1075 | - uri (required): The URI of the resource to read
1076 | `)$()}return AyT.trim(H)}Xc_.exports=nO7});var Kc_=V((aB$,Lc_)=>{var u6R=PWA(),aO7=Qc_(),nB$=yWA();function Zc_(T){return T===void 0||T===null}function rO7(T){var R={};for(var A in T)R[A]=T[A];return R}function Ec_(T){T=rO7(T||{}),T.whiteList=T.whiteList||u6R.whiteList,T.onAttr=T.onAttr||u6R.onAttr,T.onIgnoreAttr=T.onIgnoreAttr||u6R.onIgnoreAttr,T.safeAttrValue=T.safeAttrValue||u6R.safeAttrValue,this.options=T}Ec_.prototype.process=function(T){if(T=T||"",T=T.toString(),!T)return"";var R=this,A=R.options,=A.whiteList,B=A.onAttr,D=A.onIgnoreAttr,H=A.safeAttrValue,$=aO7(T,function(C,q,G,W,J){var O=[G],I=!1;if(O===!0)I=O;else if(typeof O==="function")I=O(W);else if(O instanceof RegExp)I=O.test(W);if(I!==!0)I=!1;if(W=H(G,W),!W)return;var X={position:q,sourcePosition:C,source:J,isWhite:I};if(I){var Q=B(G,W,X);if(Zc_(Q))return G+":"+W;else return Q}else{var Q=D(G,W,X);if(!Zc_(Q))return Q}});return $};Lc_.exports=Ec_});var d6R=V((m6R,kWA)=>{var Nc_=PWA(),Yc_=Kc_();function oO7(T,R){var A=new Yc_(R);return A.process | ... truncated
ConfigParseError: Marketplace configuration file is corrupted: local-plugins.source.source: Invalid discriminator value. Expected 'url' | 'github' | 'git' | 'npm' | 'file' | 'directory'
filePath: "/Users/iaco/.claude/plugins/known_marketplaces.json",
defaultConfig: {
"claude-plugins-official": [Object ...],
"local-plugins": [Object ...],
},
at aH (/$bunfs/root/claude:1076:61304)
at aH (/$bunfs/root/claude:1076:61497)
at QN7 (/$bunfs/root/claude:1136:5454)
at QN7 (/$bunfs/root/claude:1136:6027)
at <anonymous> (/$bunfs/root/claude:1136:14801)
at <anonymous> (/$bunfs/root/claude:1136:15163)
at A (/$bunfs/root/claude:11:6978)
at gP (/$bunfs/root/claude:1136:21986)
at gP (/$bunfs/root/claude:1136:23043)
at <anonymous> (/$bunfs/root/claude:5025:810)
Steps to Reproduce
Ask Claude Code to help troubleshoot why local plugin commands aren't working
Claude Code attempts to fix the marketplace configuration by editing ~/.claude/plugins/known_marketplaces.json
Claude Code writes an invalid source type ("source": "local") instead of a valid one ("source": "directory")
Restart Claude Code
Claude Code fails to start with ConfigParseError: Invalid discriminator value
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
You're running Claude Code v2.0.73 - the latest version.
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗