You'll noticeTier: how much it should matter to you
2Useful: my rating, 1 to 5
2Signal: worth watching, 1 to 5
HooksArea: what it touches
ImprovementsKind: in v2.1.307,
ImprovementsSection of the release
Unclear It is not stated which variables count as ones only the starting environment or Claude Code may set.
What
A hook is a script you set up to run at certain points while Claude Code works. Hooks can set environment variables, the settings passed to programs when they start, with $.env.set. Claude Code now refuses that for variables that only the environment Claude Code starts with, or Claude Code itself, may set. The error says so in those words. Before, the only check was against the list of variable writes found in the hook.
Why
Some hooks that set environment variables without trouble before will now get an error.
How sure we are
Something disagreesSomething we can check disagrees with this entry, or the writer said they could not settle it.
The writer flagged doubtIt is not stated which variables count as ones only the starting environment or Claude Code may set.