claude-code - 💡(How to fix) Fix [Bug] Plugin paths stored as absolute paths break cross-environment usage (devcontainers, multi-user setups) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#55594Fetched 2026-05-03 04:49:22
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×4commented ×1unlabeled ×1

Root Cause

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.

Fix Action

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.

Code Example

"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"
}

---

✘ typescript-lsp @ claude-plugins-official (user)
   Plugin "typescript-lsp" not found in marketplace "claude-plugins-official"

---

{
  "installPath": "/home/hostuser/.claude/plugins/cache/claude-plugins-official/typescript-lsp/1.0.0"
}

---

{
  "installLocation": "/home/hostuser/.claude/plugins/marketplaces/claude-plugins-official"
}

---

{
  "installPath": "${CLAUDE_CONFIG_DIR}/plugins/cache/claude-plugins-official/typescript-lsp/1.0.0"
}

---

{
  "installPath": "plugins/cache/claude-plugins-official/typescript-lsp/1.0.0"
}

---

"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"
}
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • 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 ~/.claude inside container, seeded from host ~/.claude on 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

  1. Install plugins on the host machine
  2. Open a project in a VS Code devcontainer with the setup above
  3. Start Claude Code inside the container
  4. 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.

extent analysis

TL;DR

The most likely fix is to store plugin paths relative to CLAUDE_CONFIG_DIR instead of as absolute filesystem paths.

Guidance

  • Update the installed_plugins.json and known_marketplaces.json files to store paths relative to CLAUDE_CONFIG_DIR, such as "installPath": "${CLAUDE_CONFIG_DIR}/plugins/cache/claude-plugins-official/typescript-lsp/1.0.0".
  • Alternatively, use a sed rewrite in the postCreateCommand to replace absolute paths with relative ones, as shown in the provided workaround.
  • Verify that the plugin paths are correctly resolved at runtime by checking the installed_plugins.json and known_marketplaces.json files inside the container.
  • Consider filing a new issue or reopening a previous one to push for a permanent fix, as this workaround may not be suitable for all environments.

Example

{
  "installPath": "${CLAUDE_CONFIG_DIR}/plugins/cache/claude-plugins-official/typescript-lsp/1.0.0"
}

Notes

The provided workaround using sed rewrite may not be the most elegant solution, but it can help mitigate the issue until a permanent fix is implemented. It's essential to verify that the plugin paths are correctly resolved at runtime to ensure that the workaround is effective.

Recommendation

Apply the workaround using sed rewrite in the postCreateCommand to replace absolute paths with relative ones, as it provides a temporary solution to the issue. However, it's crucial to continue pushing for a permanent fix that stores paths relative to CLAUDE_CONFIG_DIR.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [Bug] Plugin paths stored as absolute paths break cross-environment usage (devcontainers, multi-user setups) [1 comments, 2 participants]