[Bug] Plugin paths stored as absolute paths break cross-environment usage (devcontainers, multi-user setups)
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?
Bug Description
Plugin configuration files (installed_plugins.json and known_marketplaces.json) store absolute paths based on the host machine's username. When sharing ~/.claude between a host and devcontainers (where the container user differs from the host user), all plugins fail to load because the hardcoded paths don't exist in the container.
Environment
- Claude Code version: 2.1.126
- OS: Linux (Debian 12 host, Debian 12 devcontainer)
- Host user:
hostuser(home:/home/hostuser) - Container user:
vscode(home:/home/vscode) - Setup: Named Docker volume for
~/.claudeinside container, seeded from host~/.claudeon container creation
Setup
devcontainer.json mounts the host ~/.claude read-only to a staging path, then copies it into a named volume on container creation:
"mounts": [
"source=${localEnv:HOME}/.claude,target=/tmp/claude-host,type=bind,readonly",
"source=devcontainer-claude-code-config,target=/home/vscode/.claude,type=volume"
],
"containerEnv": {
"CLAUDE_CONFIG_DIR": "/home/vscode/.claude",
"HOST_HOME": "${localEnv:HOME}"
},
"postCreateCommand": {
"setup-claude": "sudo chown -R vscode:vscode /home/vscode/.claude && cp -r /tmp/claude-host/. /home/vscode/.claude/ 2>/dev/null || true"
}
This is the recommended pattern for sharing Claude state across devcontainers while keeping the host safe from accidental writes.
Observed Behavior
All plugins fail to load with errors like:
✘ typescript-lsp @ claude-plugins-official (user)
Plugin "typescript-lsp" not found in marketplace "claude-plugins-official"
Inspecting installed_plugins.json inside the container reveals the root cause — all installPath values are hardcoded to the host user's home directory:
{
"installPath": "/home/hostuser/.claude/plugins/cache/claude-plugins-official/typescript-lsp/1.0.0"
}
The same issue affects known_marketplaces.json:
{
"installLocation": "/home/hostuser/.claude/plugins/marketplaces/claude-plugins-official"
}
Inside the container, these paths don't exist — the correct paths would use /home/vscode/ instead of /home/hostuser/.
Expected Behavior
Plugin paths should be stored relative to CLAUDE_CONFIG_DIR or $HOME, and resolved at runtime — not stored as absolute paths baked to a specific username. For example:
{
"installPath": "${CLAUDE_CONFIG_DIR}/plugins/cache/claude-plugins-official/typescript-lsp/1.0.0"
}
Or simply resolved relative to the config directory:
{
"installPath": "plugins/cache/claude-plugins-official/typescript-lsp/1.0.0"
}
Workaround
Pass the host home directory into the container via containerEnv and use it in the sed rewrite:
"containerEnv": {
"CLAUDE_CONFIG_DIR": "/home/vscode/.claude",
"HOST_HOME": "${localEnv:HOME}"
},
"postCreateCommand": {
"setup-claude": "sudo chown -R vscode:vscode /home/vscode/.claude && cp -r /tmp/claude-host/. /home/vscode/.claude/ 2>/dev/null || true && sed -i \"s|${HOST_HOME}/.claude|/home/vscode/.claude|g\" /home/vscode/.claude/plugins/installed_plugins.json /home/vscode/.claude/plugins/known_marketplaces.json /home/vscode/.claude/settings.json"
}
${localEnv:HOME} is supported in containerEnv, so HOST_HOME resolves to the host home directory at container creation time and can be referenced as $HOST_HOME in shell commands. This avoids hardcoding any username, but it is still an ugly workaround that shouldn't be necessary.
Steps to Reproduce
- Install plugins on the host machine
- Open a project in a VS Code devcontainer with the setup above
- Start Claude Code inside the container
- Observe plugin errors on startup
Claude Model
None
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.1.126
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
VS Code integrated terminal
Additional Information
Prior Issues
This has been reported multiple times and closed as duplicate or stale without a fix:
- #10379 — Plugin marketplace paths hardcoded as absolute paths, breaking devcontainer usage (closed as not planned)
- #15717 — Plugin paths hardcoded with absolute paths fail across environments (closed as duplicate)
- #20676 — Plugin paths hardcoded to /root, breaks non-root users (closed as duplicate)
- #21916 — Plugin marketplace paths hardcoded as absolute paths, breaking devcontainer usage on Windows (closed)
The fix is straightforward: store paths relative to CLAUDE_CONFIG_DIR rather than as absolute filesystem paths.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗