Shell scripts use non-portable #!/bin/bash shebang

Resolved 💬 3 comments Opened Dec 31, 2025 by rhnvrm Closed Feb 14, 2026

Problem

Several shell scripts in the repository use #!/bin/bash as the shebang, which fails on systems where bash is not at /bin/bash.

Error Example (NixOS)

/bin/sh: .../stop-hook.sh: /bin/bash: bad interpreter: No such file or directory

Affected Systems

  • NixOS: bash at /run/current-system/sw/bin/bash
  • Guix: non-FHS layout
  • Any system without /bin/bash

Affected Files

Found 13 scripts with #!/bin/bash:

  • .devcontainer/init-firewall.sh
  • plugins/plugin-dev/skills/agent-development/scripts/validate-agent.sh
  • plugins/plugin-dev/skills/hook-development/examples/load-context.sh
  • plugins/plugin-dev/skills/hook-development/examples/validate-bash.sh
  • plugins/plugin-dev/skills/hook-development/examples/validate-write.sh
  • plugins/plugin-dev/skills/hook-development/scripts/hook-linter.sh
  • plugins/plugin-dev/skills/hook-development/scripts/test-hook.sh
  • plugins/plugin-dev/skills/hook-development/scripts/validate-hook-schema.sh
  • plugins/plugin-dev/skills/plugin-settings/examples/read-settings-hook.sh
  • plugins/plugin-dev/skills/plugin-settings/scripts/parse-frontmatter.sh
  • plugins/plugin-dev/skills/plugin-settings/scripts/validate-settings.sh
  • plugins/ralph-wiggum/hooks/stop-hook.sh
  • plugins/ralph-wiggum/scripts/setup-ralph-loop.sh

Solution

Change shebangs from #!/bin/bash to #!/usr/bin/env bash.

This is the portable POSIX standard that finds bash via PATH, working on NixOS, Guix, macOS, FreeBSD, and standard Linux distributions.

Environment

  • OS: NixOS (Linux 6.12.60-cachyos)
  • Claude Code Version: current

View original on GitHub ↗

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