fix(claude): discover Claude Desktop/Cowork sessions in Windows MSIX installs#800
Open
ozymandiashh wants to merge 1 commit into
Open
fix(claude): discover Claude Desktop/Cowork sessions in Windows MSIX installs#800ozymandiashh wants to merge 1 commit into
ozymandiashh wants to merge 1 commit into
Conversation
…installs The desktop sessions resolver returned a single per-platform path, so Microsoft Store (MSIX) installs of Claude Desktop were invisible: their data lives under %LOCALAPPDATA%\Packages\<Claude package>\LocalCache\Roaming\Claude\local-agent-mode-sessions and a filesystem junction workaround breaks Cowork's own file access (reported and verified in #611). getDesktopSessionsDir() becomes getDesktopSessionsDirs(): an ordered, deduped candidate list (override, then classic APPDATA, then MSIX packages matching Claude_* or *.Claude_*, existence-checked, lexicographically sorted; .config on Linux). Results are memoized per env-input tuple so the parser's per-file classification never rescans Packages. All call sites scan every candidate; macOS, Linux and classic Windows behavior unchanged. Fixes #611
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #611
Problem
The Claude Desktop sessions resolver returned a single per-platform path. On Microsoft Store (MSIX) installs of Claude Desktop the session data is virtualized under:
so codeburn showed zero Cowork usage. As @seb937 verified in #611 (comment), a directory junction workaround makes codeburn work but breaks Cowork's own file access inside active sessions, so the fix has to live in the resolver. This matters more now that #798 directs Windows installs to the Microsoft Store.
Change
getDesktopSessionsDir(): stringbecomesgetDesktopSessionsDirs(): string[]returning an ordered, deduped candidate list:CODEBURN_DESKTOP_SESSIONS_DIRoverride (exactly that path, resolved, no probing)~/Library/Application Support/Claude/local-agent-mode-sessions%APPDATA%\Claude\local-agent-mode-sessionsfirst, then MSIX candidates discovered by enumerating%LOCALAPPDATA%\Packagesfor directories namedClaude_*or*.Claude_*(publisher-prefixed package family names), keeping only those whose sessions subpath exists, sorted lexicographically. Probing never throws; enumeration errors mean no MSIX candidates.~/.config/Claude/local-agent-mode-sessionsAll call sites scan every candidate:
isCoworkSessionclassifies against all bases,probeRootsemits onedesktoproot per candidate,discoverSessionswalks each base with its ownclaude-desktop:<hash>source id (project dirs deduped across bases), and the config selector treats desktop as present when any candidate exists.Results are memoized per env-input tuple (platform, override, APPDATA, LOCALAPPDATA) so the parser's per-file classification never rescans the Packages directory.
Behavior on macOS, Linux, and classic Windows installs is unchanged. The package hash is never hardcoded.
Testing
tests/providers/claude-config-dirs.test.ts(30 total passing): MSIX discovery alongside classic, package-name filtering incl. near-miss rejections (ClaudeXtra_foo,NotClaude_x), missingLOCALAPPDATA/Packagesrobustness, override exact-return incl. unnormalized paths, non-win32 never probes Packages, missing sessions subpath excluded, deterministic ordering, resolved-duplicate dedupe, APPDATA fallback.npx tsc --noEmitclean; parser/aggregator consumer suites green (45/45); full CLI test tree green.Notes
resolve()does not follow junctions). Real Store packages use real directories, so this is not reachable in practice.npx codeburnshould pick up your Cowork sessions with no junction.