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

  1. Install Claude Code on NixOS
  2. Install the Claude browser extension
  3. Run claude and attempt to use browser integration
  4. Observe "Browser extension is not connected" error
  5. Check the generated script: head -1 ~/.claude/chrome/chrome-native-host
  • Shows #!/bin/bash which 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 env in /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.

View original on GitHub ↗

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