[BUG] Launching chrome native host fails on NixOS due to hardcoded path
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
- Launch Chrome on a NixOS machine
- Install Claude in Chrome if it isn't.
- Launch Claude Code
- Ask it to do something in Chrome
- :'(
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_
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗