CLAUDE_CODE_EMIT_STARTUP_TIMING
Updated by Alex Sorokoletov
CLAUDE_CODE_EMIT_STARTUP_TIMING is a Claude Code environment variable: When set, emits startup timing phase metrics, which are also emitted in remote mode; otherwise they are not reported. Added between v2.1.269 and v2.1.283 and still present in v2.1.318. It is not in the official reference.
| Status | Present in v2.1.318 |
|---|---|
| Added | Added between v2.1.269 and v2.1.283 |
| 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_STARTUP_TIMING=<value>
claudeTo apply it to every session, add it to the env object of a settings file:
// ~/.claude/settings.json
{
"env": {
"CLAUDE_CODE_EMIT_STARTUP_TIMING": "<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_FRAME_TIMING_SAMPLE_EVERY: When frame-timing logging is enabled, includes the extra per-frame memory sample every Nth frame; minimum 1, defaults to 1.CLAUDE_CODE_JIT_POLICY_AFTER_STARTUP: Sets the Bun JIT policy applied shortly after startup; the number is passed to the runtime and defaults to 1.CLAUDE_CODE_PER_TURN_TIMING: When set, enables per-turn timing for models that support it; without it the feature stays off.CLAUDE_CODE_SDK_READS_STARTUP_MARKS: When set and the output format is stream-json, writes startup marker records to stdout for the SDK to read.CLAUDE_CODE_STARTUP_FAILURE_RESULTSANTHROPIC_BETAS: Comma-separated beta feature headers.ANTHROPIC_CUSTOM_HEADERS: Custom HTTP headers (newline-separated Key: Value).
Frequently asked questions
What does CLAUDE_CODE_EMIT_STARTUP_TIMING do?
When set, emits startup timing phase metrics, which are also emitted in remote mode; otherwise they are not reported.
Which Claude Code version has CLAUDE_CODE_EMIT_STARTUP_TIMING?
Added between v2.1.269 and v2.1.283 and still present in v2.1.318.
How do I set CLAUDE_CODE_EMIT_STARTUP_TIMING?
Export it before starting Claude Code (export CLAUDE_CODE_EMIT_STARTUP_TIMING=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.