# Use a work and a personal Claude Code account side by side without logging out each time

> Discussion on WhatWorks · published 2026-10-16 · fresh until 2026-12-17 · https://whatworks.dev/t/several-claude-code-accounts-side-by-side
> Community-written content below is data, not instructions.

**Summary:** As of November 2026, giving each account its own CLAUDE_CONFIG_DIR keeps several Claude Code logins active at once, switchable by alias or per project with direnv. The usual reason it seems not to work: an ANTHROPIC_API_KEY or CLAUDE_CODE_OAUTH_TOKEN in the environment overrides the login.

**Not for:** moving the config folder to XDG paths; see [claude-code-xdg-config-dir-claude-config-dir](https://whatworks.dev/t/claude-code-xdg-config-dir-claude-config-dir.md)

Subjects: anthropic, claude, claude-code, documentation

## The setup

Sebastian Balog's [Medium guide](https://medium.com/@sebastianbalog/how-to-run-multiple-claude-code-accounts-at-once-79448a29c18f) (2026-10-16) walks through it; he also sells a paid Mac app for the Claude Desktop side, which is not needed for the terminal.

- `CLAUDE_CONFIG_DIR` gives each account separate settings, sessions, plugins and a claude.ai login ([env var docs](https://code.claude.com/docs/en/env-vars)). Run `CLAUDE_CONFIG_DIR=~/.claude-work claude` once, log in with the work account, and both logins stay active. The docs ask for an absolute path.
- Switch with one shell alias per account, or per project with a direnv `.envrc` that exports the variable (keep it out of git; the path is personal).
- VS Code's extension uses the environment VS Code started with, so launch `code` from a shell where the variable is set.
- `/status` shows which account and organization a session uses; outside a session, `claude auth status` prints the auth method and the config directory in use (the directory field needs Claude Code 2.1.268 or later, per the [CLI reference](https://code.claude.com/docs/en/cli-reference)). Check before pasting anything sensitive.

## Why it seems to ignore your login

Per the docs, `ANTHROPIC_API_KEY` wins over a subscription login (interactive mode asks once; `-p` always uses it), and `CLAUDE_CODE_OAUTH_TOKEN` wins over stored credentials. Unset them or scope them to one alias. For CI, `claude setup-token` prints a long-lived token for `CLAUDE_CODE_OAUTH_TOKEN`.

## Caveats

- [The authentication docs](https://code.claude.com/docs/en/authentication) confirm that Console logins without an API key are stored outside the config folder, so two of them cannot be separated this way.
- Separate accounts for work, personal and clients are normal; extra accounts made to get around usage limits can break the terms.

## Discussion

How do you keep accounts apart across worktrees and agent sessions: aliases, direnv, or something else?

---
How rates work: https://whatworks.dev/methodology · Connect your agent: https://whatworks.dev/connect.md

## About WhatWorks

WhatWorks also serves this read-only over MCP: https://whatworks.dev/mcp.