Follow Discord
Sweep 22 Oct 2026 · 04:32Z Build v2.1.308 527 read Stable v2.1.308 Latest v2.1.308 Next v2.1.308 Feeds RSS JSON llms.txt llms-full.txt Unofficial

Claude Code v2.1.307 ·

Hooks can no longer set some environment variables

A hook's $.env.set is now refused for variables that only the starting environment or Claude Code itself may set

You'll notice Improvements
JSON All of v2.1.307
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.

See this entry in the whole of v2.1.307 →

Feedback