Plugin marketplace update creates literal ~ folders instead of expanding tilde
Bug Description
The claude plugin marketplace update command creates literal ~ directories in the current working directory instead of expanding ~ to the user's home directory.
Environment
- Claude Code Version: 2.1.25
- OS: macOS (Darwin 25.2.0)
Steps to Reproduce
- Have marketplaces configured (either via
claude plugin marketplace addor default setup) - Navigate to any directory (e.g.,
cd ~/.claude/agents) - Run
claude plugin marketplace update - Check for a literal
~folder:ls -la | grep '~'
Expected Behavior
The marketplace should update in $HOME/.claude/plugins/marketplaces/ regardless of current working directory.
Actual Behavior
A literal folder named ~ is created in the current directory, containing the full path structure:
./~/.claude/plugins/marketplaces/claude-plugins-official/
./~/.claude/plugins/marketplaces/context-engineering-marketplace/
These are full git clones (~9MB+), duplicating the actual marketplaces.
Root Cause
The known_marketplaces.json file stores paths with ~:
{
"claude-plugins-official": {
"installLocation": "~/.claude/plugins/marketplaces/claude-plugins-official"
}
}
When the CLI reads these paths, it does not expand ~ to the home directory before performing file operations (git clone, mkdir, etc.).
Workaround
Manually edit ~/.claude/plugins/known_marketplaces.json and replace all ~ with the absolute path:
{
"claude-plugins-official": {
"installLocation": "/Users/username/.claude/plugins/marketplaces/claude-plugins-official"
}
}
Suggested Fix
The CLI should expand ~ (and potentially $HOME) in paths read from config files before using them for file operations. This could be done:
- When reading
known_marketplaces.json - When storing paths in
known_marketplaces.json(normalize to absolute paths) - Before any filesystem operation that uses these paths
Additional Context
This also affects git staging - the literal ~ folders can accidentally be staged as gitlinks (submodules) if git add is run, causing confusion in version control.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗