# Claude Code Multiple Accounts: Run Personal and Team Side by Side

Claude Code multiple accounts: one config directory per profile, a claude() zsh wrapper, short aliases, and a safer way to use bypass mode. Tested in clean zsh.

Topic: Claude & MCP
Published: 2026-12-03
URL: https://productivitytech.io/claude-code-multiple-accounts/

I have three named Claude Code profiles plus the default, and I pick one by typing one word: `claude team`, `claude personal` or `claude client-a`. Under the hood that sets `CLAUDE_CONFIG_DIR`, which is the variable Anthropic documents for running **Claude Code multiple accounts**. The rest of this post is the small shell function I wrap around it, the aliases I keep next to it, and the rules I use for deciding which account gets which work.

**Short version:** one config directory per profile, one login per directory, one `claude()` function that sets the variable for the command and nothing else. Anything riskier, like bypass mode, gets its own alias so you never type it by accident.

## Why one config directory per profile

By default Claude Code keeps everything user-level in `~/.claude`: settings, hooks, skills, subagents, session transcripts, auto memory, and your login. Set `CLAUDE_CONFIG_DIR` and every one of those paths moves to the directory you name instead, and so does `~/.claude.json`, the file with account details and personal MCP servers ([Claude directory reference](https://code.claude.com/docs/en/claude-directory)).

Anthropic's own [authentication page](https://code.claude.com/docs/en/authentication) recommends exactly this for staying signed in to several accounts: give each account its own configuration directory. On macOS the stored login is keyed to that directory too, so two profiles do not read the same Keychain entry.

That gives you three things at once:

- **Separate logins.** A personal subscription and a team seat never share a session.
- **Separate history and memory.** Transcripts and auto memory live under `projects/` inside the profile directory, so what Claude learned on team work does not leak into personal work. If you care how that memory behaves, I wrote about it in [Claude Code memory system: 5 practical layers](/claude-code-memory-system/).
- **Separate user-level config.** Different skills, hooks and MCP servers per profile, without a single `settings.json` full of exceptions.

What does *not* change: project files. A repo's `.claude/settings.json`, `.mcp.json` and `CLAUDE.md` are read from the repo, whichever profile you started. Profiles split *you*, not the project.

## Step 1: log in once per profile

Start Claude Code with the variable set, sign in, and repeat for each profile. Per the docs, the first run in a new directory walks you through login and setup:

```bash
CLAUDE_CONFIG_DIR="$HOME/.claude-personal" claude
CLAUDE_CONFIG_DIR="$HOME/.claude-team" claude
```

Use an absolute path. The docs note that `~` and `$HOME` are not expanded when you put the value in a settings file's `env` block, so a shell function that expands `$HOME` before it sets the variable is the safe form.

## Step 2: wrap it in a claude() function

Typing the variable every time is how people end up in the wrong account. A function fixes that. This is the one I use, with profile names generalised:

```zsh
# ~/.zshrc: one Claude Code login per profile
claude() {
  case "$1" in
    personal|team|client-a)
      local profile="$1"; shift
      (
        export CLAUDE_CONFIG_DIR="$HOME/.claude-$profile"
        cd "$HOME/repositories" || exit 1
        printf '\033]0;claude (%s)\007' "$profile"
        command claude "$@"
      )
      ;;
    *)
      command claude "$@"
      ;;
  esac
}
```

What each part does:

- **`case "$1"`** matches the first word against a fixed list of profile names. Plain `claude`, and subcommands such as `claude mcp list` or `claude update`, fall through to the default `~/.claude`. I used a list instead of a catch-all so a typo or a subcommand can never be mistaken for a profile.
- **The parentheses** run the block in a subshell. `CLAUDE_CONFIG_DIR` and the `cd` exist only for that one command, so your interactive shell never stays "in" a profile.
- **`cd "$HOME/repositories"`** starts every profile session in the folder that holds my clones. That is a habit from my [home repo pattern](/claude-code-home-repo-pattern/): agents start where every repo is reachable. Delete the line if you would rather start in the current directory.
- **The `printf` line** sets the terminal tab title with the standard `ESC ] 0 ; title BEL` escape, so five open tabs say which account they are.
- **`command claude "$@"`** calls the real binary, not the function again, and passes every remaining flag straight through. `claude team --agents '...'` or `claude personal -p "..."` work as if you had typed them on the plain command.

Add the profile names you need to the `case` line. To add a profile, add its name there and log in once.

## Step 3: aliases per mandate

The function picks the *account*. Aliases pick the *mandate*: how much Claude may do without asking. Mine:

```zsh
alias cship='claude --permission-mode bypassPermissions'
alias cteam='claude team'
alias cpersonal='claude personal'
alias cpship='claude personal --permission-mode bypassPermissions'
alias cteamship='claude team --permission-mode bypassPermissions'
```

`cship`, `cpship` and `cteamship` are the same bypass mode on the default, `personal` and `team` profile. You need separate aliases because the profile word has to come first: `claude --permission-mode bypassPermissions team` would not match the `case`. The names are short enough to type but unlike `claude`, so bypass mode is always a deliberate typed choice, never tab-completion muscle memory.

### What I ran

I checked the snippet in a clean zsh (`zsh -f`) with a stub `claude` script that prints the environment it receives. `zsh -n` accepts the file. Across five stub invocations, `claude team --agents '{}' --dangerously-skip-permissions` showed `CLAUDE_CONFIG_DIR` set to `$HOME/.claude-team` with the flags passed through unchanged. The `personal` and `client-a` runs set their own directories. Plain `claude` and `claude mcp list` reached the stub with the variable unset, and afterwards the parent shell still had no `CLAUDE_CONFIG_DIR`. The aliases expanded to the commands above: `cpship` ran the `personal` profile with the bypass flag, and `cteamship` ran the `team` profile with the same flag. I did not run the real Claude Code binary in that test, so the login flow itself is verified against Anthropic's documentation, not by this script.

To check a real profile after logging in, run `claude auth status --text` through the function (`claude team auth status --text`) and look at the account and the config directory it reports.

## How I actually use the profiles

My personal Claude account mostly lives in Claude Desktop for day-to-day personal work. The team accounts I have access to run through the CLI wrapper instead: I log into each one with `claude team`, `claude client-a` and so on, then start work in bypass mode with aliases like `cteamship`. That keeps the personal login out of the terminal path I use for client and employer repos.

For background work I open [agent view](https://code.claude.com/docs/en/agents) with `claude agents` from each profile's terminal. Going through the wrapper, `claude team agents` sets `CLAUDE_CONFIG_DIR` for that dashboard the same way a normal session would, so I dispatch and watch sessions under the account that should pay for them. I run it from each profile's terminal rather than assuming one agent view mixes every login.

Each account has a five-hour usage window. Parallel sessions spend that window together, so I keep only one or two tasks running per account and spread extra work across other profiles when I can. That is the practical reason to have more than one team profile wired up, not just separate logins.

## Personal vs team: which account gets which work

A rule that holds up: **the account follows who owns the repo and who pays for it.**

| Work | Profile | Why |
| --- | --- | --- |
| Employer or client repos | `team` (or `client-a`) | Billing, seat management and data terms attach to that account, not to your own subscription |
| Your own side projects and experiments | `personal` | Your own plan, your own history and memory |
| Throwaway tests of new flags or settings | `personal` | Nothing in it matters if it breaks |
| Parallel background work across accounts | one profile per terminal, then agent view | Each account has its own usage window, so spreading tasks across accounts avoids running one dry |

Two cautions. First, check what your organisation's plan says about data and usage before you move work around. I would not assume a personal plan is allowed for company code. Second, a team admin can set managed settings that block bypass mode; on my own team profiles it works, but check yours first.

## Safe use of bypass mode

Bypass mode, started with `--permission-mode bypassPermissions` or its equivalent `--dangerously-skip-permissions`, switches off permission prompts. Anthropic's [permission modes page](https://code.claude.com/docs/en/permission-modes) is blunt about it: it is for isolated containers and VMs, it offers no protection against prompt injection, and the docs point to auto mode for fewer prompts with background safety checks. So the honest advice is: use it where nothing important is in reach. Here is how to keep it contained:

1. **Pick the profile first.** I run bypass on my team profiles too, so containment matters more there: only on a branch or worktree, no production credentials in the shell, and deny rules in each profile's `settings.json`.
2. **Work on a branch or worktree**, in a repo with no uncommitted work, so the worst case is `git reset` and not a lost afternoon.
3. **Keep production credentials out of the shell** that launches it. The agent inherits your environment.
4. **Keep deny rules.** They still apply in every mode, bypass included. A small user-level `settings.json` in the profile directory is enough:

```json
{
  "permissions": {
    "deny": ["Bash(git push *)", "Read(./.env)"]
  }
}
```

Treat deny rules as a guardrail, not a wall: the docs point out that a rule like `Bash(git push *)` does not match a push written another way, such as `git -C . push`.

5. **Do not run it as root.** On Linux and macOS, Claude Code refuses bypass mode as root or under `sudo`.

The first time you start bypass mode, Claude Code asks you to accept a warning and stores the acceptance in the settings file. Because that file now lives in the profile directory, expect to see the dialog once per profile.

## FAQ: Claude Code multiple accounts

<!-- faq -->
