A simple way to keep personal and work Claude Code sessions separate.

Using Multiple Claude Code Accounts on One Machine
1 mins
281 words
Loading views

If you use Claude Code for both personal and work accounts, logging in and out gets old fast. The cleaner setup is to give each account its own config directory. Claude stores local auth and session state there, so separate directories act like separate profiles. The result is simple:

  • claude can stay on your default account
  • claude-work can open your work account
  • no repeated sign-in/sign-out cycle

How it worksh2

Claude Code can be launched with a custom CLAUDE_CONFIG_DIR.

Example:

Terminal window
CLAUDE_CONFIG_DIR="$HOME/.claude-work" claude

When you do that, Claude uses ~/.claude-work instead of the default config directory. That means auth, session history, and local state stay isolated from your main account.

Fish setuph2

If you use fish, add this to ~/.config/fish/config.fish:

Terminal window
function claude-work
env CLAUDE_CONFIG_DIR="$HOME/.claude-work" claude $argv
end

Reload your shell:

Terminal window
source ~/.config/fish/config.fish

Zsh setuph2

If you use zsh, add this to ~/.zshrc:

Terminal window
alias claude-work='CLAUDE_CONFIG_DIR="$HOME/.claude-work" claude'

Reload your shell:

Terminal window
source ~/.zshrc

Create the separate profile directoryh2

Run this once:

Terminal window
mkdir -p ~/.claude-work

Then start the isolated profile with:

Terminal window
claude-work

The first time it opens, log into your work account inside that profile.

What your final workflow looks likeh2

Once setup is done:

  • claude uses your default profile
  • claude-work uses your work profile

That gives you clean switching between accounts without cross-contaminating local state.

Scaling to more than two accountsh2

This pattern works for any number of accounts or clients. Examples:

Terminal window
CLAUDE_CONFIG_DIR="$HOME/.claude-client-a" claude
CLAUDE_CONFIG_DIR="$HOME/.claude-client-b" claude
CLAUDE_CONFIG_DIR="$HOME/.claude-lab" claude

You can wrap each one in a shell alias or function:

  • claude-work
  • claude-acme
  • claude-prod

One useful safety checkh2

After launching a profile, run /status inside Claude to confirm which account and session you are using.

SCR-20260330-krmz.png

That is the easiest way to avoid doing work in the wrong account.

Why this setup is worth ith2

  • no repeated login/logout flow
  • separate local state per account
  • cleaner personal vs work separation
  • easy to remember and easy to extend

If you manage multiple Claude Code identities on one laptop, this is the simplest setup that stays practical.


Author: Monawwar Abdullah
Post: Using Multiple Claude Code Accounts on One Machine