Zwei Claude Code Konten parallel nutzen ohne Ausloggen auf Mac, Windows und VS Code
Wer getrennte Claude Konten für Arbeit und Privates oder verschiedene Kunden hat, kann beide parallel betreiben, ohne sich ab- und anzumelden. Ein community-Anleitung nutzt dafür separate Profile und Konfigurationspfade.

Offenlegung: Ich entwickle Claude Sessions Pro, eine kostenpflichtige App für Mac und Windows, mit der sich mehrere Claude-Konten gleichzeitig nutzen lassen. Alles Folgende funktioniert auch ohne die App. Die App bekommt einen Abschnitt gegen Ende, der deutlich gekennzeichnet ist.
Sie haben ein berufliches Claude-Konto und ein privates. Vielleicht auch eines pro Kunde. Claude Code meldet sich an genau einem davon an, und ein Wechsel bedeutet /logout, /login, einen Browser-Tab und den Verlust Ihrer aktuellen Position. Eine Stunde später machen Sie das Ganze in die andere Richtung erneut.
Das müssen Sie nicht. Claude Code legt alles zu einem Konto (Anmeldung, Einstellungen, Verlauf, MCP-Server) in einem einzigen Ordner ab, und Sie können es beim Start auf einen anderen Ordner verweisen. Zwei Ordner, zwei Konten, beide gleichzeitig in zwei Terminals geöffnet.
Dieser Leitfaden behandelt die Einrichtung auf macOS, Linux und Windows (PowerShell, cmd und Windows Terminal), wie man beide nebeneinander betreibt, wie man jedem Projektordner sein eigenes Konto zuweist, VS Code, CI und die wenigen Fallstricke, die beide Terminals stillschweigend auf dieselbe Anmeldung setzen. Den Kern davon (den Alias, die PowerShell-Funktionen, das Windows-Terminal-Profil, das tmux-Split, den Auth-Status und wo MCP-Server landen) habe ich auf macOS und Windows 11 geprüft.
Wenn Claude Code startet, schaut es auf genau eine Umgebungsvariable: CLAUDE_CONFIG_DIR. Ist sie nicht gesetzt, verwendet es ~/.claude. Im praktischen Sinne ist dieser Ordner das Konto:
Ein „zweites Konto“ ist also einfach ein „zweiter Ordner“. Es wird nichts kopiert oder gepatcht, und Ihre Standard-Einrichtung bleibt unberührt.
Wählen Sie einen Namen. Ich verwende durchgehend ~/.claude-work; ein Ordner pro zusätzlichem Konto funktioniert auf dieselbe Weise ( ~/.claude-clientA, ~/.claude-personal ).
# Standardkonto: schlicht `claude`, ~/.claude # Arbeitskonto: `claude-work`, ~/.claude-work alias claude-work = 'CLAUDE_CONFIG_DIR="$HOME/.claude-work" claude' Enter fullscreen mode Exit fullscreen mode Öffnen Sie ein neues Terminal und führen Sie es aus:
claude-work Enter fullscreen mode Exit fullscreen mode Claude Code findet in dem neuen Ordner keine Anmeldung und führt Sie daher durch die Ersteinrichtung und öffnet den Browser. Melden Sie sich mit dem anderen Konto an. Das ist das einzige Mal, dass Sie das tun müssen. Von nun an steht claude für das eine Konto und claude-work für das andere, und Sie können beide gleichzeitig laufen lassen.
claude auth status claude-work auth status Enter fullscreen mode Exit fullscreen mode Beide Befehle geben einen kleinen JSON-Block aus. Sehen Sie sich email und configDirectory an: Der erste sollte Ihr Standardkonto und ~/.claude zeigen, der zweite Ihr Arbeitskonto und ~/.claude-work. ( auth status benötigt ein aktuelles Claude Code; führen Sie claude update aus, falls der Befehl nicht erkannt wird.)
Es ist verlockend, die Sache mit einem zweiten Alias symmetrisch zu gestalten, etwa claude-personal='CLAUDE_CONFIG_DIR=~/.claude claude'. Lassen Sie es bleiben. Unter macOS sorgt schon das Setzen der Variablen, selbst auf den Standardpfad, dafür, dass Claude Code einen anderen Keychain-Eintrag sucht, wodurch Ihr privates Konto plötzlich als abgemeldet erscheint. Das wird als Issue #92252 verfolgt. Belassen Sie Ihr Hauptkonto auf schlicht claude ohne gesetzte Variable und geben Sie jedem zusätzlichen Konto seinen eigenen neuen Ordner.
Die Idee ist dieselbe, aber PowerShell kennt keine Kurzform VAR=value command. Wenn Sie einfach $env:CLAUDE_CONFIG_DIR =... ausführen und danach claude, bleibt die Variable für alle weiteren Befehle in diesem Fenster gesetzt, und das nächste schlichte claude ist ebenfalls Ihr Arbeitskonto.
Diese Funktion setzt die Variable für genau einen Aufruf und stellt sie danach wieder her, selbst wenn Claude Code mit einem Fehler beendet wird:
function claude-work { $prev = $ env: CLAUDE_CONFIG_DIR $ env: CLAUDE_CONFIG_DIR = Join-Path $HOME '.claude-work' try { claude @ args } finally { $ env: CLAUDE_CONFIG_DIR = $prev } } Enter fullscreen mode Exit fullscreen mode Legen Sie sie in Ihr Profil, damit sie immer verfügbar ist. notepad $PROFILE öffnet die Datei (erstellen Sie sie, falls Notepad danach fragt). Öffnen Sie ein neues PowerShell-Fenster, führen Sie claude-work aus, melden Sie sich mit dem zweiten Konto an und prüfen Sie beide wie oben mit claude auth status und claude-work auth status. @args reicht alles durch, sodass claude-work --resume und claude-work mcp list wie erwartet funktionieren.
cmd.exe: Setzen Sie die gesamte Zuweisung in Anführungszeichen, sonst behandelt cmd das Leerzeichen vor && als Teil des Ordnernamens:
set "CLAUDE_CONFIG_DIR= %USERPROFILE% \.claude-work" && claude Enter fullscreen mode Exit fullscreen mode Diese Variable bleibt für den Rest des cmd-Fensters gesetzt, verwenden Sie also ein dediziertes Fenster dafür.
Windows-Terminal-Profil. Wenn Sie lieber einen Eintrag „Claude (work)“ im Menü für neue Tabs haben möchten, öffnen Sie die Einstellungen, dann Open JSON file, und fügen Sie unter profiles.list ein Profil hinzu:
{ "name": "Claude (work)", "commandline": "powershell.exe -NoExit -Command \" $env:CLAUDE_CONFIG_DIR = Join-Path $HOME '.claude-work'; claude \" ", "startingDirectory": "%USERPROFILE%", "tabTitle": "WORK" } Enter fullscreen mode Exit fullscreen mode Die Variable existiert nur in diesem Tab, alle anderen Tabs bleiben unberührt. -NoExit hält das Fenster offen, wenn Sie Claude Code beenden, sodass Sie es mit demselben Konto neu starten können, indem Sie claude eingeben.
Sobald die Ordner existieren, ist „nebeneinander“ nichts weiter als zwei Terminals.
tmux (macOS und Linux). Ein Befehl, zwei Bereiche, je eines pro Konto:
tmux new-session -s claude 'claude' \; split-window -h 'CLAUDE_CONFIG_DIR="$HOME/.claude-work" claude' Enter fullscreen mode Exit fullscreen mode Linker Bereich: Standardkonto. Rechter Bereich: Arbeit. Jeder Bereich schließt sich, wenn Sie Claude Code darin beenden.
iTerm2. Einstellungen, Profiles, duplizieren Sie Ihr Profil und nennen Sie es „Claude work“. Unter General setzen Sie Send text at start auf export CLAUDE_CONFIG_DIR="$HOME/.claude-work", und tragen Sie WORK unter Badge ein, was eine große, blasse Beschriftung hinter dem Text zeichnet. Teilen Sie nun einen Bereich mit diesem Profil (Rechtsklick auf einen Bereich, Split Pane with Profile ).
macOS Terminal. Einstellungen, Profiles, duplizieren Sie ein Profil und nennen Sie es „Claude work“. Setzen Sie im Tab Shell die Haken bei Run command und Run inside shell und geben Sie CLAUDE_CONFIG_DIR="$HOME/.claude-work" claude ein. Ein neues Fenster mit diesem Profil öffnet sich direkt in Claude Code mit dem Arbeitskonto. Verpassen Sie dem Profil gleich eine andere Hintergrundfarbe.
Windows Terminal. Halten Sie Alt gedrückt und klicken Sie im Dropdown für neue Tabs auf „Claude (work)“: Es öffnet sich dann als geteilter Bereich neben dem aktuellen statt als neuer Tab. Mit Alt+Shift+- und Alt+Shift+Plus teilen Sie den aktuellen Bereich, falls Sie lieber von einer normalen Shell aus starten.
Der Alias funktioniert, aber Sie müssen sich dennoch merken, welchen Sie eingeben müssen. Wenn alle Ihre Arbeits-Repositories unter einem Ordner liegen, lassen Sie den Ordner entscheiden.
direnv (macOS, Linux, WSL). Installieren Sie es ( direnv.net ), binden Sie es in Ihre Shell ein und legen Sie dann im Wurzelverzeichnis Ihres Arbeitsordners Folgendes ab:
# ~/work/.envrc export CLAUDE_CONFIG_DIR = " $HOME /.claude-work" Enter fullscreen mode Exit fullscreen mode Führen Sie einmal direnv allow aus. Ab jetzt setzt cd ~/work/anything die Variable und beim Verlassen wird sie zurückgesetzt, sodass schlicht claude in jedem Repository unterhalb dieses Ordners das richtige Konto verwendet. Nehmen Sie.envrc in Ihre globale gitignore auf, falls Ihre Repositories geteilt werden.
Kein direnv? Eine Shell-Funktion macht dieselbe Prüfung bei jedem Start von Claude Code:
# ~/.zshrc oder ~/.bashrc claude () { case " $PWD /" in " $HOME /work/" * ) CLAUDE_CONFIG_DIR = " $HOME /.claude-work" command claude " $@ ";; * ) command claude " $@ ";; esac } Enter fullscreen mode Exit fullscreen mode command claude ruft die echte Binärdatei auf statt erneut die Funktion. Fügen Sie eine Zeile pro Kundenordner hinzu, wenn Sie mehr als zwei Konten haben.
PowerShell kann dasselbe innerhalb der früher gezeigten Funktion:
function claude { $prev = $ env: CLAUDE_CONFIG_DIR if ( $PWD. Path -like ( Join-Path $HOME 'work\*' )) { $ env: CLAUDE_CONFIG_DIR = Join-Path $HOME '.claude-work' } try { claude.exe @ args } finally { $ env: CLAUDE_CONFIG_DIR = $prev } } Enter fullscreen mode Exit fullscreen mode Falls claude.exe nicht gefunden wird, prüfen Sie, was Get-Command claude -All auflistet, und rufen Sie diesen Namen stattdessen auf (npm installiert ein claude.cmd, in dem Fall lautet es also claude.cmd @args).
Die Claude-Code-Erweiterung hat eine Einstellung für Umgebungsvariablen, claudeCode.environmentVariables, und das wäre der naheliegende Ort für CLAUDE_CONFIG_DIR. Der Haken: Es ist eine Einstellung mit Maschinen-Gültigkeit. VS Code ignoriert sie in der.vscode/settings.json eines Workspace, sodass Sie auf diesem Weg nicht einem Projekt das Arbeitskonto und einem anderen das private zuweisen können. Setzen Sie sie in Ihren Benutzereinstellungen, gilt sie für jedes Fenster. Wenn Sie sie dort setzen, verwenden Sie einen absoluten Pfad; ~ wird nicht aufgelöst.
Was pro Projekt funktioniert, ist das integrierte Terminal. In der.vscode/settings.json des Arbeitsprojekts:
{ "terminal.integrated.env.osx": { "CLAUDE_CONFIG_DIR": "/Users/you/.claude-work" }, "terminal.integrated.env.linux": { "CLAUDE_CONFIG_DIR": "/home/you/.claude-work" }, "terminal.integrated.env.windows": { "CLAUDE_CONFIG_DIR": "C: \\ Users \\ you \\.claude-work" } } Enter fullscreen mode Exit fullscreen mode Neue Terminals in diesem Fenster erhalten die Variable, und claude, das dort läuft, verwendet das Arbeitskonto. VS Code bittet Sie, dem Workspace zu vertrauen, bevor es die Terminal-Umgebungseinstellungen anwendet. Cursor und Windsurf lesen dieselben Schlüssel. JetBrains-IDEs bieten dasselbe unter Settings, Tools, Terminal, Environment variables.
Zwei identische Terminals mit unterschiedlichen Konten sind eine Einladung, den Kundenauftrag versehentlich auf Ihrem privaten Tarif laufen zu lassen. Geben Sie dem Arbeitsordner eine Statuszeile, die genau das anzeigt. Erstellen Sie ~/.claude-work/statusline.sh:
#!/bin/sh # Claude Code übergibt Sitzungsinformationen als JSON über stdin; wir brauchen nur ein Label. cat > /dev/null printf '\033[44;97m WORK \033[0m %s' " $( basename " $PWD " ) " Mit chmod +x ~/.claude-work/statusline.sh macht man das Skript ausführbar und verweist in der settings.json des Arbeitsordners unter ~/.claude-work darauf:
{ "statusLine": { "type": "command", "command": "~/.claude-work/statusline.sh" } } Das Standardkonto behält seine eigene settings.json, sodass nur die Arbeitssitzungen das blaue WORK-Tag anzeigen. In Kombination mit einem farbigen Terminal-Profil oder einem iTerm2-Badge kann man beide auch von weitem auseinanderhalten. Und im Zweifelsfall zeigt /status innerhalb einer Sitzung an, mit welchem Konto man angemeldet ist.
Ein neuer Ordner startet leer: keine CLAUDE.md, keine Skills, keine Agents. Vermutlich möchte man diese überall gleich haben. Symlinks helfen:
ln -s ~/.claude/CLAUDE.md ~/.claude-work/CLAUDE.md ln -s ~/.claude/skills ~/.claude-work/skills ln -s ~/.claude/agents ~/.claude-work/agents ln -s ~/.claude/commands ~/.claude-work/commands (Unter Windows erledigt New-Item -ItemType SymbolicLink dasselbe, benötigt aber den Entwicklermodus oder eine Eingabeaufforderung mit Administratorrechten. Dateien zu kopieren funktioniert ebenfalls.)
Niemals teilen oder symlinken: credentials.json,.claude.json oder den kompletten Ordner. Diese enthalten den Login und den kontobezogenen Zustand. Das Teilen führt dazu, dass man mit einem Konto in beiden Terminals angemeldet ist oder sich die Terminals gegenseitig abmelden.
MCP-Server kommen nicht mit. Server im User-Scope liegen in der eigenen.claude.json des Kontos (siehe Diagramm), daher startet das Arbeitskonto ohne welche. Man fügt sie über den Work-Alias erneut hinzu:
claude-work mcp add --scope user --transport http notion https://mcp.notion.com/mcp claude-work mcp list Server im Project-Scope (eine.mcp.json im Repository) werden aus dem Repo gelesen und funktionieren damit für beide Konten ganz ohne Zutun.
Einstellungen lassen sich per Symlink über settings.json teilen, aber die meisten möchten die des Arbeitskontos unterscheiden lassen, zumindest für die Statuszeile oben.
Wenn beide auth-status-Aufrufe dieselbe E-Mail anzeigen, ist fast immer einer dieser Gründe die Ursache.
Dieselbe Idee in einer Pipeline: ein Token pro Konto. Auf dem eigenen Rechner führt man setup-token mit dem Ordner jedes Kontos aus:
claude setup-token # Standardkonto claude-work setup-token # Arbeitskonto Speichert man jedes Token als separates Secret ( CLAUDE_CODE_OAUTH_TOKEN_PERSONAL, CLAUDE_CODE_OAUTH_TOKEN_WORK ) und ordnet in jedem Job das richtige CLAUDE_CODE_OAUTH_TOKEN zu. Der Runner braucht nie einen Config-Ordner oder eine Browser-Anmeldung.
Das alles gilt nicht für die Claude Desktop App. Sie ignoriert CLAUDE_CONFIG_DIR und meldet sich jeweils an nur ein Konto an, auch in ihrem Code-Tab. Um dort zwei Konten zu nutzen, bleibt einem nur das Ab- und Anmelden oder der Betrieb einer zweiten Kopie der App mit eigenem Profil, was sich von Hand mühsam einrichten lässt. Genau diese Lücke behandelt der nächste Abschnitt.
Dies ist der zu Beginn erwähnte Produktabschnitt.
Ich habe Claude Sessions Pro gebaut, weil ich meine Konten auch in der Desktop-App und nicht nur im Terminal nebeneinander nutzen wollte, ohne Aliase und Profile auf zwei Betriebssystemen pflegen zu müssen.
Es richtet sich an Konten, die man bereits besitzt, und ist kein Weg zu mehr Nutzung: Jedes Konto behält seine eigenen Limits, und Anthropics Bedingungen gelten für jedes einzelne. Es läuft auf macOS 14 oder neuer sowie auf Windows 10 und 11, kostet einmalig 15 Dollar für zwei Computer und bietet eine kostenlose einstündige Vorschau sowie 14 Tage Rückgaberecht. Es ist eine unabhängige App, nicht von Anthropic entwickelt oder mit ihr verbunden.
Claude Sessions Pro eine Stunde kostenlos ausprobieren →
Ist der Betrieb zweier Konten auf diese Weise erlaubt? Man meldet sich bei zwei Konten an, die man bereits besitzt, eines pro Ordner, statt sich ab- und wieder anzumelden. Jedes Konto unterliegt weiterhin Anthropics Bedingungen und seinen eigenen Plan-Limits. Nutzt man keine zusätzlichen Konten, um ein Limit zu umgehen.
Addieren sich die Nutzungslimits? Nein. Jedes Konto hat seine eigenen Limits und seine eigene Nutzung, genau so, als hätte man mit /logout gewechselt.
Kann ich drei oder mehr betreiben? Ja. Ein Ordner und ein Alias (oder ein direnv-Ordner) pro Konto.
Funktioniert es in WSL? Ja, die Linux-Anleitungen gelten auch innerhalb von WSL. Zu beachten ist, dass WSL und Windows separate Ordner führen, sodass ein auf der Windows-Seite angemeldetes Konto nicht in WSL angemeldet ist und umgekehrt.
Bricht ein Claude-Code-Update das ab? CLAUDE_CONFIG_DIR ist eine dokumentierte Einstellung und war bislang über Updates hinweg stabil. Falls sich etwas ändert, zeigt claude auth status am schnellsten, welchen Ordner eine Sitzung wirklich verwendet.
Kann ich meinen bestehenden Verlauf auf das neue Konto übertragen? Der Sitzungsverlauf ist pro Ordner organisiert. Man kann den Ordner eines Projekts von ~/.claude/projects/ nach ~/.claude-work/projects/ kopieren, um ihn dort fortsetzen zu können. Das sollte man nur tun, wenn die Konversation zu diesem Konto gehört, etwa wenn Arbeitscode zum Arbeitskonto wechselt.
Der ganze Trick besteht aus einer einzigen Umgebungsvariable: ein Ordner pro Konto und eine Möglichkeit, Claude Code mit dem richtigen zu starten. Ein Alias unter macOS und Linux, eine kleine Funktion unter Windows, direnv, wenn es automatisch geschehen soll, und eine Statuszeile, damit man nie raten muss. Der Rest dieses Beitrags sind die Sonderfälle, die nach dem ersten Tag zuschlagen.
Wer das lieber erledigt haben möchte, im Terminal wie in Claude Desktop: Claude Sessions Pro kostet einmalig 15 Dollar, mit einer kostenlosen Stunde zum Ausprobieren. Auf der Website gibt es ausführlichere Beiträge zum Betrieb zweier Claude-Code-Konten im Terminal und zum Wechseln von Claude-Code-Konten.
Wenn du auf eine Stolperfalle gestoßen bist, die hier nicht auftaucht, sag es mir in den Kommentaren und ich ergänze sie.
Automatisch übersetzt. Das Original auf Englisch ist unten aufklappbar.
Original (Englisch) anzeigen
Disclosure: I make Claude Sessions Pro, a paid Mac and Windows app for running several Claude accounts at once. Everything below works without it. The app gets one section near the end, clearly marked.
You have a work Claude account and a personal one. Maybe one per client. Claude Code signs in to one of them, and switching means /logout, /login, a browser tab, and losing your place. An hour later you do it again in the other direction.
You don't need to. Claude Code keeps everything about an account (the login, settings, history, MCP servers) in one folder, and you can point it at a different folder whenever you start it. Two folders, two accounts, both open at the same time in two terminals.
This guide covers the setup on macOS, Linux and Windows (PowerShell, cmd and Windows Terminal), how to run both side by side, how to let each project folder pick its own account, VS Code, CI, and the handful of things that quietly put both terminals on the same login. I checked the core of it (the alias, the PowerShell functions, the Windows Terminal profile, the tmux split, auth status and where MCP servers end up) on macOS and Windows 11.
When Claude Code starts, it looks at one environment variable, CLAUDE_CONFIG_DIR. If it isn't set, it uses ~/.claude. That folder is the account, for practical purposes:
So "a second account" is just "a second folder". Nothing is copied or patched, and your default setup isn't touched.
Pick a name. I'll use ~/.claude-work throughout; one folder per extra account works the same way ( ~/.claude-clientA, ~/.claude-personal ).
# Default account: plain `claude`, ~/.claude # Work account: `claude-work`, ~/.claude-work alias claude-work = 'CLAUDE_CONFIG_DIR="$HOME/.claude-work" claude' Enter fullscreen mode Exit fullscreen mode Open a new terminal and run it:
claude-work Enter fullscreen mode Exit fullscreen mode Claude Code doesn't find a login in the new folder, so it walks you through first-run setup and opens the browser. Sign in with the other account. That's the only time you'll do it. From now on claude is one account and claude-work is the other, and you can have both running at once.
claude auth status claude-work auth status Enter fullscreen mode Exit fullscreen mode Each prints a small JSON block. Look at email and configDirectory: the first should show your default account and ~/.claude, the second your work account and ~/.claude-work. ( auth status needs a recent Claude Code; run claude update if it isn't recognised.)
It's tempting to make things symmetrical with a second alias, claude-personal='CLAUDE_CONFIG_DIR=~/.claude claude'. Don't. On macOS, setting the variable at all, even to the default path, makes Claude Code look for a different Keychain entry, so your personal account suddenly appears signed out. It's tracked as issue #92252. Leave your main account on plain claude with the variable unset, and give every extra account its own new folder.
The idea is the same, but PowerShell has no VAR=value command shorthand. If you just run $env:CLAUDE_CONFIG_DIR =... and then claude, the variable stays set for every later command in that window, and the next plain claude is your work account too.
This function sets the variable for one call and puts it back afterwards, even if Claude Code exits with an error:
function claude-work { $prev = $ env: CLAUDE_CONFIG_DIR $ env: CLAUDE_CONFIG_DIR = Join-Path $HOME '.claude-work' try { claude @ args } finally { $ env: CLAUDE_CONFIG_DIR = $prev } } Enter fullscreen mode Exit fullscreen mode Put it in your profile so it's always there. notepad $PROFILE opens the file (create it if Notepad asks). Open a new PowerShell window, run claude-work, sign in with the second account, and check both with claude auth status and claude-work auth status as above. @args passes everything through, so claude-work --resume and claude-work mcp list work as you'd expect.
cmd.exe: quote the whole assignment, or cmd keeps the space before && as part of the folder name:
set "CLAUDE_CONFIG_DIR= %USERPROFILE% \.claude-work" && claude Enter fullscreen mode Exit fullscreen mode This one does stay set for the rest of that cmd window, so use a dedicated window for it.
Windows Terminal profile. If you'd rather have a "Claude (work)" entry in the new-tab menu, open Settings, then Open JSON file, and add a profile to profiles.list:
{ "name": "Claude (work)", "commandline": "powershell.exe -NoExit -Command \" $env:CLAUDE_CONFIG_DIR = Join-Path $HOME '.claude-work'; claude \" ", "startingDirectory": "%USERPROFILE%", "tabTitle": "WORK" } Enter fullscreen mode Exit fullscreen mode The variable only exists inside that tab, so every other tab is untouched. -NoExit keeps the window open when you quit Claude Code, so you can start it again with the same account by typing claude.
Once the folders exist, "side by side" is just two terminals.
tmux (macOS and Linux). One command, two panes, one account each:
tmux new-session -s claude 'claude' \; split-window -h 'CLAUDE_CONFIG_DIR="$HOME/.claude-work" claude' Enter fullscreen mode Exit fullscreen mode Left pane: default account. Right pane: work. Each pane closes when you quit Claude Code in it.
iTerm2. Settings, Profiles, duplicate your profile and name it "Claude work". Under General, set Send text at start to export CLAUDE_CONFIG_DIR="$HOME/.claude-work", and put WORK in Badge, which draws a large faint label behind the text. Now split a pane with that profile (right-click a pane, Split Pane with Profile ).
macOS Terminal. Settings, Profiles, duplicate a profile and name it "Claude work". On the Shell tab, tick Run command and Run inside shell, and enter CLAUDE_CONFIG_DIR="$HOME/.claude-work" claude. A new window with that profile opens straight into Claude Code on the work account. Give the profile a different background colour while you're there.
Windows Terminal. Hold Alt and click "Claude (work)" in the new-tab dropdown: it opens as a split pane next to the current one instead of a new tab. Alt+Shift+- and Alt+Shift+Plus split the current pane if you'd rather start from a plain shell.
The alias works, but you still have to remember which one to type. If your work repos all live under one folder, let the folder decide.
direnv (macOS, Linux, WSL). Install it ( direnv.net ), hook it into your shell, then in the root of your work folder:
# ~/work/.envrc export CLAUDE_CONFIG_DIR = " $HOME /.claude-work" Enter fullscreen mode Exit fullscreen mode Run direnv allow once. Now cd ~/work/anything sets the variable and leaving unsets it, so plain claude uses the right account in every repo below that folder. Add.envrc to your global gitignore if your repos are shared.
No direnv? A shell function does the same check every time you start Claude Code:
# ~/.zshrc or ~/.bashrc claude () { case " $PWD /" in " $HOME /work/" * ) CLAUDE_CONFIG_DIR = " $HOME /.claude-work" command claude " $@ ";; * ) command claude " $@ ";; esac } Enter fullscreen mode Exit fullscreen mode command claude calls the real binary rather than the function again. Add one line per client folder if you have more than two accounts.
PowerShell can do the same inside the function from earlier:
function claude { $prev = $ env: CLAUDE_CONFIG_DIR if ( $PWD. Path -like ( Join-Path $HOME 'work\*' )) { $ env: CLAUDE_CONFIG_DIR = Join-Path $HOME '.claude-work' } try { claude.exe @ args } finally { $ env: CLAUDE_CONFIG_DIR = $prev } } Enter fullscreen mode Exit fullscreen mode If claude.exe isn't found, check what Get-Command claude -All lists and call that name instead (npm installs a claude.cmd, so it's claude.cmd @args in that case).
The Claude Code extension has a setting for environment variables, claudeCode.environmentVariables, and it would be the obvious place for CLAUDE_CONFIG_DIR. The catch: it's a machine-scoped setting. VS Code ignores it in a workspace's.vscode/settings.json, so you can't give one project the work account and another the personal one this way. Set it in your user settings and it applies to every window. If you do set it there, use an absolute path; ~ isn't expanded.
What does work per project is the integrated terminal. In the work project's.vscode/settings.json:
{ "terminal.integrated.env.osx": { "CLAUDE_CONFIG_DIR": "/Users/you/.claude-work" }, "terminal.integrated.env.linux": { "CLAUDE_CONFIG_DIR": "/home/you/.claude-work" }, "terminal.integrated.env.windows": { "CLAUDE_CONFIG_DIR": "C: \\ Users \\ you \\.claude-work" } } Enter fullscreen mode Exit fullscreen mode New terminals in that window get the variable, and claude run there uses the work account. VS Code asks you to trust the workspace before it applies terminal environment settings. Cursor and Windsurf read the same keys. JetBrains IDEs have the same idea under Settings, Tools, Terminal, Environment variables.
Two identical terminals with different accounts is a recipe for running the client job on your personal plan. Give the work folder a status line that says so. Create ~/.claude-work/statusline.sh:
#!/bin/sh # Claude Code pipes session info as JSON on stdin; we only need a label. cat > /dev/null printf '\033[44;97m WORK \033[0m %s' " $( basename " $PWD " ) " Enter fullscreen mode Exit fullscreen mode Make it executable ( chmod +x ~/.claude-work/statusline.sh ) and point the work folder's ~/.claude-work/settings.json at it:
{ "statusLine": { "type": "command", "command": "~/.claude-work/statusline.sh" } } Enter fullscreen mode Exit fullscreen mode The default account keeps its own settings.json, so only the work sessions show the blue WORK tag. Combined with a coloured terminal profile or an iTerm2 badge, you can tell them apart from across the room. And when in doubt, /status inside a session shows the account it's signed in to.
A new folder starts empty: no CLAUDE.md, no skills, no agents. You probably want those to be the same everywhere. Symlink them:
ln -s ~/.claude/CLAUDE.md ~/.claude-work/CLAUDE.md ln -s ~/.claude/skills ~/.claude-work/skills ln -s ~/.claude/agents ~/.claude-work/agents ln -s ~/.claude/commands ~/.claude-work/commands Enter fullscreen mode Exit fullscreen mode (On Windows, New-Item -ItemType SymbolicLink does the same, but needs Developer Mode or an admin prompt. Copying the files is fine too.)
Never share or symlink.credentials.json,.claude.json or the whole folder. Those hold the login and per-account state. Sharing them is how you end up with one account in both terminals, or each terminal signing the other one out.
MCP servers don't come along. User-scope servers live in the account's own.claude.json (see the diagram), so the work account starts with none. Add them again through the work alias:
claude-work mcp add --scope user --transport http notion https://mcp.notion.com/mcp claude-work mcp list Enter fullscreen mode Exit fullscreen mode Project-scope servers (a.mcp.json checked into the repo) are read from the repo, so they work for both accounts without doing anything.
Settings can be shared by symlinking settings.json, but most people want the work one to differ, at least for the status line above.
If both auth status calls show the same email, one of these is almost always why.
Same idea in a pipeline: one token per account. On your machine, run setup-token with each account's folder:
claude setup-token # default account claude-work setup-token # work account Enter fullscreen mode Exit fullscreen mode Store each token as a separate secret ( CLAUDE_CODE_OAUTH_TOKEN_PERSONAL, CLAUDE_CODE_OAUTH_TOKEN_WORK ) and map the right one to CLAUDE_CODE_OAUTH_TOKEN in each job. The runner never needs a config folder or a browser login.
None of this applies to the Claude Desktop app. It ignores CLAUDE_CONFIG_DIR and signs in to one account at a time, including in its Code tab. To use two accounts there, you're back to signing out and in, or running a second copy of the app with its own profile, which is fiddly to set up by hand. That's the gap the next section is about.
This is the product section mentioned at the top.
I built Claude Sessions Pro because I wanted my accounts side by side in the desktop app as well as the terminal, without maintaining aliases and profiles on two operating systems.
It's for accounts you already have, not a way to get more usage: each account keeps its own limits, and Anthropic's terms apply to each one. It runs on macOS 14 or later and Windows 10 and 11, costs $15 once for two computers, and has a free one-hour preview and a 14-day refund. It's an independent app, not made by or affiliated with Anthropic.
Try Claude Sessions Pro free for an hour →
Is running two accounts like this allowed? You're signing in to two accounts you already have, one per folder, instead of signing out and back in. Each account is still bound by Anthropic's terms and its own plan limits. Don't use extra accounts to get around a limit.
Do the usage limits combine? No. Each account has its own limits and its own usage, exactly as if you'd switched with /logout.
Can I run three or more? Yes. One folder and one alias (or one direnv folder) per account.
Does it work in WSL? Yes, the Linux instructions apply inside WSL. Note that WSL and Windows keep separate folders, so an account signed in on the Windows side isn't signed in inside WSL, and vice versa.
Will a Claude Code update break it? CLAUDE_CONFIG_DIR is a documented setting, so it's been stable across updates. If something changes, claude auth status is the quickest way to see which folder a session is really using.
Can I move my existing history to the new account? Session history is per folder. You can copy a project's folder from ~/.claude/projects/ to ~/.claude-work/projects/ to make it resumable there. Only do it when the conversation belongs with that account, for example work code moving to the work account.
The whole trick is one environment variable: a folder per account, and a way to start Claude Code with the right one. An alias on macOS and Linux, a small function on Windows, direnv if you want it automatic, a status line so you never guess. The rest of this post is the edge cases that bite after the first day.
If you'd rather have it done for you, in the terminal and in Claude Desktop, Claude Sessions Pro is $15 once, with a free hour to try it. There are longer write-ups on running two Claude Code accounts in the terminal and switching Claude Code accounts on the site.
If you've hit a gotcha that isn't here, tell me in the comments and I'll add it.