If you use Claude Code every day, chances are you have more than one account.
Many developers receive a company-managed Claude Code account from their employer while also paying for their own personal Claude Pro or Claude Max subscription.
That creates an annoying workflow.
During the day you might work on your company’s repositories using your corporate account, then switch to personal projects, open source contributions, or freelance work in the evening. Unfortunately, Claude Code stores its authentication in a single configuration directory by default, so changing accounts usually means logging out and signing back in.
Fortunately, there’s a much cleaner solution.
By using the CLAUDE_CONFIG_DIR environment variable, you can maintain completely separate Claude Code environments-each with its own login, settings, history, and configuration.
Once configured, switching between accounts becomes as simple as running a different command.
Why Developers Need Multiple Claude Code Accounts
Using multiple accounts isn’t about trying to bypass limits.
It’s about keeping different environments separate.
Common examples include:
- a company-provided Claude Code account
- a personal Claude Pro or Max subscription
- freelance client accounts
- testing different Claude subscriptions
- isolated development environments
Keeping these accounts independent helps prevent accidentally using the wrong account for sensitive repositories or mixing personal and work conversations.
How Claude Code Stores Its Configuration
Claude Code stores its local configuration inside a configuration directory.
By default, that directory is:
~/.claudeThis directory contains information such as:
- authentication
- conversation history
- memories
- MCP configuration
- hooks
- project settings
- preferences
The important detail is that Claude Code allows you to choose a different configuration directory by setting an environment variable before launching the application.
CLAUDE_CONFIG_DIREvery directory behaves like its own independent Claude Code installation.
Create Separate Configuration Directories
A simple approach is creating one directory for work and another for your personal account.
mkdir ~/.claude-work
mkdir ~/.claude-personalThe names don’t matter.
You could also create directories for individual clients if needed.
Create Convenient Aliases
Instead of typing the environment variable every time, create shell aliases.
For zsh or bash:
alias claude-work="CLAUDE_CONFIG_DIR=$HOME/.claude-work claude"
alias claude-personal="CLAUDE_CONFIG_DIR=$HOME/.claude-personal claude"Reload your shell configuration.
source ~/.zshrcor
source ~/.bashrcNow simply launch the desired account.
claude-workor
claude-personalThe first time each profile starts, authenticate with the appropriate Claude account.
After that, each profile remembers its own credentials.
Running Two Claude Code Sessions Simultaneously
One of the biggest advantages of this setup is that both accounts can stay logged in simultaneously.
For example:
Terminal 1
claude-workTerminal 2
claude-personalEach terminal uses a different configuration directory.
You can work on company repositories in one window while using your personal subscription in another without constantly signing in and out.
What Is Kept Separate?
Every configuration directory has its own independent data.
That includes:
- authentication
- conversation history
- memories
- MCP servers
- hooks
- settings
- project configuration
Changes made in one profile won’t affect another.
Windows Users
The same concept works on Windows.
Instead of shell aliases, you can create PowerShell functions or scripts that set CLAUDE_CONFIG_DIR before launching Claude Code.
The result is exactly the same: separate work and personal environments with independent authentication and settings.
Optional: Monitor Account Usage
If you use Claude heavily throughout the day, you can also automate usage monitoring.
Some developers create small hooks that check account usage before every prompt and display a warning when approaching the usage limit.
This isn’t required for running multiple accounts, but it can help avoid unexpectedly reaching the session limit during longer coding sessions.
When Should You Use This Setup?
This approach is ideal if you:
- have a company Claude Code account
- maintain your own personal subscription
- contribute to open source
- work with multiple clients
- want to keep development environments isolated
Instead of repeatedly logging out and back in, you simply launch the profile you want to use.
Final Thoughts
If your employer provides a Claude Code account but you also use your own personal subscription, you don’t need to constantly switch logins anymore.
Using CLAUDE_CONFIG_DIR lets you create completely independent Claude Code environments that each maintain their own authentication, history, memories, hooks, and settings.
It’s a simple setup that takes only a few minutes to configure, but it can save hours of repetitive account switching over time.
For developers who regularly move between professional and personal projects, it’s one of the easiest ways to make Claude Code fit naturally into their daily workflow.







