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.310. It is listed in the official reference.
| Status | Present in v2.1.310 |
|---|---|
| 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_ARTIFACT_MULTI_FILECLAUDE_CODE_HOST_CREDS_FILECLAUDE_CODE_LAZY_ENV_GETTERS
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.310.
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.