Chrome extension native messaging host ignores XDG_CONFIG_HOME

Resolved 💬 4 comments Opened Jan 26, 2026 by zakir0101 Closed Feb 28, 2026

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

  1. Set XDG_CONFIG_HOME to a custom directory (e.g., export XDG_CONFIG_HOME=/custom/path)
  2. Chrome will use $XDG_CONFIG_HOME/google-chrome/ as its data directory
  3. Run claude --chrome or use the Chrome settings menu to set up the extension
  4. 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).

View original on GitHub ↗

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