diff --git a/docs/reference.md b/docs/reference.md index 3668a7c3..beae0220 100644 --- a/docs/reference.md +++ b/docs/reference.md @@ -85,7 +85,7 @@ line; agents connected to magpie lose it when it quits. | Agent | File | Fields | | ------------ | --------------------------------- | --------------- | | Claude Code | `~/.claude/settings.json` | provider, model, opus/sonnet/haiku/fable, sign-in (through magpie) | -| Claude Desktop | `Claude/` + `Claude-3p/configLibrary/` in `~/Library/Application Support` (`%LOCALAPPDATA%` on Windows, `~/.config` on Linux). A Desktop installed as an MSIX package on Windows keeps them in its package instead (`%LOCALAPPDATA%\Packages\Claude_\LocalCache\Local`, its own data in `LocalCache\Roaming\Claude`). Desktop 2.31226 and later, packaged, reads the real `%LOCALAPPDATA%\Claude-3p` instead, so for a packaged Desktop magpie writes both ([`desktopdir`](../internal/desktopdir/desktopdir.go)) | provider (its third-party gateway mode: Code and Cowork on magpie, no Anthropic sign-in; restart Desktop) | +| Claude Desktop | `Claude/` + `Claude-3p/configLibrary/` in `~/Library/Application Support` (`%LOCALAPPDATA%` on Windows, `~/.config` on Linux). A Desktop installed as an MSIX package on Windows keeps them in its package instead (`%LOCALAPPDATA%\Packages\Claude_\LocalCache\Local`, or `AnthropicPBC.Claude_` for the Store's package, its own data in `LocalCache\Roaming\Claude`). Desktop 2.31226 and later, packaged, reads the real `%LOCALAPPDATA%\Claude-3p` instead, so for a packaged Desktop magpie writes both ([`desktopdir`](../internal/desktopdir/desktopdir.go)) | provider (its third-party gateway mode: Code and Cowork on magpie, no Anthropic sign-in; restart Desktop) | | Codex | `~/.codex/config.toml` | provider, model, effort | | Gemini CLI | `~/.gemini/settings.json`, `~/.gemini/.env` | auth, model | | OpenCode | `~/.config/opencode/opencode.json(c)` (`$OPENCODE_CONFIG_DIR`) | model, small | diff --git a/internal/desktopdir/desktopdir.go b/internal/desktopdir/desktopdir.go index 2d509ac6..264ac388 100644 --- a/internal/desktopdir/desktopdir.go +++ b/internal/desktopdir/desktopdir.go @@ -15,6 +15,8 @@ // %LOCALAPPDATA%\Packages\Claude_\LocalCache\Roaming\Claude // %LOCALAPPDATA%\Packages\Claude_\LocalCache\Local\Claude(-3p) // +// (AnthropicPBC.Claude_ for the Store's package.) +// // The packaged app reads its own copy before the real folder's, so a file // another program writes into %APPDATA%\Claude is not seen once the app has // one there. Such an install's folders are the package's: those are found, @@ -156,11 +158,17 @@ func lastRun(dirs ...string) time.Time { } // packageDir is the LocalCache folder of Desktop's MSIX package under -// local (%LOCALAPPDATA%): Packages\Claude_, the one Desktop -// has run in first, else the first there is. The publisher id is not -// assumed: it is the one of whoever signed the package. +// local (%LOCALAPPDATA%): Packages\Claude_, or the Store's +// Packages\AnthropicPBC.Claude_ (Desktop 2.31226 knows both +// families, Claude_pzs8sxrjxfjjc and AnthropicPBC.Claude_fnn82j28hfe8t), +// the one Desktop has run in first, else the first there is. The publisher +// id is not assumed: it is the one of whoever signed the package. func packageDir(local string) string { - found, _ := filepath.Glob(filepath.Join(local, "Packages", "Claude_*")) + var found []string + for _, family := range []string{"Claude_*", "AnthropicPBC.Claude_*"} { + m, _ := filepath.Glob(filepath.Join(local, "Packages", family)) + found = append(found, m...) + } var dirs []string for _, p := range found { if fi, err := os.Stat(p); err == nil && fi.IsDir() { diff --git a/internal/desktopdir/desktopdir_test.go b/internal/desktopdir/desktopdir_test.go index 0ef3df57..8e54e3cf 100644 --- a/internal/desktopdir/desktopdir_test.go +++ b/internal/desktopdir/desktopdir_test.go @@ -29,11 +29,14 @@ func ran(tb testing.TB, dir string, t time.Time) { // Discord, Windows 10 LTSC 21H2) keeps its data in the package's // LocalCache, nothing in %APPDATA%\Claude: those are its folders, whatever // the package's publisher id. +// +// The Store's package is the AnthropicPBC.Claude family +// (AnthropicPBC.Claude_fnn82j28hfe8t in Desktop 2.31226's own list). func TestFindMSIX(t *testing.T) { - for _, pub := range []string{"pzs8sxrjxfjjc", "q1w2e3r4t5y6z"} { + for _, pub := range []string{"Claude_pzs8sxrjxfjjc", "Claude_q1w2e3r4t5y6z", "AnthropicPBC.Claude_fnn82j28hfe8t"} { home := t.TempDir() local, roaming := filepath.Join(home, "AppData", "Local"), filepath.Join(home, "AppData", "Roaming") - pkg := filepath.Join(local, "Packages", "Claude_"+pub, "LocalCache") + pkg := filepath.Join(local, "Packages", pub, "LocalCache") ran(t, filepath.Join(pkg, "Roaming", "Claude"), time.Now()) os.MkdirAll(filepath.Join(pkg, "Local", "Claude", "logs"), 0o755) os.MkdirAll(filepath.Join(local, "Packages", "Microsoft.WindowsStore_8wekyb3d8bbwe"), 0o755)