How to Run Separate Personal and Work Claude Code Accounts on One Machine
A developer has shared a simple method for isolating two Claude Code accounts on the same machine, keeping personal and work environments completely separate. The approach relies on Claude Code's built-in support for the CLAUDE_CONFIG_DIR environment variable, which redirects the app to a different config directory. By defining two shell functions in .zshrc, each pointing to its own config folder, the user ensures credentials, MCP servers, hooks, and session history never mix between accounts. The developer notes this avoids risks like work tokens leaking into personal sessions or internal MCP server hooks firing in the wrong context. While the trade-off is that settings must be updated in both accounts independently, the author considers this a minor inconvenience compared to the security and clarity gained.
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