I have a variety of customers who have their own Claude team account and don't want random things happening on other accounts. There are a lot of reasons for this, such as data sharing and ensuring they have oversight on what is happening on their overall account, especially related to spend for outcomes.

Fable helped me figure out a straightforward way to get this setup so I never am in the wrong account or have to log out and log in, and the trick is to set up custom .claude folders in your user root. This requires direnv that you can install via homebrew or some other package manager

# one time for each client account
mkdir ~/.claude-clientname

Where clientname is your client or a logical way to describe them, so you'll know what you're looking at later. Then you want to log in with that customer's credentials that they provided for you on their team.

CLAUDE_CONFIG_DIR=~/.claude-clientname claude /login

This will fire up the OAuth or API login like a new setup, and you can log in however you see fit.

Next, in the client's project root, run touch .envrc and add this one line to the file:

export CLAUDE_CONFIG_DIR=$HOME/.claude-clientname

And then make sure you fire direnv allow in that directory. I have also added eval "$(direnv hook zsh)" in my ~/.zshrc as well, which was suggested when debugging some oddities.

And now, when I fire up claude . or claude-swarm in my project, I'm using the correct client Claude account. Enjoy!