How I Forced My Mac to Run 2 Instances of Claude Desktop AND Claude Code
If you use Claude for both personal projects and client work, you already know the pain: one account, one context, and a full logout/login cycle every time you switch. It kills momentum.
Here's how to run two fully isolated Claude Desktop apps and two separate Claude Code CLI sessions on the same Mac — each with its own login, memory, and billing.
The Problem
By default, macOS treats Claude Desktop as a single-instance Electron app. Launch it twice and it just brings the existing window to the front. Claude Code CLI has the same limitation — one authenticated session at a time.
For anyone juggling a personal account and a work account (or an agency running multiple client projects), this is a dealbreaker.
The Fix: Isolated User Data Directories
The trick is Electron's --user-data-dir flag. Every Electron app stores its session data, cookies, and local storage in a single directory. Point two instances at different directories and they become completely independent apps.
Step 1: Launch a Second Claude Desktop Instance
Open Terminal and run:
open -n /Applications/Claude.app --args --user-data-dir="$HOME/.claude-work"
Breaking this down:
open -nforces macOS to open a new instance even if one is already running--user-data-dirtells Electron to use a separate config/session directory$HOME/.claude-workis where the second instance stores everything
Your original Claude Desktop keeps using its default directory. The new one is a clean slate — sign in with your second account and you're running two side-by-side.
Step 2: Make It a One-Click Dock App
Running a Terminal command every time is tedious. Create an AppleScript wrapper:
- Open Script Editor (search in Spotlight)
- Paste this script:
do shell script "open -n /Applications/Claude.app --args --user-data-dir=$HOME/.claude-work &"
- File → Export as Application
- Name it "Claude Work" and save it to Applications
- Drag it to your Dock
Now you have two Claude icons in your Dock — one personal, one work.
Step 3: Run Two Claude Code CLI Sessions
Claude Code stores its auth and config in ~/.claude/ by default. Override it with the CLAUDE_CONFIG_DIR environment variable.
Add these aliases to your ~/.zshrc:
# Personal Claude Code (default)
alias claude-personal='claude'
# Work Claude Code (isolated config)
alias claude-work='CLAUDE_CONFIG_DIR="$HOME/.claude-work-cli" claude'
Then reload:
source ~/.zshrc
Now claude-work launches an entirely separate CLI session. Run claude-work once to authenticate with your work account, and it stays logged in independently.
Step 4: Watch Your Browser During Auth
One gotcha: when you authenticate a new CLI session, Claude opens your default browser to complete the OAuth flow. If you're already logged into Claude in that browser with a different account, the token might route to the wrong session.
Fix: Use a different browser (or an incognito window) for the second account's authentication. Once the token is stored, subsequent sessions don't need the browser.
The Result
You now have four independent Claude environments on one Mac:
| Environment | Account | Config Location |
|---|---|---|
| Claude Desktop (Personal) | Personal | Default |
| Claude Desktop (Work) | Work | ~/.claude-work |
| Claude Code CLI (Personal) | Personal | ~/.claude |
| Claude Code CLI (Work) | Work | ~/.claude-work-cli |
Each has its own:
- Authentication and billing
- Conversation history
- Local memory and project context
- Plugin configurations
Why This Matters for Plugin Users
If you're running Claude Code plugins like Superpowers or GStack, each instance maintains its own plugin state. You can have different plugin configurations per client, per project, or per team — without any cross-contamination.
Install plugins independently in each environment:
# Personal setup
claude /install cobra/superpowers
# Work setup (uses work config)
claude-work /install garrytan/gstack
TL;DR
- Use
open -nwith--user-data-dirfor multiple Desktop instances - Wrap it in an AppleScript app for one-click launching
- Use
CLAUDE_CONFIG_DIRenv var for multiple CLI sessions - Use separate browsers for OAuth to avoid token conflicts
This takes about 5 minutes to set up and saves hours of context-switching every week.
