How to Run Multiple Claude Code Accounts on Linux Using One Environment Variable

Developers using Claude Code for both work and personal projects often face friction when switching between accounts, as it requires logging out and losing session state. A practical solution involves using the CLAUDE_CONFIG_DIR environment variable to maintain separate configuration directories for each account. The approach can be implemented manually or automated through a shell script for faster switching. Additional integrations with direnv and VS Code allow for automatic account switching based on the active project directory.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in