Unclear It is not confirmed that the token actually reaches hooks' environment in practice.
What
Hooks are your own commands that Claude Code runs at set moments, such as before a tool runs. In some remote sessions, Claude Code can now hand CLAUDE_CODE_SESSION_ACCESS_TOKEN to command hooks. This happens only when all of these hold:
CLAUDE_CODE_WORKER_EPOCHis1.- A check on the host machine passes.
- Neither project settings nor local settings are in use.
Claude Code also now marks a hook that runs synchronously when the same hook appears in the settings passed in on the command line for that event.
Why
This gives hooks access to a session token, which is worth knowing when you review what your hooks can see and do.
Names in the bundleCLAUDE_CODE_SESSION_ACCESS_TOKEN
Documented inclaude-code/self-hosted-environments-configuration
Something disagreesSomething we can check disagrees with this entry, or the writer said they could not settle it.
The writer flagged doubt
It is not confirmed that the token actually reaches hooks' environment in practice.