How to run multiple Claude accounts at once (Desktop + Claude Code), and why the obvious hacks break
说明与用途
用户可以通过为每个账户分配单独的数据目录来同时运行多个Claude账户,保留上下文、正确处理Google登录并保留Code会话,避免共享Dock图标和身份验证错误转发。
问题
Claude Desktop and Claude Code can only hold one signed‑in account, forcing users to sign out and back in to switch between company and personal accounts.
结果
Users can run multiple Claude accounts simultaneously with separate data directories, preserving context, correct Google sign‑in, and Code sessions, while avoiding the pitfalls of shared Dock icons and misrouted authentication.
工作流
- Set up separate config directories for Claude Code using the CLAUDE_CONFIG_DIR environment variable or aliases.
- Launch a second Claude Desktop instance with the --user-data-dir flag (macOS: open -n -a Claude --args --user-data-dir="$HOME/Library/Application Support/Claude-Work"; Windows: Start-Process "...\claude-desktop.exe" -ArgumentList "--user-data-dir=...\ClaudeProfiles\Work").
- Create shell functions or Script Editor launchers for quick access to each profile.
- Use email sign‑in for additional profiles or close the default instance before Google sign‑in to avoid misrouting.
- Optionally use a paid app like Claude Sessions Pro to automate profile creation and handle updates.
证据
Claude Desktop is an Electron app, so it's Chromium underneath. Everything for the signed‑in account (session cookies, settings, connectors, MCP config, the list of Claude Code sessions) lives in one user data directory:
The CLI is the easy part. It reads its login and settings from a config directory, which you can override:
Chromium apps accept --user-data-dir, and Claude Desktop honors it. This starts a second, independent Claude next to your normal one:
Google sign-in comes back to the wrong window ... the OS routes that link to the app registered for claude://, not to the specific window that started the login.
- 记录日期: 2026-10-13T00:41:18.514Z