[BUG] Marketplace refresh fails on macOS - uses hardcoded /home/claude path instead of actual HOME

Resolved 💬 3 comments Opened Jan 8, 2026 by GraemeF Closed Feb 22, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report
  • [x] I am using the latest version of Claude Code

What's Wrong?

When Claude Code attempts to refresh the official marketplace on macOS, it fails because it uses /home/claude as the home directory path instead of the actual user's home directory (/Users/username).

What Should Happen?

Claude Code should use the correct macOS home directory path (/Users/username/.claude/plugins/marketplaces/...) when refreshing marketplaces.

Error Messages/Logs

Failed to refresh marketplace 'claude-plugins-official': Failed to clone marketplace repository: fatal: could not create leading directories of '/home/claude/.claude/plugins/marketplaces/claude-plugins-official': Operation not supported

Steps to Reproduce

  1. Install Claude Code via npm-local on macOS
  2. Run Claude Code
  3. Observe the marketplace refresh error on startup (or run /plugins marketplace refresh)

Is this a regression?

I don't know

Claude Code Version

2.1.1

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Warp

Additional Information

Diagnostics:

Currently running: npm-local (2.1.1)
Path: /Users/username/.local/share/mise/installs/node/24.11.0/bin/node
Invoked: /Users/username/.claude/local/node_modules/.bin/claude
Config install method: local
Auto-updates: enabled
Search: OK (vendor)

Root Cause Analysis:

The HOME environment variable is properly set in the user's shell (HOME=/Users/username), but when commands are run inside Claude Code's sandbox, HOME appears to be empty or unset.

When the marketplace refresh code can't find HOME, it falls back to a hardcoded /home/claude path - which is a Linux-style path that doesn't exist and can't be created on macOS.

Claude Code should use os.homedir() in Node.js or properly inherit the HOME environment variable from the parent shell.

View original on GitHub ↗

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