Documentation
¶
Overview ¶
Package desktopdir finds Claude Desktop's folders: the one place the agent, the library and the session readers ask.
On macOS they are ~/Library/Application Support/Claude and Claude-3p, on Linux $XDG_CONFIG_HOME/Claude and Claude-3p. On Windows Desktop's own data (its claude_desktop_config.json, Cowork's sessions and skills) is %APPDATA%\Claude, its 3p mode's is %LOCALAPPDATA%\Claude-3p, and magpie writes deploymentMode into %LOCALAPPDATA%\Claude as CC Switch does.
Desktop installed from the setup.exe that installs an MSIX package (as on Windows 10 LTSC, Kilig on Discord) runs packaged, and Windows keeps what it writes under %APPDATA% and %LOCALAPPDATA% in the package's own folders instead:
%LOCALAPPDATA%\Packages\Claude_<publisher>\LocalCache\Roaming\Claude %LOCALAPPDATA%\Packages\Claude_<publisher>\LocalCache\Local\Claude(-3p)
(AnthropicPBC.Claude_<publisher> 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, read and written in place of the usual ones, unless Desktop runs in the usual ones (it has run there, and not later in the package's).
From 2.31226 on the package no longer keeps %LOCALAPPDATA% to itself: Desktop's 3p mode reads the real %LOCALAPPDATA%\Claude-3p (its Ou() is path.join(LOCALAPPDATA, "Claude-3p"), the same as before, now outside the package's LocalCache), and a gateway written only into the package's Claude-3p is never seen (bg5eau on X). Which build is installed can't be told from its folders, so Sets gives both: what Desktop must find goes into each.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var OS = runtime.GOOS
OS is the system whose folders Here, and the agent's Desktop, look for: runtime.GOOS, set by a test to try another system's.
Functions ¶
func Everywhere ¶ added in v0.1.1156
func Everywhere() []string
Everywhere are the folders of every set on this computer (Sets), each once: where the readers look for Desktop's sessions and skills.
func Installed ¶ added in v0.1.1178
Installed says whether Desktop's program is installed on goos, whatever it has written: on Windows, Squirrel's setup puts it in %LOCALAPPDATA%\AnthropicClaude\claude.exe, and the MSIX's has its package folder (Sets' Package). Installed and not yet opened, Desktop has none of its folders (#1482); it still reads at its first start what magpie writes into them. False elsewhere, where the folders tell.
Types ¶
type Dirs ¶
type Dirs struct {
// Data is Desktop's userData when signed in with Anthropic: its
// claude_desktop_config.json with its MCP servers, Cowork's sessions
// and skills (%APPDATA%\Claude on Windows).
Data string
// Mode is the Claude folder magpie writes deploymentMode into: Data,
// except on Windows (%LOCALAPPDATA%\Claude, as CC Switch writes it).
Mode string
// ThreeP is Claude-3p, Desktop's whole userData in its 3p mode.
ThreeP string
// Package is the MSIX package's LocalCache folder Data, Mode and ThreeP
// are in, "" for Desktop not installed as a package.
Package string
}
Dirs are Claude Desktop's folders on one computer.
func Find ¶
Find are Desktop's folders on goos for home, with getenv reading the environment (a folder in it that isn't absolute is passed over).