Help us shape the future of Go! Take the 2026 Go Developer Survey

desktopdir

package
v0.1.1332 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 8 Imported by: 0

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

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

func Installed(goos, home string, getenv func(string) string) bool

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.

func LastRun added in v0.1.1162

func LastRun(dirs ...string) time.Time

LastRun is when Desktop last ran in any of dirs (lastRun).

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

func Find(goos, home string, getenv func(string) string) Dirs

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).

func Here

func Here() Dirs

Here are Desktop's folders on this computer.

func Sets added in v0.1.1156

func Sets(goos, home string, getenv func(string) string) []Dirs

Sets are every set of Desktop's folders on goos for home: Find's first, then, for an MSIX install, the other of the package's and the usual ones, which one build or another of the packaged app reads.

func (Dirs) All

func (d Dirs) All() []string

All are Data, Mode and ThreeP, each once.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL