This tutorial shows how to use direnv and the CLAUDE_CONFIG_DIR environment variable to maintain fully isolated Claude Code sessions per project, each pointing to a different subscription. Zero friction when switching contexts.
Claude Code stores its configuration and OAuth tokens under a config directory. By default this is a single shared path, which means one session for all your work.
The CLAUDE_CONFIG_DIR environment variable lets you override that path. Point it to a different directory per project and Claude Code will treat each one as a completely independent environment — separate login, separate session, separate subscription.