Chrome extension native messaging host ignores XDG_CONFIG_HOME
Description
The Claude in Chrome extension's native messaging host configuration is always installed to ~/.config/google-chrome/NativeMessagingHosts/ regardless of the XDG_CONFIG_HOME environment variable setting.
Environment
- Claude Code version: 2.1.19
- OS: Ubuntu 25.04 (native Linux, not WSL)
- Chrome version: 143.0.7499.109
Steps to Reproduce
- Set
XDG_CONFIG_HOMEto a custom directory (e.g.,export XDG_CONFIG_HOME=/custom/path) - Chrome will use
$XDG_CONFIG_HOME/google-chrome/as its data directory - Run
claude --chromeor use the Chrome settings menu to set up the extension - The native messaging host config is installed to
~/.config/google-chrome/NativeMessagingHosts/instead of$XDG_CONFIG_HOME/google-chrome/NativeMessagingHosts/
Expected Behavior
Claude Code should respect XDG_CONFIG_HOME when installing the native messaging host configuration file, installing it to:
$XDG_CONFIG_HOME/google-chrome/NativeMessagingHosts/com.anthropic.claude_code_browser_extension.json
Or fall back to ~/.config/google-chrome/NativeMessagingHosts/ only if XDG_CONFIG_HOME is not set.
Actual Behavior
The native messaging host config is always installed to ~/.config/google-chrome/NativeMessagingHosts/ regardless of XDG_CONFIG_HOME, causing the Chrome extension to fail to connect since Chrome cannot find the native messaging host.
Workaround
Manually copy the config file to the correct location:
cp ~/.config/google-chrome/NativeMessagingHosts/com.anthropic.claude_code_browser_extension.json $XDG_CONFIG_HOME/google-chrome/NativeMessagingHosts/
Then restart Chrome.
Additional Context
This affects users who use XDG_CONFIG_HOME to relocate their config directories (common for users with separate home partitions, NFS home directories, or those who want to keep config on faster storage).
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗