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.294. It is listed in the official reference.
| Status | Present in v2.1.294 |
|---|---|
| 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_USE_NATIVE_FILE_SEARCHCLAUDE_CODE_ARTIFACT_MULTI_FILECLAUDE_CODE_HOST_CREDS_FILECLAUDE_RUNNER_WORK_ORDER_FILECLAUDE_STAGE_FILE_ROOT
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.294.
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.