Hook scripts fail on NixOS: hardcoded #!/bin/bash shebang not found

Open Beginner friendly
#60 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
bash, shell
Domain
tooling

Research direction

Start by inspecting the listed .sh files under scripts/ and scripts/legacy/ and verify their current shebangs. Update the affected scripts to use the portable bash shebang, then check that every shell script in those directories no longer references /bin/bash.

Written by the indexing model from the issue text.

Description

Summary

All hook scripts in the plugin use #!/bin/bash as their shebang. On NixOS (and other non-FHS Linux distros), /bin/bash does not exist — bash lives in the Nix store and is only reachable via $PATH. This causes every hook to fail at startup with:

PostToolUse:Bash hook error
Failed with non-blocking status code: /bin/sh: /path/to/scripts/on-post-tool-use.sh: /bin/bash: bad interpreter: No such file or directory

Affected files

All .sh scripts under scripts/ and scripts/legacy/:

  • on-post-tool-use.sh
  • on-session-start.sh
  • on-prompt-submit.sh
  • on-stop.sh
  • on-permission-request.sh
  • on-notification.sh
  • build-payload.sh
  • emit-terminal-sequence.sh
  • should-use-structured.sh
  • warp-notify.sh
  • legacy/on-session-start.sh
  • legacy/on-stop.sh
  • legacy/on-notification.sh
  • legacy/warp-notify.sh

Fix

Replace #!/bin/bash with #!/usr/bin/env bash in all scripts. /usr/bin/env is available on NixOS (and is the standard portable shebang for bash scripts on non-FHS systems).

find scripts/ -name "*.sh" | xargs sed -i 's|^#!/bin/bash|#!/usr/bin/env bash|'

Environment

  • OS: NixOS (non-FHS filesystem — no /bin/bash)
  • Claude Code: latest
  • Plugin: claude-code-warp 2.1.0
Dominant language
Shell
Stars
231
Forks
56
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from warpdotdev/claude-code-warp

All issues in warpdotdev/claude-code-warp

Similar issues

More Shell/Bash issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.