Vibor Cipan on X: "How I run multiple Claude Code accounts on one Mac" / X

X (formerly Twitter) ·

4 min read Original article ↗

I think Anthropic should make switching between accounts easier in their Desktop and CLI clients. I have a personal account and a work account, and I don’t want to keep logging out and back in whenever I change what I’m working on.

Until there’s a more convenient built-in account switcher, this setup has been useful for me: I give each CLI account its own config folder and keep both signed in.

I also leave Desktop on one account and run the other through the CLI. I experimented with adding a 3rd account too.

Here's a tutorial on how you can set it up on your machine.

Give the second account its own folder

With Claude Code already installed, run:

bash

mkdir -p "$HOME/.claude-b"

Then add this function to your shell startup file. For Zsh, that’s ~/.zshrc:

bash

claude-b() {
  CLAUDE_CONFIG_DIR="$HOME/.claude-b" command claude "$@"
}

The function starts Claude with a different configuration directory. It also passes along whatever arguments you give it, so you can use the usual Claude commands through claude-b.

Your existing claude command keeps using its default configuration, assuming you haven’t already set a different CLAUDE_CONFIG_DIR.

Log in, and check which account you actually picked

Open a new terminal, then run:

bash

claude-b auth login --claudeai
claude-b auth status

Check the email before approving the browser login. Mine initially picked the account I was already signed into, which was exactly the one I didn’t want here. Oh well…

Opening the login link in another browser or an incognito window can help.

Follow the prompts and check the account identity in auth status afterwards. Current versions also show configDirectory, which should point to .claude-b.

Now you whould have something like this:

bash

claude     # default account
claude-b   # second account

Each config has its own settings, session history and claude.ai login.

Also. a neat thing is that on macOS, the Keychain credential entry is tied to that configuration directory too.

Desktop on one account, CLI on the other

This is the combo I wanted.

I leave Desktop signed into account A and run account B through claude-b. Now they both stay signed in, so I can use them side by side.

You can even run the CLI in the Desktop app’s terminal :D

The terminal session still uses whichever configuration your command selects. Running claude-b there doesn’t require changing the Desktop app’s sign-in and it makes it easier to coordinate some work.

A third account works too

I experimented with a third account using .claude-c and the same function renamed to claude-c:

bash

mkdir -p "$HOME/.claude-c"

bash

claude-c() {
  CLAUDE_CONFIG_DIR="$HOME/.claude-c" command claude "$@"
}

After adding that to your shell startup file and opening a new terminal:

bash

claude-c auth login --claudeai
claude-c auth status
claude-c

That works well in my setup. A fourth would follow the same pattern, but I haven’t tested a fourth myself.

This is for claude.ai accounts. Separate config directories don’t isolate two Claude Console sign-ins that use the keyless authentication method and I haven't spent much time experimenting with those.

Some things I learned along the way

1/ Make the account obvious.
I initially typed a command without selecting the second configuration and changed settings on the first account instead. Giving each account its own command helps. In my fuller setup, the wrapper also prints the account identity before starting.

2/ Share rules and skills deliberately.
I wanted to reuse some of my existing CLAUDE.md, skills and agents, so I linked those individually. I wouldn’t copy the whole config folder. Also, symlinks point to the same original files: changes through either account affect both.

3/ Separate configs don’t separate filesystem access.
Both sessions still run as your macOS user and can access the same repositories. If they work on the same project, divide the work clearly. I keep one main coordinator and use files for handoffs.

I’ve tested this on my Mac. I haven’t tested Linux or Windows, so I can’t speak from experience there.

One extra tip for longer sessions

When a coordinator’s context gets too large, I hand the work over through shared notes and a brief for the next session.

I also added a shortcut to my wrapper that attaches to the highest-numbered coordinator, so I don’t have to look up a new session ID after every handoff. That helper is something I added; plain claude attach main doesn’t automatically mean “find my latest coordinator.”

The basic account setup above works without any of that. I still check which account I’m in before typing, though.

Check out the full write up with more wrappers and code

My longer walkthrough includes the executable wrappers, shared tools, background sessions and the coordinator attach helper.