Documentation
¶
Overview ¶
Package desktopiso makes the app that starts Claude Desktop in a folder of its own (#5671): ~/Applications/Claude Magpie.app, whose executable is a script that runs the user's Claude.app with --user-data-dir set to desktopdir.Isolated. Desktop's 3p folder is its userData with "-3p" added unless it ends so already (GY in Desktop 2.7032's and 4.4212's index.pre.js), so that folder holds magpie's whole 3p mode, and the user's own Desktop, signed in with Anthropic in ~/Library/Application Support/Claude, runs beside it untouched. The packaged Desktop drops CLAUDE_USER_DATA_DIR from its environment, so the flag is the one way in; it is no switch Desktop refuses to start with (its list: remote-debugging-port, host-rules and the like).
Tried on a Mac mini with Desktop 4.4212: started from such a bundle it read the folder's configLibrary and asked the gateway for /v1/models, while a second Desktop ran in another folder; opening the bundle again while it ran started no second copy. macOS lists the running Desktop as Claude.app's own (lsappinfo: its bundle path), so the Dock shows it with Claude's icon; the badge is on the app that starts it.
Index ¶
- Constants
- Variables
- func Add(home, claudeApp, dir, claudeDir string) (string, error)
- func Badged(base image.Image, size int) *image.NRGBA
- func Here(home string) string
- func Icon(claudeApp string) ([]byte, error)
- func Mine(p string) bool
- func Path(home string) string
- func Remove(home string) (string, error)
- func Script(claudeApp, exe, dir, claudeDir string) string
Constants ¶
const BundleID = "ai.usemagpie.claude-desktop"
BundleID is its CFBundleIdentifier, which says a bundle by that name is magpie's: one without it is the user's and is never written over.
const Name = "Claude Magpie"
Name is the app's name, and its bundle's without ".app".
Variables ¶
var ErrTheirs = errors.New(Name + ".app is there already and isn't magpie's")
ErrTheirs: a bundle by the app's name is there and isn't magpie's.
Functions ¶
func Add ¶
Add makes the app for home, starting the Desktop at claudeApp on dir, its Code tab's Claude Code on claudeDir when one is given (Script), and gives its path. One of magpie's there already is made again; one that isn't magpie's stays, and Add fails (ErrTheirs).
func Badged ¶
Badged is base at size pixels with magpie's badge over its bottom right: a white disc with a hairline rim and magpie's bird in it, a little over a third of the icon across. macOS's icon grid keeps the picture inside ~80% of the canvas, so the disc sits on the artwork's corner, not the canvas's.
func Icon ¶
Icon is the app's icon, as an .icns: Claude.app's own (its CFBundleIconFile, electron.icns in 2.7032 and 4.4212), its largest picture with magpie's badge at the bottom right, at 1024, 512, 256 and 128 pixels.
func Remove ¶
Remove takes the app away when magpie made it, and gives the path it was at, "" when there was none of magpie's.
func Script ¶
Script is the app's executable: Desktop's own executable exe in claudeApp (else in /Applications or ~/Applications, where it may have moved since) run on dir. A Desktop already running on dir is not started a second time on it: two copies on one userData share no lock.
With claudeDir, the Claude Code Desktop's Code tab runs keeps its files there (#6459): Desktop takes CLAUDE_CONFIG_DIR from its environment when its own Settings set none (Desktop 4.23118 and 2.7032), and starts its sessions with it. "" leaves it ~/.claude, or whatever the user's own environment says.
Types ¶
This section is empty.