How to Run Multiple Claude Code Instances
Run multiple Claude Code instances simultaneously for different accounts using custom configuration directories. Perfect for separating personal and work projects or managing multiple Claude subscriptions.
If you use two or more Claude accounts for Claude Code, for example a personal one and a work one, it is possible to run both at the same time, with optionally different configurations or the same configurations.
Running a Second Instance
On Linux and Mac, the default Claude Code settings directory is located in your home directory at ~/.claude. It is possible to specify an alternative directory for the settings. This alternative one can be used for a second account.
For example, to create a second directory for use with Claude Code, run:
mkdir ~/.claude-secondary
Then launch Claude Code specifying the directory:
CLAUDE_CONFIG_DIR=~/.claude-secondary claude
The first Claude account can be run as normal with:
claude
Creating Shell Aliases
You can also create aliases in Bash or ZSH, so running cc in your terminal will open your default instance, and cc2 will open the secondary.
Add the following to your ~/.bashrc or ~/.zshrc file in your home directory:
# Launch Claude Code default (personal) accountalias cc='claude'# Launch Claude Code secondary accountalias cc2='CLAUDE_CONFIG_DIR=~/.claude-secondary claude'
After adding these aliases, remember to reload your shell configuration by running source ~/.bashrc or source ~/.zshrc, or simply open a new terminal window. Then you can launch your default Claude Code instance with just cc and your secondary instance with cc2.
Alternative Alias Names
You might prefer more descriptive alias names based on your use case. Here are some alternative naming conventions:
# Work and personal accountsalias claude-work='CLAUDE_CONFIG_DIR=~/.claude-work claude'alias claude-personal='claude'# Client-specific instancesalias claude-client-a='CLAUDE_CONFIG_DIR=~/.claude-client-a claude'alias claude-client-b='CLAUDE_CONFIG_DIR=~/.claude-client-b claude'
Synchronising Configuration Files
You can also create symbolic links (symlinks) to keep one configuration across both instances. This is useful when you want to share certain settings or resources between your Claude Code instances while keeping accounts separate.
For example, if you want to keep the Skills you have set up in the primary Claude Code instance, you can symlink the skills directory from the primary account to the secondary:
ln -s ~/.claude/skills ~/.claude-secondary/skills
Other Configuration Files You Can Share
Beyond Skills, you might want to share other configuration files between instances:
# Share keybindingsln -s ~/.claude/keybindings.json ~/.claude-secondary/keybindings.json# Share MCP servers configurationln -s ~/.claude/mcp_servers.json ~/.claude-secondary/mcp_servers.json# Share global settings (use with caution - authentication tokens are stored here)ln -s ~/.claude/settings.json ~/.claude-secondary/settings.json
Important: Be cautious when sharing settings.json as it contains authentication tokens. Sharing this file between instances means both instances will use the same Claude account. Only share this file if you want multiple instances to use the same account credentials.
Frequently Asked Questions
Do I need multiple Claude subscriptions to run multiple instances?
Not necessarily. You can run multiple instances with the same account by sharing the settings.json file (which contains your authentication tokens) between configuration directories. However, the more common use case is to use separate Claude accounts for different purposes, such as a personal account and a work account, each with its own subscription.
Will my conversations be shared between instances?
No. Each instance maintains its own conversation history and context within its respective configuration directory. The conversations are stored locally and are separate for each instance, even if you're using the same Claude account across instances.
Can I run more than two instances?
Yes, you can run as many instances as you need. Simply create additional configuration directories and use the CLAUDE_CONFIG_DIR environment variable to specify which configuration to use. For example, you could have ~/.claude-work, ~/.claude-personal, ~/.claude-client-a, etc.
Do multiple instances count as separate usage?
Yes, if each instance is using a different Claude account. Each account has its own usage limits and token consumption. If multiple instances share the same account (via shared authentication tokens), they all count towards the same account's usage limits.
What happens if I delete a secondary configuration directory?
Deleting a secondary configuration directory will remove all settings, conversation history, and authentication tokens specific to that instance. If you've created symlinks to share configuration files from your primary instance, the original files in ~/.claude will remain unaffected. However, you'll need to re-authenticate and reconfigure that instance if you create it again.