CLAUDE_ENV_FILE
Updated by Alex Sorokoletov
CLAUDE_ENV_FILE is a Claude Code environment variable: Path to environment file for session variables. Present since v2.1.69 or earlier and still present in v2.1.332. It is listed in the official reference.
| Status | Present in v2.1.332 |
|---|---|
| Added | Present since v2.1.69 or earlier |
| Category | Other |
| Official docs | Listed |
How to set it
For one session, export it in the shell that starts Claude Code:
export CLAUDE_ENV_FILE=<value>
claudeTo apply it to every session, add it to the env object of a settings file:
// ~/.claude/settings.json
{
"env": {
"CLAUDE_ENV_FILE": "<value>"
}
}Release notes that mention it
- Claude Code v2.1.114 — Native Binary Launcher, /fewer-permission-prompts, and 20 New Environment Variables
- Claude Code v2.1.108 — 4 New Environment Variables: REPL Variants, Skill Discovery, and the Limits Reckoning
- 83 Undocumented Claude Code Environment Variables (v2.1.19)
Related variables
CLAUDE_CLIENT_PRESENCE_FILECLAUDE_CODE_DIAGNOSTICS_FILE: Path to write diagnostics output.CLAUDE_CODE_DONT_INHERIT_ENV: Start shell with empty environment.CLAUDE_CODE_FILE_READ_MAX_PDF_PAGES_PER_MESSAGE: Caps how many PDF pages the Read tool loads within a single message.CLAUDE_CODE_FILE_READ_MAX_PDF_PAGES_PER_TURN: Caps the running total of PDF pages the Read tool loads across a turn, working with the per-message cap above.CLAUDE_CODE_HOST_CREDS_FILE: Path to the host's credentials file; it is treated as an allowed credential path and, together with host gateway lineage, enables host-managed authentication.CLAUDE_CODE_HOST_OWNED_SPAWN_ENV: When set to true, in a remote session with a session id and environment kind set, it wraps an exporter so its exports are held in a buffer instead of sent straight out.CLAUDE_CODE_ULTRAREVIEW_REVIEW_MD_FILE: Points to a draft REVIEW.md file for ultrareview; it is accepted only when a pull request is reviewed as merged with no findings posted or applied, otherwise the launch is refused.
Frequently asked questions
What does CLAUDE_ENV_FILE do?
Path to environment file for session variables
Which Claude Code version has CLAUDE_ENV_FILE?
Present since v2.1.69 or earlier and still present in v2.1.332.
How do I set CLAUDE_ENV_FILE?
Export it before starting Claude Code (export CLAUDE_ENV_FILE=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.