Skip to content

fix(claude): discover Claude Desktop/Cowork sessions in Windows MSIX installs#800

Open
ozymandiashh wants to merge 1 commit into
mainfrom
fix/611-desktop-msix-sessions
Open

fix(claude): discover Claude Desktop/Cowork sessions in Windows MSIX installs#800
ozymandiashh wants to merge 1 commit into
mainfrom
fix/611-desktop-msix-sessions

Conversation

@ozymandiashh

Copy link
Copy Markdown
Collaborator

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:

%LOCALAPPDATA%\Packages\<Claude package>\LocalCache\Roaming\Claude\local-agent-mode-sessions

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(): string becomes getDesktopSessionsDirs(): string[] returning an ordered, deduped candidate list:

  1. CODEBURN_DESKTOP_SESSIONS_DIR override (exactly that path, resolved, no probing)
  2. macOS: ~/Library/Application Support/Claude/local-agent-mode-sessions
  3. Windows: classic %APPDATA%\Claude\local-agent-mode-sessions first, then MSIX candidates discovered by enumerating %LOCALAPPDATA%\Packages for directories named Claude_* 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.
  4. Linux: ~/.config/Claude/local-agent-mode-sessions

All call sites scan every candidate: isCoworkSession classifies against all bases, probeRoots emits one desktop root per candidate, discoverSessions walks each base with its own claude-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

  • 8 new resolver cases in 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), missing LOCALAPPDATA/Packages robustness, override exact-return incl. unnormalized paths, non-win32 never probes Packages, missing sessions subpath excluded, deterministic ordering, resolved-duplicate dedupe, APPDATA fallback.
  • npx tsc --noEmit clean; parser/aggregator consumer suites green (45/45); full CLI test tree green.

Notes

  • Known theoretical limitation: two MSIX packages whose sessions dirs are reparse points to the same underlying directory would not be deduped (resolve() does not follow junctions). Real Store packages use real directories, so this is not reachable in practice.
  • Windows-native verification on an MSIX install would be appreciated - @seb937 if you can run this branch, npx codeburn should pick up your Cowork sessions with no junction.

…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Support Claude Desktop / Cowork sessions on Windows

1 participant