CLAUDE_CODE_EMIT_STOP_HOOK_EVENTS
Updated by Alex Sorokoletov
CLAUDE_CODE_EMIT_STOP_HOOK_EVENTS is a Claude Code environment variable. Added in v2.1.334 and still present in v2.1.337. It is not in the official reference.
| Status | Present in v2.1.337 |
|---|---|
| Added | Added in v2.1.334 |
| Category | Other |
| Official docs | Not listed |
How to set it
For one session, export it in the shell that starts Claude Code:
export CLAUDE_CODE_EMIT_STOP_HOOK_EVENTS=<value>
claudeTo apply it to every session, add it to the env object of a settings file:
// ~/.claude/settings.json
{
"env": {
"CLAUDE_CODE_EMIT_STOP_HOOK_EVENTS": "<value>"
}
}Related variables
CLAUDE_CODE_EMIT_USER_PROMPT_SUBMIT_HOOK_EVENTS: When set, enables emitting start and end hook events for user prompt submission; the value is read once and then cleared.CLAUDE_CODE_STOP_HOOK_BLOCK_CAP: Cap how long a stop hook can block session termination.CLAUDE_CODE_CONFIG_WATCH_EVENTS: On Linux, when set, watches config files with filesystem events instead of interval polling; ignored on other platforms.CLAUDE_CODE_EMIT_STARTUP_TIMING: When set, emits startup timing phase metrics, which are also emitted in remote mode; otherwise they are not reported.CLAUDE_CODE_EXIT_AFTER_STOP_DELAY: Delay before exit after stop signal (ms).CLAUDE_CODE_HOOK_HEARTBEAT_INTERVAL_MS: Sets the interval of the hook progress heartbeat.CLAUDE_CODE_STOP_HOLD_SECONDS: In remote sessions, sets the number of seconds the session holds at stop while notifications are still pending.CLAUDE_CODE_PARKED_STOP_RETIRES
Frequently asked questions
Which Claude Code version has CLAUDE_CODE_EMIT_STOP_HOOK_EVENTS?
Added in v2.1.334 and still present in v2.1.337.
How do I set CLAUDE_CODE_EMIT_STOP_HOOK_EVENTS?
Export it before starting Claude Code (export CLAUDE_CODE_EMIT_STOP_HOOK_EVENTS=value), or add it to the "env" object in ~/.claude/settings.json to apply it to every session.
All variables, searchable: Claude Code environment variables.