Skip to content

Instantly share code, notes, and snippets.

@KMJ-007
Created July 22, 2025 13:17
Show Gist options
  • Select an option

  • Save KMJ-007/0979814968722051620461ab2aa01bf2 to your computer and use it in GitHub Desktop.

Select an option

Save KMJ-007/0979814968722051620461ab2aa01bf2 to your computer and use it in GitHub Desktop.

Manage Multiple Claude Code Accounts

Run two Claude Code accounts simultaneously on macOS without re-authenticating by using separate configuration directories.

Steps

  1. Create Separate Config Directories

    mkdir ~/.claude-account1
    mkdir ~/.claude-account2
  2. Add Aliases to Shell Config

    • Open ~/.zshrc (or ~/.bashrc for Bash) in an editor:
      nano ~/.zshrc
    • Add:
      alias claude-account1="CLAUDE_CONFIG_DIR=~/.claude-account1 claude"
      alias claude-account2="CLAUDE_CONFIG_DIR=~/.claude-account2 claude"
    • Save and reload:
      source ~/.zshrc
  3. Authenticate Each Account

    • For account 1:
      claude-account1
      Log in; credentials save to ~/.claude-account1.
    • For account 2:
      claude-account2
      Log in; credentials save to ~/.claude-account2.
  4. Switch or Run Simultaneously

    • Run claude-account1 or claude-account2 in separate terminal tabs (Cmd + T).
    • Each uses its own config and usage limits.

Notes

  • Requires separate Anthropic accounts (different emails).
  • Check Anthropic’s terms to ensure compliance.
  • Update Claude Code: npm install -g @anthropic-ai/claude-code.
  • If re-authentication occurs, verify CLAUDE_CONFIG_DIR with echo $CLAUDE_CONFIG_DIR.
@franzos

franzos commented May 11, 2026

Copy link
Copy Markdown

You can do something similiar with tku:

tku account list
Accounts (claude):
  * default              org: 652311d5  Claude Max (5x)
    business             org: cc4e31d9  team (5x)

* = currently active

Typical workflow for two accounts:

# already logged into account A via Claude Code
tku account add work

# log into account B (Claude Code drives this, not tku)
claude /logout
claude /login

tku account add personal

# from now on:
tku account use work
tku account use personal

All other properties like memory, skills, agents ... are shared between accounts.

@yogaaja22

Copy link
Copy Markdown

@dody87

dody87 commented Jun 9, 2026

Copy link
Copy Markdown

Built a proper repo on top of this mac-approach: github.com/dody87/ccam — auto-detects ~/.claude-* dirs, no config needed. Adds claude-status (usage bars + plan + reset time for all accounts) and claude-switch (symlink-based account switching with interactive menu).

@Nemo-Illusionist

Copy link
Copy Markdown

Same idea, packaged into a CLI — with the one thing I did not see elsewhere in this thread: auto-switching by directory. Link an account to a folder once, and every cd into it (or any subfolder) sets CLAUDE_CONFIG_DIR automatically — no manual switch, no per-command launcher.

github.com/Nemo-Illusionist/claude-code-account-switcher

  • Cross-platform Rust binary (macOS/Linux/Windows; zsh/bash/PowerShell), plus a zsh shell-script edition sharing the same on-disk format.
  • doctor audits the real Anthropic identity behind each config dir (so a wrong-account login does not silently leak limits/history); usage shows 5h + 7d usage bars + reset times across all accounts (similar to ccam's claude-status).
  • Shared skills/agents/memory via clone-settings / seeding; credentials stay isolated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment