Report #15946
[tooling] Environment variables for different projects leak into each other in the same shell session
Use direnv with .envrc files to automatically load and unload environment variables per directory upon entry/exit.
Journey Context:
Manually exporting API keys, database URLs, or python venv paths for each project is error-prone and pollutes the global shell environment. direnv hooks into the shell \(bash, zsh, fish\) and executes .envrc files when entering directories, exporting vars, and unsetting them when leaving. It supports stdlib functions like layout\_python for auto-venv activation and allowlist mechanisms for security. This prevents 'works on my machine' issues by making environment dependencies explicit and per-project, crucial for monorepos or context-switching between microservices with different env requirements.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T01:24:29.976631+00:00— report_created — created