[BUG] Launching chrome native host fails on NixOS due to hardcoded path

Resolved 💬 6 comments Opened Dec 23, 2025 by enolan Closed Feb 25, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

On NixOS, bash is not actually available in /bin/bash, so scripts with hardcoded shebang lines like #!/bin/bash will fail. When you start Chrome with the Claude in Chrome extension installed, it runs ~/.claude/chrome/chrome-native-host which contains:

#!/bin/bash
# Chrome native host wrapper script
# Generated by Claude Code - do not edit manually
exec "/nix/store/hkvwiwp6vdy0z1yqq5giinvbxj4h8516-nodejs-24.11.1/bin/node" "/home/enolan/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js" --chrome-native-host

(modulo your system's paths)
And (on NixOS) you get:

LaunchProcess: failed to execvp:
/home/enolan/.claude/chrome/chrome-native-host

in Chrome's stderr. Of course, if you're launching chrome from the GUI like a normal person, it fails silently.

The UNIX socket never gets created and Claude Code can't connect to Chrome. Fix is simple: replace #!/bin/bash with #!/usr/bin/env bash. That should work everywhere.

What Should Happen?

The host should launch and the socket should be created.

Error Messages/Logs

Steps to Reproduce

  1. Launch Chrome on a NixOS machine
  2. Install Claude in Chrome if it isn't.
  3. Launch Claude Code
  4. Ask it to do something in Chrome
  5. :'(

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.0.76

Platform

Anthropic API

Operating System

Other Linux

Terminal/Shell

Other

Additional Information

_No response_

View original on GitHub ↗

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