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.0.22 ·

Session Environment Hooks

Entry
JSON All of v2.0.22
EntryKind: in v2.0.22,
ChangesSection of the release

What: Shell environment can now be customized per session through hook scripts that persist throughout the session lifecycle.

How to use:

# SessionStart hooks can create environment files:
# Hook creates: ~/.claude/session-env/hook-1.sh

# Environment is automatically sourced before each Bash command
# Access the env file path via: $CLAUDE_ENV_FILE

Details:

  • Hook scripts stored in ~/.claude/session-env/hook-{N}.sh directories
  • Multiple hooks are concatenated and sourced in numerical order
  • SessionStart hooks receive CLAUDE_ENV_FILE environment variable pointing to persistent env file
  • Environment modifications persist for entire session across all Bash tool executions
  • Automatic cleanup of old session environment directories
  • Cache invalidation supported for dynamic updates
  • Evidence: bNA() at line 72216, Vh1() at line 247855, ia0() at line 454456

See this entry in the whole of v2.0.22 →

Feedback