Claude-multiprofile: macOS에서 여러 Claude 계정을 나란히 실행

hackernews | | 🔧 개발도구
#claude #claude code #profiles #계정전환 #환경 분리
원문 출처: hackernews · Genesis Park에서 요약 및 분석

요약

이 도구는 macOS에서 여러 Claude 계정을 개인, 업무, 클라이언트 등 별도의 프로필로 동시에 실행할 수 있게 해줍니다. 각 프로필은 로그인, 채팅, MCP 커넥터 등이 완전히 격리되어 계정을 로그아웃 없이 자유롭게 사용할 수 있습니다. 공식 지원은 아니지만 전자 옵션과 환경 변수를 활용해 데스크톱과 코드 버전 모두에서 안정적으로 작동합니다.

본문

Run multiple Claude accounts side by side on macOS. Personal and work, multiple clients, separate test accounts. Each profile is fully isolated: its own login, chats, settings, MCP connectors, plugins, and skills. No more signing out of one account to use another. Works for both Claude Desktop (the GUI app) and Claude Code (the terminal CLI), independently or together. See it in action: examples/walkthrough.md — a full session showing every prompt and output. Disclaimer. This is an unofficial community tool. It uses public Electron flags ( --user-data-dir ) and a stable but undocumented Claude Code environment variable (CLAUDE_CONFIG_DIR ) to keep profiles isolated. Anthropic engineers have engaged on the open feature requests for native multi-account in both apps, so the approach is well known, but it is not officially supported. If a future Claude release changes how profiles work, this tool will need to catch up. Claude Desktop and Claude Code both assume a single signed-in account. There's no built-in profile switcher today (open feature requests: Desktop, Desktop UI). The standard workaround is a manual setup: - For Desktop, launch with open -n -a "Claude" --args --user-data-dir=... against a custom data folder - For Code, set CLAUDE_CONFIG_DIR=... before runningclaude Both work. Both are fiddly to set up and easy to mess up. This tool automates the whole thing, including the things people forget: - Generating a real macOS .app launcher you can drag to the Dock - Copying the Claude icon onto the launcher so it's visually distinct - Adding a properly quoted shell alias to the right rc file (zsh, bash, fish) - Seeding new Code profiles from your existing ~/.claude so plugins and MCP servers carry over (without leaking auth) - Tracking everything in a registry so you can list, status-check, and cleanly remove profiles npm install -g github:jmdarre-v/claude-multiprofile This installs the latest commit from the main branch. To update, re-run the same command. Not yet published. Will be available as a scoped package (@jmdarre-v/claude-multiprofile ) once it stabilizes. Node 18 or newer. macOS is required for Claude Desktop profiles. Claude Code profiles work on macOS and Linux. claude-multiprofile add The wizard walks you through every choice, explains what each step does, and lets you accept defaults if you don't care. A typical first run takes about 30 seconds. After it finishes, you'll have a new launcher .app on your Dock (for Desktop) and a new shell alias like claude-work (for Code). Sign in once on each, and you're done. For a profile named work , with both Desktop and Code targets, the tool creates: ~/Library/Application Support/Claude-WORK/ ← Desktop data folder ~/Applications/Claude WORK.app ← Desktop launcher (drag to Dock) ~/.claude-work/ ← Code config folder ~/.zshrc ← adds: alias claude-work='...' ~/.config/claude-multiprofile/profiles.json ← registry entry Nothing about your existing default Claude install changes. Your current login, chats, MCP servers, and skills stay exactly where they are. Claude Desktop is built on Electron. Electron honors the --user-data-dir command-line flag, which moves the entire app state (auth tokens, chat list, settings, MCP connectors, projects, custom styles) to a directory of your choosing. Two .app launchers pointed at two different data folders give you two fully independent Desktop instances. The launcher .app is a tiny AppleScript bundle generated by osacompile , a built-in macOS tool. The script is one line: do shell script "open -n -a 'Claude' --args --user-data-dir='/path/to/your/profile'" . The -n flag forces a new instance even when Claude is already running, which is what makes side-by-side launches work. Claude Code (the terminal CLI) honors the CLAUDE_CONFIG_DIR environment variable. Set it to a folder, and Claude Code reads/writes all of its state (project memory, plugins, skills, MCP servers, slash commands) under that folder instead of the default ~/.claude . Authentication is the interesting bit. Claude Code stores its OAuth token in macOS Keychain, keyed by a SHA-256 hash of the active CLAUDE_CONFIG_DIR . Different config dir, different keychain entry, completely separate session. You can copy a config folder around without leaking auth. This means you can seed a new Code profile from your existing ~/.claude (carrying over skills, plugins, and MCP servers) and the new profile will still ask you to log in fresh. The wizard offers this by default. Interactive wizard. Walks through: - Whether to set up Desktop, Code, or both - The profile name (e.g. work ,work ,client-acme ) - Where the data/config folders should live - Where to save the launcher .app (Desktop only) - Whether to copy the Claude icon onto the launcher (Desktop only) - The shell alias name (Code only) - Whether to seed the new Code profile from your existing ~/.claude (Code only) Then prints a plan, asks for confirmation, and applies. Prints every configured profile with its paths and creation date. Walks every profile and verifies the directories, .app, and shell aliases still exist. Useful after a machine migration or after manually editing your .zshrc . Re-registers a profile's launcher .app with macOS LaunchServices. Use this if the Dock icon stops responding to double-clicks even though the .app bundle is intact and open path/to/Claude\ Work.app from the terminal still works. The underlying cause is a stale LaunchServices cache, which can happen after macOS updates, app moves, or sometimes for no clear reason. The command runs lsregister -f on the launcher and touches the bundle to nudge the icon cache. Running it on a healthy profile is harmless. For Code-only profiles, this command has nothing to repair (there's no .app) and exits cleanly. Tears down a profile. Removes the launcher .app, the shell alias, and the registry entry. By default the data folders are kept (so you can recover your chats if you change your mind). The wizard asks separately about deleting the data folders. Self-explanatory. This is the part most guides skip and most users get burned by. Claude Desktop's sign-in flow uses a claude:// deep link that macOS hands to whichever Claude instance is running. If two are open at once, the auth token can land on the wrong one and you'll end up with both profiles signed into the same account. The fix is simple but important: - Quit any other Claude window with Cmd+Q before doing the very first launch of the new profile. - Double-click the new launcher (or run open ~/Applications/Claude\ WORK.app ). - Sign in with the account for this profile. - Quit (Cmd+Q) once you've confirmed it logged in correctly. From that point on, both profiles can run simultaneously. The auth token is stored in the per-profile data folder and won't get re-routed. source ~/.zshrc # or open a new terminal tab claude-work # launches Claude Code with CLAUDE_CONFIG_DIR set Inside the REPL, run /login . A browser tab opens. Sign in with the account for this profile. The OAuth token gets stored in Keychain under a key derived from the profile's config dir, so it's fully separate from your default account. If you always want a specific profile active in a particular repo, drop a .envrc (with direnv) or a .env file: export CLAUDE_CONFIG_DIR="$HOME/.claude-work" When you cd into the repo, the variable is set automatically. Plain claude from inside that directory uses the right profile. By default, all profile launcher .apps share the Claude icon. If you want them visually distinct on the Dock: - Right-click ~/Applications/Claude WORK.app → Get Info - Drag any image (PNG, ICNS, JPG) onto the small icon in the top-left of the Info window - The Dock and Cmd-Tab will pick up the new icon within a few seconds For the terminal side, you can prefix with a colored slash command: alias claude-work='CLAUDE_CONFIG_DIR=~/.claude-work claude -e "/color blue"' /color makes the Claude Code REPL prompt visually distinct so you don't lose track of which account you're in. Profiles are independent, so installing a skill in one doesn't affect the others. If you want one set of skills available to all your profiles, symlink the skills directory: rm -rf ~/.claude-work/skills ln -s ~/.claude/skills ~/.claude-work/skills Same trick works for plugins or any sub-folder you want to share. Be careful with projects/ if you want chat history to stay separate, that's the folder you do not want shared. The new Desktop profile launched already signed into my other account. You launched it while the other Claude instance was running. The claude:// auth deep link got routed to the wrong app. Fix: rm -rf ~/Library/Application\ Support/Claude-WORK Then quit ALL Claude windows (Cmd+Q) and launch the new profile again. It'll start fresh and you can sign in cleanly. The launcher icon stopped responding to double-clicks but open from terminal still works. This is a stale macOS LaunchServices cache. Run: claude-multiprofile repair The command re-registers the .app with LaunchServices and refreshes the icon cache. If clicking still doesn't work after that, log out and back in to force a full LaunchServices reset. The shell alias isn't found. Aliases live in your shell's rc file but they only get loaded when a new shell starts. Either open a new terminal tab or source ~/.zshrc (or whatever your shell's rc file is). Run claude-multiprofile status to confirm the alias is actually in the rc file. The launcher .app shows the AppleScript icon, not Claude's. You answered "no" to the icon copy step, or your Claude.app install is in a non-standard location. Either re-run claude-multiprofile add (and remove the old profile first) or copy the icon manually: cp /Applications/Claude.app/Contents/Resources/*.icns \ ~/Applications/Claude\ WORK.app/Contents/Resources/applet.icns touch ~/Applications/Claude\ WORK.app I want to see what's in the registry. cat ~/.config/claude-multiprofile/profiles.json It's a plain JSON file. You can inspect or hand-edit it, though running the CLI commands is safer. I'm on Linux. The Code half works fine on Linux, the Desktop half doesn't (Claude Desktop is macOS-only at the moment). The wizard skips Desktop questions on non-macOS automatically. | Tool | Desktop | Code | Mac | Linux | Notes | |---|---|---|---|---|---| | claude-multiprofile (this) | yes | yes | yes | partial | Single tool for both, interactive wizard | | aimux | no | yes | yes | yes | Code only, also handles symlink-sharing | | aisw | no | yes | yes | yes | Rust binary, also covers Codex CLI and Gemini CLI | | Jean-Claude | no | yes | yes | yes | Cross-machine sync, opinionated dotfiles | | Manual setup | yes | yes | yes | yes | Documented in several places | The pitch for this tool over the others: it's the only one that handles Claude Desktop alongside Claude Code in a single command, and the interactive wizard means you don't have to remember the right flags or know in advance where files should go. The tool reads and writes the following on your machine: ~/Library/Application Support/Claude-{Name}/ (creates new folders only)~/Applications/ (creates new .app bundles only)~/.claude-{name}/ (creates new folders only)~/.zshrc ,~/.bash_profile , or~/.config/fish/config.fish (adds a delimited managed block; never touches lines outside the markers)~/.config/claude-multiprofile/profiles.json (the registry) It does not touch: - Your default Claude data folder ( ~/Library/Application Support/Claude/ ) - Your default ~/.claude (except to read it for seeding, never to write) - macOS Keychain (Claude Code's auth lives there but the tool never reads or writes Keychain entries) - Anything else on your filesystem The single npm dependency is @inquirer/prompts , the standard interactive-prompt library used by npm itself and most modern CLI tools. Issues and PRs welcome. The codebase is small and aggressively commented, so it should be easy to navigate. Run the tests with npm test . MIT

Genesis Park 편집팀이 AI를 활용하여 작성한 분석입니다. 원문은 출처 링크를 통해 확인할 수 있습니다.

공유

관련 저널 읽기

전체 보기 →