⌨️CLAUDE_ENV_FILE
Also known as CLAUDE_ENV_FILE=~/.claude/env.sh
A script that runs before each Bash command, so its exports stay.
Think of it like
It is like you put on your apron each time you cook.
Example
Jack's tests need his Python virtualenv. Each command forgot it. He puts the activate line in an env file and sets this.
Why it matters
Each Bash command starts fresh. Without this, a setup step does not carry to the next command.
Definition
Example code
bash
# env.sh
source ~/projects/app/.venv/bin/activate
export CLAUDE_ENV_FILE=~/env.sh
claudeCommon mistake
Key takeaways
- 1Runs before each command. Same shell.
- 2Exports carry. Into the command.
- 3Hooks can fill it. SessionStart.