Claude Code now reads a hook script's #! line to decide if its interpreter is safe to run in a cloud or remote session, not just its declared interpreter
What
When deciding whether a hook script is safe to run in a cloud or remote ("teleported") session, Claude Code previously relied on a declared interpreter. Now, if no interpreter is declared, it reads the script's own shebang (#!) line and parses it with a new parser.
The parsed interpreter is classified as one of:
- an absolute path
- an env-resolved program (via
/usr/bin/env-style invocation) - cwd-relative
- "unjudgeable" — for example a relative interpreter, an env invocation with extra options, or an interpreter that itself takes a file argument
If the interpreter can't be confidently classified as safe (is "unjudgeable" or not a plain absolute path/known env-based form), Claude Code withholds the hook from running and shows a more detailed explanation of what interpreters and options are acceptable.
Why
A script's shebang line determines what actually runs it, so checking only a separately declared interpreter left room for a mismatched or unsafe interpreter to run unnoticed in cloud sessions. Parsing the shebang directly closes that gap.