Plugin marketplace update creates literal ~ folders instead of expanding tilde

Resolved 💬 3 comments Opened Jan 30, 2026 by m-ghalib Closed Feb 2, 2026

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

  1. Have marketplaces configured (either via claude plugin marketplace add or default setup)
  2. Navigate to any directory (e.g., cd ~/.claude/agents)
  3. Run claude plugin marketplace update
  4. 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:

  1. When reading known_marketplaces.json
  2. When storing paths in known_marketplaces.json (normalize to absolute paths)
  3. 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.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗