You'll notice
Claude Code now detects many more ways a hook script could break if run from a different folder
What
Claude Code can warn when a hook (a shell command that runs automatically at certain points, configured via plugins or settings) implicitly depends on the folder it's launched from, which can make it fail when run elsewhere. This detection was substantially expanded:
- it now strips hidden NUL bytes before decoding the script
- it recognizes more shells:
ash,ksh,mksh,rbash, andfish - it separates the shebang line (the
#!/bin/...line that names the shell) from the rest of the script for more accurate analysis - it adds a check specific to the
cshshell forset path = (...)lines that contain relative or.(current directory) entries - it detects relative file includes pulled in via
make includeorawk @include
Why
Hooks that quietly rely on the current working directory can fail unpredictably when Claude Code runs them from a different location. Catching more of these cases means more accurate warnings before a hook silently breaks.