This feature ensures that Claude Code inside a devcontainer reads and writes its configuration from the host machine's ~/.claude directory (and ~/.claude.json), regardless of what username is used inside the container.
It does NOT install Claude Code - use the official feature for that.
The problem it solves: Claude Code stores plugin and extension paths as absolute paths. When the host username differs from the container username, the home directory path changes (e.g. /home/alice vs /home/node), and any absolute paths persisted in config don't resolve inside the container.
How it works:
- The feature automatically bind-mounts
~/.claudefrom the host to/mnt/claude-dirinside the container, so the same config is shared, and bind-mounts~/.claude.jsonfrom the host to/mnt/claude-json. - A symlink is created at
{$localEnv:HOME}/.claude -> /mnt/claude-dirat container create time, so absolute paths stored by Claude Code resolve correctly even when the host and container usernames differ. This is needed until this issue is resolved: anthropics/claude-code#31388 - The install script creates
/mnt/claude-diras an empty directory owned by the container user, so Claude Code starts fresh with no error if the host~/.claudedirectory doesn't exist yet.
Add the feature to your devcontainer.json:
{
"features": {
"ghcr.io/exciton/devcontainer-features/claude-code-config-bind-mount:1": {}
}
}The bind mount is configured automatically by the feature — no mounts entry is needed.
/mnt/claude-dir will exist as an empty directory inside the container and Claude Code will start fresh with no persisted config. No error will occur — Claude Code will simply behave as if it has never been configured.
- ghcr.io/esimkowitz/devcontainer-features/claude-code-persistence : Mounts a shared volume across multiple devcontainers. Does not fix plugin paths.
- ghcr.io/sliekens/devcontainer-features/claude : Bind mounts (like this feature), but also installs Claude Code directly, and doesn't fix the plugin paths.