Chrome native host script uses non-portable shebang (breaks NixOS)
Resolved 💬 4 comments Opened Jan 10, 2026 by mweichert Closed Feb 27, 2026
Description
The Chrome native host wrapper script (~/.claude/chrome/chrome-native-host) is generated with #!/bin/bash as the shebang. This doesn't work on NixOS because /bin/bash doesn't exist.
Impact
- The Claude in Chrome browser extension fails to connect on NixOS
- Error displayed: "Browser extension is not connected"
- The native messaging host cannot be executed by the browser because the shebang path is invalid
Environment
- OS: NixOS (also affects other non-FHS systems like BSD, Guix, etc.)
- NixOS bash location:
/run/current-system/sw/bin/bash
Reproduction Steps
- Install Claude Code on NixOS
- Install the Claude browser extension
- Run
claudeand attempt to use browser integration - Observe "Browser extension is not connected" error
- Check the generated script:
head -1 ~/.claude/chrome/chrome-native-host
- Shows
#!/bin/bashwhich doesn't exist on NixOS
Proposed Fix
Change the shebang from:
#!/bin/bash
To the portable/POSIX-compliant form:
#!/usr/bin/env bash
This works on all systems including:
- Standard Linux distributions
- NixOS
- BSD variants
- macOS
- Any system with
envin/usr/bin/(which is essentially universal)
Workaround
Manually edit ~/.claude/chrome/chrome-native-host and change the first line to #!/usr/bin/env bash. However, this fix is overwritten when Claude regenerates the file.
Related
This was discovered while investigating issue #14391 (Chromium/Brave browser support), but is a separate bug specific to NixOS/non-FHS compatibility.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗