claude-multi-desktop 0.1.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- claude_multi_desktop/__init__.py +16 -0
- claude_multi_desktop/__main__.py +3 -0
- claude_multi_desktop/claude-multi-desktop +442 -0
- claude_multi_desktop-0.1.2.dist-info/METADATA +319 -0
- claude_multi_desktop-0.1.2.dist-info/RECORD +8 -0
- claude_multi_desktop-0.1.2.dist-info/WHEEL +4 -0
- claude_multi_desktop-0.1.2.dist-info/entry_points.txt +2 -0
- claude_multi_desktop-0.1.2.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""Run multiple Claude Desktop accounts at once on a Mac, sharing one Claude Code setup.
|
|
2
|
+
|
|
3
|
+
This package only carries the claude-multi-desktop bash script and starts it with /bin/bash, so
|
|
4
|
+
`pipx install claude-multi-desktop` and `uvx claude-multi-desktop` give the same command as Homebrew.
|
|
5
|
+
"""
|
|
6
|
+
import os
|
|
7
|
+
import sys
|
|
8
|
+
|
|
9
|
+
__version__ = "0.1.2"
|
|
10
|
+
SCRIPT = os.path.join(os.path.dirname(os.path.abspath(__file__)), "claude-multi-desktop")
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def main():
|
|
14
|
+
if sys.platform != "darwin":
|
|
15
|
+
sys.exit("claude-multi-desktop: Claude Desktop launchers need macOS")
|
|
16
|
+
os.execv("/bin/bash", ["/bin/bash", SCRIPT] + sys.argv[1:])
|
|
@@ -0,0 +1,442 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# claude-multi-desktop: run several Claude Desktop accounts side by side on one Mac.
|
|
3
|
+
# Every account keeps its own sign-in and chats; Claude Code in every account shares one ~/.claude.
|
|
4
|
+
# https://github.com/jackson-cmd/claude-multi-desktop · MIT License · not affiliated with Anthropic
|
|
5
|
+
set -euo pipefail
|
|
6
|
+
|
|
7
|
+
VERSION="0.1.2"
|
|
8
|
+
SUPPORT="$HOME/Library/Application Support"
|
|
9
|
+
APPS_DIR="${CMD_APPS_DIR:-$HOME/Applications}"
|
|
10
|
+
CLAUDE_HOME="${CLAUDE_CONFIG_DIR:-$HOME/.claude}"
|
|
11
|
+
MARKER="# claude-multi-desktop launcher"
|
|
12
|
+
PALETTE=(3B6FD8 2E9D6A 7A5AE0 1F9AA8 D2504B C98A12 C8508A 5C6470)
|
|
13
|
+
PLISTBUDDY=/usr/libexec/PlistBuddy
|
|
14
|
+
|
|
15
|
+
die() { printf 'claude-multi-desktop: %s\n' "$*" >&2; exit 1; }
|
|
16
|
+
say() { printf '%s\n' "$*"; }
|
|
17
|
+
|
|
18
|
+
usage() {
|
|
19
|
+
cat <<'EOF'
|
|
20
|
+
claude-multi-desktop: run several Claude Desktop accounts side by side on one Mac.
|
|
21
|
+
|
|
22
|
+
Usage:
|
|
23
|
+
claude-multi-desktop add NAME [--icon ICON] [--color HEX]
|
|
24
|
+
Make a launcher "Claude NAME" with its own sign-in
|
|
25
|
+
claude-multi-desktop add NAME --default
|
|
26
|
+
Make a launcher for the account you already use
|
|
27
|
+
claude-multi-desktop icon NAME [--icon ICON] [--color HEX]
|
|
28
|
+
Give a launcher a new icon or colour
|
|
29
|
+
claude-multi-desktop rename NAME NEW
|
|
30
|
+
Rename a launcher; its sign-in and chats stay
|
|
31
|
+
claude-multi-desktop list Show your launchers and which are open
|
|
32
|
+
claude-multi-desktop open NAME Open that account's window
|
|
33
|
+
claude-multi-desktop peers Show Claude Code sessions running in every account
|
|
34
|
+
claude-multi-desktop remove NAME [--delete-data]
|
|
35
|
+
claude-multi-desktop version | help
|
|
36
|
+
|
|
37
|
+
ICON is one of:
|
|
38
|
+
letter a coloured square with the first letter of the name (the default)
|
|
39
|
+
claude your own Claude icon with a coloured letter badge, drawn on this Mac
|
|
40
|
+
/path/to/image any picture (PNG, JPEG, HEIC, ICNS, ...)
|
|
41
|
+
|
|
42
|
+
Launchers go to ~/Applications (set CMD_APPS_DIR to change it). Each new account keeps its
|
|
43
|
+
sign-in and chats in ~/Library/Application Support/Claude-NAME. Claude Code in every account
|
|
44
|
+
reads the same ~/.claude, so skills, CLAUDE.md, memory and MCP servers are shared and sessions
|
|
45
|
+
in different accounts can message each other.
|
|
46
|
+
|
|
47
|
+
Unofficial; not affiliated with Anthropic. For legitimate use only, with accounts you are entitled
|
|
48
|
+
to use. Do not use it to get around usage limits or to share accounts.
|
|
49
|
+
EOF
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
find_claude() {
|
|
53
|
+
local p
|
|
54
|
+
for p in "${CLAUDE_APP:-}" "/Applications/Claude.app" "$HOME/Applications/Claude.app"; do
|
|
55
|
+
if [ -n "$p" ] && [ -x "$p/Contents/MacOS/Claude" ]; then printf '%s' "$p"; return 0; fi
|
|
56
|
+
done
|
|
57
|
+
return 1
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
check_name() {
|
|
61
|
+
local n="$1"
|
|
62
|
+
[[ "$n" =~ ^[A-Za-z0-9][A-Za-z0-9\ _-]{0,29}$ ]] ||
|
|
63
|
+
die "name must be 1-30 letters, digits, spaces, '-' or '_', starting with a letter or digit: '$n'"
|
|
64
|
+
[[ ! "$n" =~ [-\ ]?3[pP]$ ]] || die "names ending in '3p' clash with folders Claude Desktop creates itself"
|
|
65
|
+
[[ "$n" != *" " ]] || die "name must not end with a space"
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
app_path() { printf '%s/Claude %s.app' "$APPS_DIR" "$1"; }
|
|
69
|
+
slug() { printf '%s' "$1" | tr '[:upper:]' '[:lower:]' | tr -c 'a-z0-9' '-' | sed 's/-*$//'; }
|
|
70
|
+
|
|
71
|
+
# Folder (under ~/Library/Application Support) that a launcher points at, read from the launcher itself.
|
|
72
|
+
launcher_dir() {
|
|
73
|
+
local line
|
|
74
|
+
line="$(grep -o 'user-data-dir="[^"]*"' "$1/Contents/MacOS/launcher" 2>/dev/null | head -1)" || return 1
|
|
75
|
+
line="${line#user-data-dir=\"}"; line="${line%\"}"
|
|
76
|
+
printf '%s' "${line/\$HOME/$HOME}"
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
is_open() { # true when a Claude process runs with this account folder
|
|
80
|
+
local esc procs
|
|
81
|
+
esc="$(printf '%s' "$1" | sed 's/[][\.*^$+?(){}|]/\\&/g')"
|
|
82
|
+
procs="$(ps -axo command= 2>/dev/null || true)"
|
|
83
|
+
grep -Eq -- "--user-data-dir=${esc}( |$)" <<< "$procs" && return 0
|
|
84
|
+
# The default account also runs when Claude.app is opened the normal way, with no flag at all.
|
|
85
|
+
[ "$1" = "$SUPPORT/Claude" ] && grep -Eq '/Claude\.app/Contents/MacOS/Claude$' <<< "$procs"
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
# Draw the launcher icon. STYLE is letter, claude or image; SRC is Claude.app (claude) or the picture (image).
|
|
89
|
+
# Only the picture you choose or the Claude.app on this Mac is read; this tool ships no Anthropic artwork.
|
|
90
|
+
make_icon() { # STYLE LETTER HEX OUT.icns [SRC]
|
|
91
|
+
local tmp; tmp="$(mktemp -d)"
|
|
92
|
+
osascript -l JavaScript - "$1" "$2" "$3" "$tmp/icon.png" "${5:-}" >/dev/null 2>&1 <<'JXA' || true
|
|
93
|
+
ObjC.import('AppKit');
|
|
94
|
+
function run(argv) {
|
|
95
|
+
const style = argv[0], letter = argv[1], n = parseInt(argv[2], 16), out = argv[3], src = argv[4], size = 1024;
|
|
96
|
+
const color = $.NSColor.colorWithSRGBRedGreenBlueAlpha(((n >> 16) & 255) / 255, ((n >> 8) & 255) / 255, (n & 255) / 255, 1);
|
|
97
|
+
let picture = null;
|
|
98
|
+
if (style === 'claude') picture = $.NSWorkspace.sharedWorkspace.iconForFile(src);
|
|
99
|
+
if (style === 'image') picture = $.NSImage.alloc.initWithContentsOfFile(src);
|
|
100
|
+
if (style !== 'letter' && (!picture || picture.isNil() || picture.size.width <= 0)) return;
|
|
101
|
+
const rep = $.NSBitmapImageRep.alloc.initWithBitmapDataPlanesPixelsWidePixelsHighBitsPerSampleSamplesPerPixelHasAlphaIsPlanarColorSpaceNameBytesPerRowBitsPerPixel(
|
|
102
|
+
null, size, size, 8, 4, true, false, $.NSDeviceRGBColorSpace, 0, 0);
|
|
103
|
+
$.NSGraphicsContext.saveGraphicsState;
|
|
104
|
+
$.NSGraphicsContext.setCurrentContext($.NSGraphicsContext.graphicsContextWithBitmapImageRep(rep));
|
|
105
|
+
const drawLetter = (fontSize, cx, cy) => {
|
|
106
|
+
const attrs = $.NSMutableDictionary.dictionary;
|
|
107
|
+
attrs.setObjectForKey($.NSFont.boldSystemFontOfSize(fontSize), $('NSFont'));
|
|
108
|
+
attrs.setObjectForKey($.NSColor.whiteColor, $('NSColor'));
|
|
109
|
+
const s = $.NSString.alloc.initWithString(letter), sz = s.sizeWithAttributes(attrs);
|
|
110
|
+
s.drawAtPointWithAttributes($.NSMakePoint(cx - sz.width / 2, cy - sz.height / 2), attrs);
|
|
111
|
+
};
|
|
112
|
+
if (style === 'letter') {
|
|
113
|
+
color.setFill;
|
|
114
|
+
$.NSBezierPath.bezierPathWithRoundedRectXRadiusYRadius($.NSMakeRect(100, 100, 824, 824), 185, 185).fill;
|
|
115
|
+
drawLetter(500, size / 2, size / 2);
|
|
116
|
+
} else {
|
|
117
|
+
const w = picture.size.width, h = picture.size.height, scale = (style === 'claude' ? size : 824) / Math.max(w, h);
|
|
118
|
+
const dw = w * scale, dh = h * scale;
|
|
119
|
+
picture.drawInRectFromRectOperationFraction($.NSMakeRect((size - dw) / 2, (size - dh) / 2, dw, dh), $.NSMakeRect(0, 0, 0, 0), 2, 1);
|
|
120
|
+
if (style === 'claude') { // a letter badge in the lower right corner, so each account is easy to tell apart
|
|
121
|
+
$.NSColor.whiteColor.setFill;
|
|
122
|
+
$.NSBezierPath.bezierPathWithOvalInRect($.NSMakeRect(566, 46, 420, 420)).fill;
|
|
123
|
+
color.setFill;
|
|
124
|
+
$.NSBezierPath.bezierPathWithOvalInRect($.NSMakeRect(588, 68, 376, 376)).fill;
|
|
125
|
+
drawLetter(250, 776, 256);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
$.NSGraphicsContext.restoreGraphicsState;
|
|
129
|
+
rep.representationUsingTypeProperties(4 /* PNG */, $()).writeToFileAtomically(out, true);
|
|
130
|
+
}
|
|
131
|
+
JXA
|
|
132
|
+
if [ -s "$tmp/icon.png" ]; then
|
|
133
|
+
local sz; mkdir -p "$tmp/icon.iconset"
|
|
134
|
+
for sz in 16 32 128 256 512; do
|
|
135
|
+
sips -z "$sz" "$sz" "$tmp/icon.png" --out "$tmp/icon.iconset/icon_${sz}x${sz}.png" >/dev/null 2>&1 || true
|
|
136
|
+
sips -z $((sz * 2)) $((sz * 2)) "$tmp/icon.png" --out "$tmp/icon.iconset/icon_${sz}x${sz}@2x.png" >/dev/null 2>&1 || true
|
|
137
|
+
done
|
|
138
|
+
iconutil -c icns "$tmp/icon.iconset" -o "$4" >/dev/null 2>&1 || true
|
|
139
|
+
fi
|
|
140
|
+
rm -rf "$tmp"
|
|
141
|
+
[ -s "$4" ]
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
default_color() { local i; i=$(( $(printf '%s' "$1" | cksum | cut -d' ' -f1) % ${#PALETTE[@]} )); printf '%s' "${PALETTE[$i]}"; }
|
|
145
|
+
|
|
146
|
+
# --icon VALUE -> "STYLE<TAB>PICTURE"; a picture is checked before anything is created.
|
|
147
|
+
parse_icon() {
|
|
148
|
+
case "$1" in
|
|
149
|
+
letter|claude) printf '%s\t' "$1" ;;
|
|
150
|
+
"") die "--icon takes letter, claude or the path of a picture" ;;
|
|
151
|
+
*)
|
|
152
|
+
local pic="${1/#\~/$HOME}"
|
|
153
|
+
[ -f "$pic" ] || die "--icon: no such picture '$1' (or use letter or claude)"
|
|
154
|
+
local size; size="$(sips -g pixelWidth "$pic" 2>/dev/null)" || true # in $(), so a crash of sips stays quiet
|
|
155
|
+
[[ "$size" == *"pixelWidth: "[0-9]* ]] || die "--icon: '$1' is not a picture macOS can read"
|
|
156
|
+
pic="$(cd "$(dirname "$pic")" && pwd)/$(basename "$pic")"
|
|
157
|
+
printf 'image\t%s' "$pic" ;;
|
|
158
|
+
esac
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
check_color() { [[ "$1" =~ ^[0-9A-Fa-f]{6}$ ]] || die "--color takes a hex colour such as 3B6FD8"; }
|
|
162
|
+
|
|
163
|
+
write_plist() { # APP NAME STYLE COLOR
|
|
164
|
+
cat > "$1/Contents/Info.plist" <<EOF
|
|
165
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
166
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
167
|
+
<plist version="1.0">
|
|
168
|
+
<dict>
|
|
169
|
+
<key>CFBundleName</key><string>Claude $2</string>
|
|
170
|
+
<key>CFBundleDisplayName</key><string>Claude $2</string>
|
|
171
|
+
<key>CFBundleIdentifier</key><string>local.claude-multi-desktop.$(slug "$2")</string>
|
|
172
|
+
<key>CFBundleExecutable</key><string>launcher</string>
|
|
173
|
+
<key>CFBundleIconFile</key><string>icon</string>
|
|
174
|
+
<key>CFBundlePackageType</key><string>APPL</string>
|
|
175
|
+
<key>CFBundleShortVersionString</key><string>$VERSION</string>
|
|
176
|
+
<key>CFBundleVersion</key><string>$VERSION</string>
|
|
177
|
+
<key>LSUIElement</key><true/>
|
|
178
|
+
<key>ClaudeMultiDesktopIcon</key><string>$3</string>
|
|
179
|
+
<key>ClaudeMultiDesktopColor</key><string>$4</string>
|
|
180
|
+
</dict>
|
|
181
|
+
</plist>
|
|
182
|
+
EOF
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
plist_get() { "$PLISTBUDDY" -c "Print :$2" "$1/Contents/Info.plist" 2>/dev/null || true; }
|
|
186
|
+
|
|
187
|
+
draw_icon() { # APP NAME STYLE COLOR [PICTURE]; prints a note when no icon could be drawn
|
|
188
|
+
local letter src="${5:-}"
|
|
189
|
+
letter="$(printf '%s' "$2" | cut -c1 | tr '[:lower:]' '[:upper:]')"
|
|
190
|
+
if [ "$3" = claude ]; then src="$(find_claude)" || { say "note: Claude.app not found, so the icon is a coloured letter"; draw_icon "$1" "$2" letter "$4"; return; }; fi
|
|
191
|
+
rm -f "$1/Contents/Resources/icon.icns"
|
|
192
|
+
make_icon "$3" "$letter" "$4" "$1/Contents/Resources/icon.icns" "$src" || say "note: could not draw an icon; the launcher works without one"
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
refresh_app() { # tell Finder, Launchpad and the Dock that the launcher changed
|
|
196
|
+
local lsreg=/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister
|
|
197
|
+
touch "$1"
|
|
198
|
+
[ -x "$lsreg" ] && "$lsreg" -f "$1" >/dev/null 2>&1 || true
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
is_ours() { [ -f "$1/Contents/MacOS/launcher" ] && grep -qF "$MARKER" "$1/Contents/MacOS/launcher"; }
|
|
202
|
+
|
|
203
|
+
cmd_add() {
|
|
204
|
+
local name="" default=0 color="" icon="letter" pic=""
|
|
205
|
+
while [ $# -gt 0 ]; do
|
|
206
|
+
case "$1" in
|
|
207
|
+
--default) default=1 ;;
|
|
208
|
+
--color) shift; color="${1:-}" ;;
|
|
209
|
+
--icon) shift; IFS=$'\t' read -r icon pic < <(parse_icon "${1:-}"; printf '\n') ;;
|
|
210
|
+
-h|--help) usage; return 0 ;;
|
|
211
|
+
-*) die "unknown option: $1" ;;
|
|
212
|
+
*) [ -z "$name" ] || die "one name at a time (quote names with spaces)"; name="$1" ;;
|
|
213
|
+
esac
|
|
214
|
+
shift
|
|
215
|
+
done
|
|
216
|
+
[ -n "$name" ] || die "usage: claude-multi-desktop add NAME [--default] [--icon ICON] [--color HEX]"
|
|
217
|
+
check_name "$name"
|
|
218
|
+
[ -n "$icon" ] || exit 1
|
|
219
|
+
local claude; claude="$(find_claude)" || die "Claude.app not found in /Applications or ~/Applications (set CLAUDE_APP=/path/to/Claude.app)"
|
|
220
|
+
color="${color#\#}"
|
|
221
|
+
[ -n "$color" ] || color="$(default_color "$name")"
|
|
222
|
+
check_color "$color"
|
|
223
|
+
|
|
224
|
+
local app dir_expr dir
|
|
225
|
+
app="$(app_path "$name")"
|
|
226
|
+
[ ! -e "$app" ] || die "'$app' already exists (remove it first)"
|
|
227
|
+
# shellcheck disable=SC2016 # $HOME is written into the launcher literally and expands when it runs
|
|
228
|
+
if [ "$default" = 1 ]; then dir_expr='$HOME/Library/Application Support/Claude'
|
|
229
|
+
else dir_expr="\$HOME/Library/Application Support/Claude-$name"; fi
|
|
230
|
+
dir="${dir_expr/\$HOME/$HOME}"
|
|
231
|
+
local other
|
|
232
|
+
for other in "$APPS_DIR"/Claude\ *.app; do
|
|
233
|
+
[ -e "$other" ] || continue
|
|
234
|
+
if [ "$(launcher_dir "$other" || true)" = "$dir" ]; then die "'$other' already opens that account"; fi
|
|
235
|
+
done
|
|
236
|
+
|
|
237
|
+
mkdir -p "$app/Contents/MacOS" "$app/Contents/Resources"
|
|
238
|
+
cat > "$app/Contents/MacOS/launcher" <<EOF
|
|
239
|
+
#!/bin/bash
|
|
240
|
+
$MARKER (https://github.com/jackson-cmd/claude-multi-desktop)
|
|
241
|
+
exec open -n -a "$claude" --args --user-data-dir="$dir_expr"
|
|
242
|
+
EOF
|
|
243
|
+
chmod +x "$app/Contents/MacOS/launcher"
|
|
244
|
+
write_plist "$app" "$name" "$icon" "$color"
|
|
245
|
+
draw_icon "$app" "$name" "$icon" "$color" "$pic"
|
|
246
|
+
refresh_app "$app"
|
|
247
|
+
|
|
248
|
+
say "Created $app"
|
|
249
|
+
say "Account $dir"
|
|
250
|
+
if [ "$default" = 1 ]; then
|
|
251
|
+
say "This launcher opens the account you already use, even while other accounts are open."
|
|
252
|
+
else
|
|
253
|
+
say "Next: claude-multi-desktop open \"$name\" (or double-click it) and sign in with the other account."
|
|
254
|
+
fi
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
# Style and colour a launcher was made with; launchers from 0.1.0 have neither recorded, so use what 0.1.0 drew.
|
|
258
|
+
icon_settings() { # APP NAME -> "STYLE<TAB>COLOR"
|
|
259
|
+
local style color
|
|
260
|
+
style="$(plist_get "$1" ClaudeMultiDesktopIcon)"; color="$(plist_get "$1" ClaudeMultiDesktopColor)"
|
|
261
|
+
printf '%s\t%s' "${style:-letter}" "${color:-$(default_color "$2")}"
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
cmd_icon() {
|
|
265
|
+
local name="" icon="" pic="" color=""
|
|
266
|
+
while [ $# -gt 0 ]; do
|
|
267
|
+
case "$1" in
|
|
268
|
+
--color) shift; color="${1:-}" ;;
|
|
269
|
+
--icon) shift; IFS=$'\t' read -r icon pic < <(parse_icon "${1:-}"; printf '\n'); [ -n "$icon" ] || exit 1 ;;
|
|
270
|
+
-*) die "unknown option: $1" ;;
|
|
271
|
+
*) [ -z "$name" ] || die "one name at a time (quote names with spaces)"; name="$1" ;;
|
|
272
|
+
esac
|
|
273
|
+
shift
|
|
274
|
+
done
|
|
275
|
+
if [ -z "$name" ] || { [ -z "$icon" ] && [ -z "$color" ]; }; then
|
|
276
|
+
die "usage: claude-multi-desktop icon NAME [--icon letter|claude|/path/to/image] [--color HEX]"
|
|
277
|
+
fi
|
|
278
|
+
local app old_style old_color; app="$(app_path "$name")"
|
|
279
|
+
is_ours "$app" || die "no launcher made by this tool at '$app'"
|
|
280
|
+
IFS=$'\t' read -r old_style old_color < <(icon_settings "$app" "$name"; printf '\n')
|
|
281
|
+
color="${color#\#}"; [ -z "$color" ] || check_color "$color"
|
|
282
|
+
if [ -z "$icon" ]; then
|
|
283
|
+
[ "$old_style" != image ] || die "a picture icon has no colour; use --icon letter or --icon claude with --color"
|
|
284
|
+
icon="$old_style"
|
|
285
|
+
fi
|
|
286
|
+
write_plist "$app" "$name" "$icon" "${color:-$old_color}"
|
|
287
|
+
draw_icon "$app" "$name" "$icon" "${color:-$old_color}" "$pic"
|
|
288
|
+
refresh_app "$app"
|
|
289
|
+
say "New icon for $app"
|
|
290
|
+
say "If the Dock still shows the old one, remove the launcher from the Dock and drag it back."
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
cmd_rename() {
|
|
294
|
+
[ $# -eq 2 ] || die "usage: claude-multi-desktop rename NAME NEW-NAME"
|
|
295
|
+
local old="$1" new="$2" from to style color dir
|
|
296
|
+
check_name "$new"
|
|
297
|
+
from="$(app_path "$old")"; to="$(app_path "$new")"
|
|
298
|
+
is_ours "$from" || die "no launcher made by this tool at '$from'"
|
|
299
|
+
[ "$from" != "$to" ] || die "the new name is the same as the old one"
|
|
300
|
+
[ ! -e "$to" ] || [ "$(printf '%s' "$old" | tr '[:upper:]' '[:lower:]')" = "$(printf '%s' "$new" | tr '[:upper:]' '[:lower:]')" ] ||
|
|
301
|
+
die "'$to' already exists"
|
|
302
|
+
IFS=$'\t' read -r style color < <(icon_settings "$from" "$old"; printf '\n')
|
|
303
|
+
dir="$(launcher_dir "$from" || true)"
|
|
304
|
+
local lsreg=/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister
|
|
305
|
+
[ -x "$lsreg" ] && "$lsreg" -u "$from" >/dev/null 2>&1 || true
|
|
306
|
+
mv "$from" "$to.tmp-rename" && mv "$to.tmp-rename" "$to" # two steps, so a change of case also works
|
|
307
|
+
write_plist "$to" "$new" "$style" "$color"
|
|
308
|
+
[ "$style" = image ] || draw_icon "$to" "$new" "$style" "$color"
|
|
309
|
+
refresh_app "$to"
|
|
310
|
+
say "Renamed $from"
|
|
311
|
+
say " to $to"
|
|
312
|
+
say "Account ${dir/#$HOME/~} (unchanged, so its sign-in and chats are kept)"
|
|
313
|
+
say "If the old launcher was in the Dock, drag the new one there."
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
launchers() { # prints one launcher path per line
|
|
317
|
+
local a
|
|
318
|
+
for a in "$APPS_DIR"/Claude\ *.app; do
|
|
319
|
+
is_ours "$a" && printf '%s\n' "$a"
|
|
320
|
+
done
|
|
321
|
+
return 0
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
cmd_list() {
|
|
325
|
+
local found=0 a name dir state
|
|
326
|
+
if [ "${1:-}" = --names ]; then # one NAME per line, for scripts and the Claude Multi Desktop app
|
|
327
|
+
while IFS= read -r a; do [ -z "$a" ] || { a="$(basename "$a" .app)"; say "${a#Claude }"; }; done < <(launchers)
|
|
328
|
+
return 0
|
|
329
|
+
fi
|
|
330
|
+
printf '%-22s %-6s %s\n' "LAUNCHER" "STATE" "ACCOUNT FOLDER"
|
|
331
|
+
while IFS= read -r a; do
|
|
332
|
+
[ -n "$a" ] || continue
|
|
333
|
+
found=1
|
|
334
|
+
name="$(basename "$a" .app)"; dir="$(launcher_dir "$a" || true)"
|
|
335
|
+
if is_open "$dir"; then state="open"; else state="-"; fi
|
|
336
|
+
printf '%-22s %-6s %s\n' "$name" "$state" "${dir/#$HOME/~}"
|
|
337
|
+
done < <(launchers)
|
|
338
|
+
[ "$found" = 1 ] || say "(no launchers yet: claude-multi-desktop add Work)"
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
cmd_open() {
|
|
342
|
+
[ $# -ge 1 ] || die "usage: claude-multi-desktop open NAME"
|
|
343
|
+
local app; app="$(app_path "$1")"
|
|
344
|
+
[ -d "$app" ] || die "no launcher named '$1' (see: claude-multi-desktop list)"
|
|
345
|
+
open "$app"
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
cmd_remove() {
|
|
349
|
+
local name="" del=0 yes=0
|
|
350
|
+
while [ $# -gt 0 ]; do
|
|
351
|
+
case "$1" in
|
|
352
|
+
--delete-data) del=1 ;;
|
|
353
|
+
--yes|-y) yes=1 ;;
|
|
354
|
+
-*) die "unknown option: $1" ;;
|
|
355
|
+
*) name="$1" ;;
|
|
356
|
+
esac
|
|
357
|
+
shift
|
|
358
|
+
done
|
|
359
|
+
[ -n "$name" ] || die "usage: claude-multi-desktop remove NAME [--delete-data]"
|
|
360
|
+
local app dir; app="$(app_path "$name")"
|
|
361
|
+
is_ours "$app" || die "no launcher made by this tool at '$app'"
|
|
362
|
+
dir="$(launcher_dir "$app" || true)"
|
|
363
|
+
rm -rf "$app"
|
|
364
|
+
say "Removed $app"
|
|
365
|
+
[ "$del" = 1 ] || { say "Kept the account folder $dir (sign-in and chats). Add --delete-data to delete it."; return 0; }
|
|
366
|
+
[ "$dir" != "$SUPPORT/Claude" ] || die "refusing to delete your default Claude folder"
|
|
367
|
+
[[ "$dir" == "$SUPPORT/Claude-"* ]] || die "refusing to delete '$dir': not a folder this tool creates"
|
|
368
|
+
if is_open "$dir"; then die "that account is still open; quit its window and run remove again"; fi
|
|
369
|
+
if [ "$yes" != 1 ]; then
|
|
370
|
+
printf 'Delete %s (sign-in and chats of "%s")? Type the name to confirm: ' "$dir" "$name"
|
|
371
|
+
local reply; read -r reply
|
|
372
|
+
[ "$reply" = "$name" ] || die "not deleted"
|
|
373
|
+
fi
|
|
374
|
+
[ -d "$dir" ] || { say "Nothing to delete at $dir"; return 0; }
|
|
375
|
+
rm -rf "$dir"
|
|
376
|
+
say "Deleted $dir"
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
# Which account folder a Claude Code session started from (Claude Desktop records its sessions there).
|
|
380
|
+
profile_of() {
|
|
381
|
+
local host="${1#local_}" d label
|
|
382
|
+
[ -n "$host" ] || { printf 'terminal'; return; }
|
|
383
|
+
for d in "$SUPPORT/Claude" "$SUPPORT"/Claude-*; do
|
|
384
|
+
[ -d "$d/claude-code-sessions" ] || continue
|
|
385
|
+
if grep -rqsF -- "$host" "$d/claude-code-sessions"; then
|
|
386
|
+
label="$(basename "$d")"; label="${label#Claude-}"; [ "$label" = "Claude" ] && label="default"
|
|
387
|
+
printf '%s' "$label"; return
|
|
388
|
+
fi
|
|
389
|
+
done
|
|
390
|
+
printf '?'
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
cmd_peers() {
|
|
394
|
+
local dir="$CLAUDE_HOME/sessions" files=() f pid
|
|
395
|
+
[ -d "$dir" ] || die "no Claude Code sessions folder at $dir"
|
|
396
|
+
for f in "$dir"/*.json; do
|
|
397
|
+
[ -e "$f" ] || continue
|
|
398
|
+
pid="$(basename "$f" .json)"
|
|
399
|
+
[[ "$pid" =~ ^[0-9]+$ ]] && kill -0 "$pid" 2>/dev/null && files+=("$f")
|
|
400
|
+
done
|
|
401
|
+
if [ ${#files[@]} -eq 0 ]; then say "No Claude Code sessions are running."; return 0; fi
|
|
402
|
+
printf '%-14s %-6s %s\n' "ACCOUNT" "STATUS" "SESSION"
|
|
403
|
+
local host status name
|
|
404
|
+
while IFS=$'\t' read -r host status name; do
|
|
405
|
+
printf '%-14s %-6s %s\n' "$(profile_of "$host")" "${status:--}" "${name:-(unnamed)}"
|
|
406
|
+
done < <(osascript -l JavaScript - "${files[@]}" 2>/dev/null <<'JXA'
|
|
407
|
+
ObjC.import('Foundation');
|
|
408
|
+
function run(argv) {
|
|
409
|
+
const rows = [];
|
|
410
|
+
for (const p of argv) {
|
|
411
|
+
try {
|
|
412
|
+
const d = JSON.parse($.NSString.stringWithContentsOfFileEncodingError(p, $.NSUTF8StringEncoding, null).js);
|
|
413
|
+
const clean = (v) => String(v || '').replace(/[\t\n]/g, ' ');
|
|
414
|
+
rows.push([clean(d.hostSessionId), clean(d.status), clean(d.name)].join('\t'));
|
|
415
|
+
} catch (e) {}
|
|
416
|
+
}
|
|
417
|
+
return rows.join('\n');
|
|
418
|
+
}
|
|
419
|
+
JXA
|
|
420
|
+
) | sort -s -k1,1
|
|
421
|
+
say ""
|
|
422
|
+
say "Sessions in different accounts can message each other: ask Claude to list the other sessions and send one a message."
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
main() {
|
|
426
|
+
[ "$(uname -s)" = "Darwin" ] || die "Claude Desktop launchers need macOS"
|
|
427
|
+
local cmd="${1:-help}"; [ $# -gt 0 ] && shift
|
|
428
|
+
case "$cmd" in
|
|
429
|
+
add) cmd_add "$@" ;;
|
|
430
|
+
list|ls) cmd_list "$@" ;;
|
|
431
|
+
icon) cmd_icon "$@" ;;
|
|
432
|
+
rename|mv) cmd_rename "$@" ;;
|
|
433
|
+
open) cmd_open "$@" ;;
|
|
434
|
+
peers) cmd_peers ;;
|
|
435
|
+
remove|rm) cmd_remove "$@" ;;
|
|
436
|
+
version|--version|-v) say "claude-multi-desktop $VERSION" ;;
|
|
437
|
+
help|--help|-h) usage ;;
|
|
438
|
+
*) usage >&2; exit 2 ;;
|
|
439
|
+
esac
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
main "$@"
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: claude-multi-desktop
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: Run multiple Claude Desktop accounts at once on a Mac, sharing one Claude Code setup
|
|
5
|
+
Project-URL: Homepage, https://jackson-cmd.github.io/claude-multi-desktop/
|
|
6
|
+
Project-URL: Source, https://github.com/jackson-cmd/claude-multi-desktop
|
|
7
|
+
Project-URL: Issues, https://github.com/jackson-cmd/claude-multi-desktop/issues
|
|
8
|
+
Project-URL: Changelog, https://github.com/jackson-cmd/claude-multi-desktop/blob/main/CHANGELOG.md
|
|
9
|
+
Author: claude-multi-desktop contributors
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: claude,claude-code,claude-desktop,launcher,macos,multiple-accounts,profiles
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Environment :: Console
|
|
15
|
+
Classifier: Environment :: MacOS X
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
18
|
+
Classifier: Operating System :: MacOS
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Unix Shell
|
|
21
|
+
Classifier: Topic :: Utilities
|
|
22
|
+
Requires-Python: >=3.8
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
|
|
25
|
+
# claude-multi-desktop
|
|
26
|
+
|
|
27
|
+
**Run multiple Claude Desktop accounts at the same time on one Mac. Each window has its own sign-in, and all of them share one Claude Code setup, so a session in one account can send work to a session in another.**
|
|
28
|
+
|
|
29
|
+
One bash script · no dependencies · never modifies Claude.app · macOS
|
|
30
|
+
|
|
31
|
+
> **Unofficial, for legitimate use only.** Use it with accounts you are entitled to use, such as a work account and a personal account. Do not use it to get around usage limits or to share accounts. See the [disclaimer](#disclaimer).
|
|
32
|
+
|
|
33
|
+
[Website](https://jackson-cmd.github.io/claude-multi-desktop/) · [Quick start](#quick-start) · [Install](#install) · [Icons and names](#icons-and-names) · [Sessions talk across accounts](#sessions-talk-across-accounts) · [What is shared](#what-is-shared-and-what-is-not) · [FAQ](#faq) · [Changelog](https://github.com/jackson-cmd/claude-multi-desktop/blob/main/CHANGELOG.md)
|
|
34
|
+
|
|
35
|
+
[](https://github.com/jackson-cmd/claude-multi-desktop/actions/workflows/ci.yml)
|
|
36
|
+
[](https://github.com/jackson-cmd/claude-multi-desktop/blob/main/LICENSE)
|
|
37
|
+

|
|
38
|
+
|
|
39
|
+
<p align="center"><img src="https://jackson-cmd.github.io/claude-multi-desktop/assets/how-it-works.svg" alt="One Claude.app opens one window per account. Each window has its own sign-in and chats, all windows read one shared ~/.claude, and Claude Code sessions in different accounts can message each other." width="860"></p>
|
|
40
|
+
|
|
41
|
+
## What makes it different
|
|
42
|
+
|
|
43
|
+
Claude Desktop runs one account at a time. If you open it again, the same window comes back to the front. Other tools work around this by keeping every account fully separate, Claude Code setup included. This tool keeps the sign-ins separate and lets the accounts share the rest, and that has three uses:
|
|
44
|
+
|
|
45
|
+
1. **Separate accounts, one setup.** Each window signs in to its own Claude account and keeps its own chats, projects and plan. Claude Code in every window reads the same `~/.claude`: your skills, `CLAUDE.md`, memory, MCP servers, hooks and settings. If you write a skill once, every account loads it the next time it starts a session, and you never copy setup files between accounts.
|
|
46
|
+
|
|
47
|
+
2. **Sessions talk across accounts.** Every account records its running Claude Code sessions in the same place, so a session in your Work window can see the sessions in your Personal window and send one a message, using Claude Code's built-in `ListAgents` and `SendMessage` tools. You can type *"ask the trip planning session in my Personal account to check the hotel list"* and the message reaches that session with no copy and paste. `claude-multi-desktop peers` shows which session runs in which account:
|
|
48
|
+
|
|
49
|
+
```text
|
|
50
|
+
$ claude-multi-desktop peers
|
|
51
|
+
ACCOUNT STATUS SESSION
|
|
52
|
+
Personal idle trip planning
|
|
53
|
+
Work busy build fix
|
|
54
|
+
default idle paper review
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
3. **No dependencies, nothing patched.** It is one bash script you can read in five minutes. Each launcher is a small app that opens the Claude.app you already have with Electron's public `--user-data-dir` flag. It makes no copy of Claude.app, re-signs nothing and runs nothing in the background. When Claude updates, every account gets the update, and uninstalling means deleting the launcher.
|
|
58
|
+
|
|
59
|
+
## Quick start
|
|
60
|
+
|
|
61
|
+
You need macOS and [Claude Desktop](https://claude.ai/download) in `/Applications`.
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
brew install jackson-cmd/tap/claude-multi-desktop
|
|
65
|
+
claude-multi-desktop add Work # a launcher called "Claude Work" with its own sign-in
|
|
66
|
+
claude-multi-desktop open Work # opens a second Claude window; sign in with your other account
|
|
67
|
+
claude-multi-desktop add Main --default # a launcher for the account you already use
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
That's it. You now have **Claude Work** and **Claude Main** in `~/Applications`, so Spotlight, Launchpad and the Dock all find them. Drag them to the Dock and click whichever account you want; both can stay open side by side.
|
|
71
|
+
|
|
72
|
+
No Homebrew, or would you rather not use Terminal? [Install](#install) lists a Mac installer, a disk image with a double-click app and a Claude Code plugin.
|
|
73
|
+
|
|
74
|
+
## Install
|
|
75
|
+
|
|
76
|
+
Homebrew is the shortest way. The others are for people without Homebrew, or who would rather not use Terminal.
|
|
77
|
+
|
|
78
|
+
### Homebrew
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
brew install jackson-cmd/tap/claude-multi-desktop
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Mac installer (.pkg)
|
|
85
|
+
|
|
86
|
+
Download the `.pkg` file from the [latest release](https://github.com/jackson-cmd/claude-multi-desktop/releases/latest) and open it. It installs the `claude-multi-desktop` command to `/usr/local/bin` and the double-click app **Claude Multi Desktop** to `/Applications`.
|
|
87
|
+
|
|
88
|
+
The installer is not signed with an Apple Developer ID, so macOS blocks it the first time you open it: see [If macOS blocks the app or installer](#if-macos-blocks-the-app-or-installer).
|
|
89
|
+
|
|
90
|
+
To uninstall it:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
sudo rm /usr/local/bin/claude-multi-desktop
|
|
94
|
+
sudo rm -rf "/Applications/Claude Multi Desktop.app"
|
|
95
|
+
sudo pkgutil --forget io.github.jackson-cmd.claude-multi-desktop
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Disk image (.dmg)
|
|
99
|
+
|
|
100
|
+
Download the `.dmg` file from the same [release page](https://github.com/jackson-cmd/claude-multi-desktop/releases/latest), drag **Claude Multi Desktop** to Applications and double-click it. It asks for an account name, an icon style (a coloured letter, your Claude icon with a letter badge, or a picture) and a colour, then makes the launcher and opens it. It can also open, rename or remove launchers you already made. You never need Terminal.
|
|
101
|
+
|
|
102
|
+
The app is not signed with an Apple Developer ID either: see [If macOS blocks the app or installer](#if-macos-blocks-the-app-or-installer). The disk image carries the same steps as a text file next to the app.
|
|
103
|
+
|
|
104
|
+
### If macOS blocks the app or installer
|
|
105
|
+
|
|
106
|
+
If macOS says *"Apple could not verify 'Claude Multi Desktop' is free of malware"*: the app and the installer are not signed with an Apple Developer ID, so macOS blocks them the first time you open them. The code is open source, and you only need to allow it once.
|
|
107
|
+
|
|
108
|
+
**macOS 15 (Sequoia) and later**
|
|
109
|
+
|
|
110
|
+
1. Double-click the app (or the `.pkg`) once. When macOS blocks it, click **Done**.
|
|
111
|
+
2. Open **System Settings → Privacy & Security** and scroll down to the **Security** section. You will see *"'Claude Multi Desktop' was blocked to protect your Mac."* (for the installer, its file name). Click **Open Anyway**.
|
|
112
|
+
3. Enter your Mac login password (or use Touch ID). If macOS asks once more, click **Open Anyway** again. From then on it opens normally.
|
|
113
|
+
|
|
114
|
+
**macOS 14 (Sonoma) and earlier**
|
|
115
|
+
|
|
116
|
+
1. Right-click (or Control-click) the app (or the `.pkg`) and choose **Open**.
|
|
117
|
+
2. Click **Open** in the dialog. You only do this once.
|
|
118
|
+
|
|
119
|
+
Want no warning at all? Install with Homebrew instead: `brew install jackson-cmd/tap/claude-multi-desktop`.
|
|
120
|
+
|
|
121
|
+
### Claude Code plugin
|
|
122
|
+
|
|
123
|
+
```text
|
|
124
|
+
/plugin marketplace add jackson-cmd/claude-multi-desktop
|
|
125
|
+
/plugin install account-handoff@multi-desktop
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
The plugin adds one skill, `handoff` (also `/account-handoff:handoff`). It hands a task to a Claude Code session in another account using `ListAgents`, `SendMessage` and `claude-multi-desktop peers`, and relays the reply. It refuses to move work to another account because an account has hit a usage limit. The plugin does not install the `claude-multi-desktop` command itself; use one of the methods above for that.
|
|
129
|
+
|
|
130
|
+
### curl or git clone
|
|
131
|
+
|
|
132
|
+
<details>
|
|
133
|
+
<summary>Install with curl, without Homebrew</summary>
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
mkdir -p ~/.local/bin
|
|
137
|
+
curl -fsSL https://raw.githubusercontent.com/jackson-cmd/claude-multi-desktop/main/claude-multi-desktop -o ~/.local/bin/claude-multi-desktop
|
|
138
|
+
chmod +x ~/.local/bin/claude-multi-desktop
|
|
139
|
+
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc # then open a new terminal
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
</details>
|
|
143
|
+
|
|
144
|
+
Or clone the repository and run the script from the folder:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
git clone https://github.com/jackson-cmd/claude-multi-desktop.git
|
|
148
|
+
cd claude-multi-desktop
|
|
149
|
+
./claude-multi-desktop add Work
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## Step by step
|
|
153
|
+
|
|
154
|
+
1. **Keep using Claude as you do now.** Your current account stays as it is; nothing about it changes.
|
|
155
|
+
2. **Add an account:** `claude-multi-desktop add Work`. This creates `~/Applications/Claude Work.app` with its own coloured icon, and an empty folder for that account's sign-in and chats.
|
|
156
|
+
3. **Open it and sign in** with the other account: `claude-multi-desktop open Work`, or double-click the launcher.
|
|
157
|
+
4. **Add a launcher for your first account:** `claude-multi-desktop add Main --default`. While another account is open, clicking the normal Claude icon only brings that window forward. **Claude Main** always opens your first account.
|
|
158
|
+
5. **Add as many as you need:** `add Personal`, `add "Client A"`, and so on. Pick a colour with `--color 2E9D6A` or another look with `--icon` (see [Icons and names](#icons-and-names)).
|
|
159
|
+
|
|
160
|
+
> **Signing in.** Sign-in happens once per account. If the browser sends the sign-in back to the wrong window, quit the other Claude windows, sign in, then reopen them from their launchers.
|
|
161
|
+
|
|
162
|
+
## Icons and names
|
|
163
|
+
|
|
164
|
+
By default a launcher gets a coloured square with the first letter of its name. You can pick another look when you add it, or change it later:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
claude-multi-desktop add Work --icon claude # your Claude icon with a coloured letter badge
|
|
168
|
+
claude-multi-desktop add Home --icon ~/Pictures/home.png # any PNG, JPEG, HEIC or ICNS picture
|
|
169
|
+
claude-multi-desktop icon Work --icon claude --color 2E9D6A # change an existing launcher's icon
|
|
170
|
+
claude-multi-desktop rename Work Office # rename a launcher; sign-in and chats stay
|
|
171
|
+
claude-multi-desktop list --names # print the launcher names, one per line
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
- `--icon claude` draws your own Claude icon with a coloured letter badge, on your Mac, from the Claude.app you have installed. Nothing from Anthropic is shipped with this tool.
|
|
175
|
+
- `--icon /path/to/picture` takes any PNG, JPEG, HEIC or ICNS file.
|
|
176
|
+
- `rename` changes the launcher's name and keeps the account's sign-in and chats. The account's folder (for example `Claude-Work`) is not renamed.
|
|
177
|
+
- `list --names` prints bare names, which is handy in scripts.
|
|
178
|
+
|
|
179
|
+
> **One limit.** The custom icon belongs to the launcher, so you see it in Finder, Spotlight and Launchpad. Once a window is open, the Dock shows the normal Claude icon and name for it, because Claude.app decides that and this tool never modifies Claude.app.
|
|
180
|
+
|
|
181
|
+
## Sessions talk across accounts
|
|
182
|
+
|
|
183
|
+
This works in the **Code** tab of Claude Desktop (tested with Claude Code 2.1). Open a session in any account and ask in plain words:
|
|
184
|
+
|
|
185
|
+
- *"List the other Claude sessions running on this Mac."* Claude calls `ListAgents` and shows sessions from every account.
|
|
186
|
+
- *"Send the session called build fix in my Work account this summary and ask it to run the tests."* Claude calls `SendMessage` and the Work session picks it up.
|
|
187
|
+
- *"When it replies, tell me what it found."* Replies come back the same way.
|
|
188
|
+
|
|
189
|
+
For example, you can draft a plan in your personal account and hand the implementation to a session in your work account, or have one account review what another wrote, with the shared skills and `CLAUDE.md` on both sides. The [Claude Code plugin](#claude-code-plugin) packages this hand-over as a skill.
|
|
190
|
+
|
|
191
|
+
From the terminal, `claude-multi-desktop peers` lists the running sessions and the account each one belongs to. It reads Claude Code's local session list, so a future Claude release may change what it can show.
|
|
192
|
+
|
|
193
|
+
## What is shared and what is not
|
|
194
|
+
|
|
195
|
+
| | Separate in each account | Shared by every account |
|
|
196
|
+
|---|:---:|:---:|
|
|
197
|
+
| Sign-in, plan, chats and projects | ✓ | |
|
|
198
|
+
| Desktop settings, connectors, extensions, `claude_desktop_config.json` | ✓ | |
|
|
199
|
+
| Claude Code skills, commands, agents, hooks, `settings.json` | | ✓ |
|
|
200
|
+
| `CLAUDE.md` and Claude Code memory | | ✓ |
|
|
201
|
+
| Claude Code MCP servers | | ✓ |
|
|
202
|
+
| List of running Claude Code sessions (what makes messaging work) | | ✓ |
|
|
203
|
+
|
|
204
|
+
Claude Desktop keeps each account in its own folder under `~/Library/Application Support/` (`Claude` for your first account, `Claude-Work`, `Claude-Personal`, …). Claude Code keeps its setup in `~/.claude` (and `~/.claude.json`), and the launchers leave both alone, so every account uses the same ones.
|
|
205
|
+
|
|
206
|
+
## Commands
|
|
207
|
+
|
|
208
|
+
| Command | What it does |
|
|
209
|
+
|---|---|
|
|
210
|
+
| `add NAME` | Make the launcher `Claude NAME` with its own sign-in (folder `Claude-NAME`) |
|
|
211
|
+
| `add NAME --default` | Make a launcher for the account you already use |
|
|
212
|
+
| `add NAME --color HEX` | Choose the icon colour, e.g. `--color 7A5AE0` |
|
|
213
|
+
| `add NAME --icon claude` | Use your own Claude icon with a coloured letter badge, drawn on your Mac |
|
|
214
|
+
| `add NAME --icon /path/to/picture` | Use any PNG, JPEG, HEIC or ICNS picture as the icon |
|
|
215
|
+
| `icon NAME --icon … --color HEX` | Change the icon or colour of an existing launcher |
|
|
216
|
+
| `rename NAME NEW` | Rename a launcher and keep its sign-in and chats (the account folder keeps its name) |
|
|
217
|
+
| `list` | Show your launchers, their folders and which ones are open |
|
|
218
|
+
| `list --names` | Print the launcher names only, one per line |
|
|
219
|
+
| `open NAME` | Open that account's window |
|
|
220
|
+
| `peers` | Show the Claude Code sessions running in every account |
|
|
221
|
+
| `remove NAME` | Delete the launcher and keep the account's sign-in and chats |
|
|
222
|
+
| `remove NAME --delete-data` | Also delete that account's folder (asks you to type the name; never touches your first account) |
|
|
223
|
+
|
|
224
|
+
Launchers go to `~/Applications`; set `CMD_APPS_DIR` to put them elsewhere. If Claude.app is not in `/Applications` or `~/Applications`, set `CLAUDE_APP=/path/to/Claude.app`.
|
|
225
|
+
|
|
226
|
+
## How it works
|
|
227
|
+
|
|
228
|
+
Claude Desktop is an Electron app. Electron lets one app run several times if each copy keeps its data in a different folder, which the `--user-data-dir` flag sets. A launcher made by `add Work` contains this one line:
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
exec open -n -a "/Applications/Claude.app" --args --user-data-dir="$HOME/Library/Application Support/Claude-Work"
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
`open -n` starts a new copy even when Claude is already running, and the flag gives that copy its own sign-in and chats. Claude Code sessions started from any copy still use `~/.claude`, which is why the setup and the session list are shared. The default icon is a coloured square with the first letter of the name, drawn on your Mac when you run `add`. Nothing from Anthropic is shipped; `--icon claude` uses the icon of the Claude you have installed, locally.
|
|
235
|
+
|
|
236
|
+
## Good to know
|
|
237
|
+
|
|
238
|
+
- **Dock icons.** Once a window is open, the Dock shows the normal Claude icon and name for it, whatever icon the launcher has, because Claude.app decides that and this tool never modifies Claude.app. Start accounts from the launchers, which have their own icons.
|
|
239
|
+
- **After an update.** If Claude restarts itself after an update and a window comes back on the wrong account, quit it and open it again from its launcher.
|
|
240
|
+
- **Shared means shared.** Memory or `CLAUDE.md` text written in one account is visible to the others. If work data must stay inside the work account, use a tool that isolates Claude Code too (see below).
|
|
241
|
+
- **macOS only.** Windows and Linux users, see the tools below.
|
|
242
|
+
|
|
243
|
+
## Other tools
|
|
244
|
+
|
|
245
|
+
Several free tools run more than one Claude Desktop account. They make different choices, and which one fits depends on what you want shared:
|
|
246
|
+
|
|
247
|
+
| Tool | Approach | Pick it when |
|
|
248
|
+
|---|---|---|
|
|
249
|
+
| **claude-multi-desktop** (this) | One bash script; separate sign-ins, one shared `~/.claude` | you want one Claude Code setup in every account and sessions that can message across accounts |
|
|
250
|
+
| [claude-multiprofile](https://github.com/jmdarre-v/claude-multiprofile) | npm tool; separate Desktop and Claude Code profiles, a `doctor` command | you want accounts fully isolated, Claude Code included |
|
|
251
|
+
| [claude-fix](https://github.com/sarhej/claude-fix) | Shell script with isolated launchers and an optional sign-in router | you want isolated launchers installed through Homebrew |
|
|
252
|
+
| [Duplex](https://github.com/bnimit/duplex) | SwiftUI app for any Electron app | you want a GUI and other Electron apps too |
|
|
253
|
+
| [claude-desktop-clone](https://github.com/vodongha/claude-desktop-clone) | PowerShell | you are on Windows |
|
|
254
|
+
|
|
255
|
+
## FAQ
|
|
256
|
+
|
|
257
|
+
### How do I use two Claude accounts at the same time on a Mac?
|
|
258
|
+
|
|
259
|
+
Run `claude-multi-desktop add Work`, open **Claude Work** and sign in with the second account. Your first account keeps working in its own window, and both stay open side by side.
|
|
260
|
+
|
|
261
|
+
### Why does opening Claude a second time just bring the same window back?
|
|
262
|
+
|
|
263
|
+
Claude Desktop allows one running copy per data folder. A launcher from this tool starts Claude with a different data folder, so macOS opens a second, independent window.
|
|
264
|
+
|
|
265
|
+
### Do my Claude Code skills, `CLAUDE.md` and MCP servers work in every account?
|
|
266
|
+
|
|
267
|
+
Yes. Every account reads the same `~/.claude`, so they are all available everywhere, and a change made in one account shows up in the others the next time a session starts.
|
|
268
|
+
|
|
269
|
+
### Can Claude Code sessions in different Claude accounts talk to each other?
|
|
270
|
+
|
|
271
|
+
Yes. Ask a session to list the other sessions on this Mac and to send one of them a message; it uses Claude Code's `ListAgents` and `SendMessage` tools. See [Sessions talk across accounts](#sessions-talk-across-accounts).
|
|
272
|
+
|
|
273
|
+
### Do I need Terminal?
|
|
274
|
+
|
|
275
|
+
No. The [disk image](#disk-image-dmg) has a double-click app that asks for a name, an icon style and a colour, makes the launcher and opens it. The command line does the same and also lets you script it.
|
|
276
|
+
|
|
277
|
+
### Why does the Dock show the normal Claude icon for an open window?
|
|
278
|
+
|
|
279
|
+
The custom icon belongs to the launcher. Once a window is open, the Dock icon and name come from Claude.app, and this tool never modifies Claude.app, so they stay as Claude ships them.
|
|
280
|
+
|
|
281
|
+
### Does this modify, copy or re-sign Claude.app?
|
|
282
|
+
|
|
283
|
+
No. Launchers only open the Claude.app you already have, with a public Electron flag. Claude's own updates keep working for every account.
|
|
284
|
+
|
|
285
|
+
### How do I remove an account or uninstall?
|
|
286
|
+
|
|
287
|
+
Run `claude-multi-desktop remove Work` to delete the launcher, or `remove Work --delete-data` to delete that account's folder too. To uninstall the tool, remove your launchers and then remove the command the way you installed it (for example `brew uninstall claude-multi-desktop`; the steps for the Mac installer are under [Mac installer](#mac-installer-pkg)). Your first account is never touched.
|
|
288
|
+
|
|
289
|
+
### Is this an official Anthropic tool?
|
|
290
|
+
|
|
291
|
+
No. It is an independent open-source project and is not affiliated with or endorsed by Anthropic. "Claude" is a trademark of Anthropic. Each account you sign in to remains subject to Anthropic's terms; see the [disclaimer](#disclaimer).
|
|
292
|
+
|
|
293
|
+
## Disclaimer
|
|
294
|
+
|
|
295
|
+
claude-multi-desktop is an independent open-source project. It is not affiliated with, endorsed by or supported by Anthropic. "Claude" and "Claude Desktop" are trademarks of Anthropic.
|
|
296
|
+
|
|
297
|
+
**Acceptable use.** Use this tool only for legitimate purposes and only with Claude accounts you are entitled to use, for example to keep a work account and a personal account open side by side. Do not use it:
|
|
298
|
+
|
|
299
|
+
- to get around, pool or stretch usage limits, rate limits or plan restrictions, for example by switching to another account to keep working after one has reached its limit;
|
|
300
|
+
- to share accounts or sign-ins with other people, or to use accounts that are not yours;
|
|
301
|
+
- for anything that Anthropic's Consumer Terms, Commercial Terms or Usage Policy, or your employer's rules, do not allow.
|
|
302
|
+
|
|
303
|
+
You are responsible for how you use your accounts. Anthropic may restrict or close accounts that break its terms, and the authors of this project accept no responsibility for that or for any other consequence of using it. The software is provided "as is", without warranty of any kind (see [LICENSE](https://github.com/jackson-cmd/claude-multi-desktop/blob/main/LICENSE)).
|
|
304
|
+
|
|
305
|
+
## Tests
|
|
306
|
+
|
|
307
|
+
```bash
|
|
308
|
+
bash tests/test.sh
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
The tests run in a temporary home folder with a stand-in Claude.app. They create, list and remove launchers, check the icon and the plist, and map fake sessions to accounts, without ever opening Claude. CI runs them on macOS together with ShellCheck.
|
|
312
|
+
|
|
313
|
+
## Changelog
|
|
314
|
+
|
|
315
|
+
See [CHANGELOG.md](https://github.com/jackson-cmd/claude-multi-desktop/blob/main/CHANGELOG.md).
|
|
316
|
+
|
|
317
|
+
## License
|
|
318
|
+
|
|
319
|
+
[MIT](https://github.com/jackson-cmd/claude-multi-desktop/blob/main/LICENSE)
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
claude_multi_desktop/__init__.py,sha256=vpyE8J4Nyv0Kr9aNwBaSGyqO0NYTctf9KtcjZlX7YHo,615
|
|
2
|
+
claude_multi_desktop/__main__.py,sha256=MX8awphgoxuWTr10mbUuqZJ0kADSrdbjKpuUsFhU3kc,46
|
|
3
|
+
claude_multi_desktop/claude-multi-desktop,sha256=E7VxC7HouSagMuwL6DKtY82bxsaGp2HVPsC6ERR5W-k,19747
|
|
4
|
+
claude_multi_desktop-0.1.2.dist-info/METADATA,sha256=_bijg_PEUq1M06Ox0Fw1Bksn2Xatic6vx7gfClMC290,21481
|
|
5
|
+
claude_multi_desktop-0.1.2.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
|
|
6
|
+
claude_multi_desktop-0.1.2.dist-info/entry_points.txt,sha256=HMhTkLk-yqGzagHGeao8I5rybh15D-GXT1EOKBwjZec,67
|
|
7
|
+
claude_multi_desktop-0.1.2.dist-info/licenses/LICENSE,sha256=v4hlRpbJ6x1Nr28BKIwsIIPL71e5hQIdjih-Ey1SZ54,1090
|
|
8
|
+
claude_multi_desktop-0.1.2.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 claude-multi-desktop contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|