Skip to content

fix(claude): find Desktop sessions in the Windows Claude-Data and Claude-3p folders - #1936

Draft
Enclavet wants to merge 2 commits into
getagentseal:mainfrom
Enclavet:fix/windows-claude-data-path
Draft

Enclavet wants to merge 2 commits into
getagentseal:mainfrom
Enclavet:fix/windows-claude-data-path

Conversation

@Enclavet

@Enclavet Enclavet commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Claude Desktop 3.1623.0 on Windows moves its data from the MSIX LocalCache to a folder under %LOCALAPPDATA%\Claude-Data\ on first launch and removes the old path (anthropics/claude-code#103860). getDesktopSessionsDirs() only checked %APPDATA%\Claude and %LOCALAPPDATA%\Packages\Claude_*\LocalCache\Roaming\Claude, so Desktop (Cowork) sessions on an updated Windows install are no longer found.
  • The Claude-3p root was checked on macOS only. On Windows, 3P mode keeps its data in %LOCALAPPDATA%\Claude-3p\ since 1.5186.0, and in %APPDATA%\Claude-3p\ before that (Claude Desktop on 3P: where data lives).

Paths added (win32 only)

After the existing classic and MSIX roots, in this order:

  1. %LOCALAPPDATA%\Claude-Data\<folder>\local-agent-mode-sessions, where <folder> is either claude_<hash> (the shape in the issue report) or the MSIX package family <publisher>.claude_<hash>, matched case-insensitively as "starts with claude_ or contains .claude_", like the existing Packages filter. Scanned with readdirSync(..., { withFileTypes: true }), sorted by name. A missing or unreadable Claude-Data folder is ignored.
  2. %LOCALAPPDATA%\Claude-3p\local-agent-mode-sessions
  3. %APPDATA%\Claude-3p\local-agent-mode-sessions

Each new root is used only when its local-agent-mode-sessions directory exists, as for MSIX packages. Unset APPDATA / LOCALAPPDATA fall back to ~/AppData/Roaming / ~/AppData/Local, as before. The legacy paths are kept for installs that have not updated yet. The cache key is unchanged: every new path derives from inputs it already holds (platform, override, APPDATA, LOCALAPPDATA, home). Results still go through dedupeResolved, so order is stable and duplicates are dropped. CODEBURN_DESKTOP_SESSIONS_DIR still overrides everything.

docs/providers/claude.md lists the new locations and the resolution order.

Not in this PR

  • DAILY_CACHE_VERSION is not bumped. Days sealed while these sessions were missed keep their lower figures. Precedent (v50, v51) bumped it for new discovery roots; happy to add that here if you want it.
  • The Windows tray's usage_guard.rs only watches %APPDATA%\Claude\local-agent-mode-sessions (it never watched the MSIX roots either), so it won't wake on writes under Claude-Data.
  • The 3P docs also mention MSIX-redirected Claude-3p folders under Packages\Claude_*\LocalCache\{Local,Roaming}\Claude-3p on Windows 10. Not added.

Testing / Verification

  • I have tested this locally against real data (not just unit tests). Checked on a real Windows install of the MSIX build: there the folder used the anthropicpbc.claude_<hash> shape, which the first version of this PR missed and the current one matches. Box stays unticked until a rerun on that machine confirms it.
  • npm test passes: 5724 passed, 7 skipped, 1 failed. The failure is tests/perf-harness-phase0.test.ts ("refusing to write fixtures under the real home"), which fails the same way on main on my machine, so it comes from the environment and not this change.
  • npm run test:locks: 37 passed.
  • npx tsc --noEmit passes.
  • npm run build:cli succeeds (did not run the dashboard build; no dashboard changes).
  • Not a UI change

New tests in tests/providers/claude-config-dirs.test.ts, in the existing "Desktop sessions dir" block and using its temp-dir and withPlatform style:

  • one Claude-Data hash root, ordered after the classic and MSIX roots
  • two hash roots sorted by name; a non-claude_ folder and a hash folder without local-agent-mode-sessions are skipped
  • a package-family root (anthropicpbc.claude_<hash>), with an unrelated someotherapp_x folder skipped
  • bare and package-family roots together, sorted by name, with someotherapp_x and notclaude_x skipped
  • missing Claude-Data and Claude-3p return only the classic root, without throwing
  • Claude-3p under both LOCALAPPDATA and APPDATA
  • LOCALAPPDATA unset falls back to ~/AppData/Local for Claude-Data and Claude-3p
  • CODEBURN_DESKTOP_SESSIONS_DIR still wins over all of them

…and Claude-3p folders

Claude Desktop 3.1623.0 on Windows moves its data from the MSIX LocalCache
to %LOCALAPPDATA%\Claude-Data\claude_<hash>\ on first launch and removes the
old path, so Desktop sessions stopped being found. Third-party mode keeps its
own Claude-3p folder, under %LOCALAPPDATA% since 1.5186.0 and %APPDATA% before.

The win32 branch now also scans %LOCALAPPDATA%\Claude-Data for claude_*
directories (sorted, missing folder tolerated) and checks both Claude-3p
locations. Each new root is used only when its local-agent-mode-sessions
directory exists. The classic and MSIX paths stay first, and the cache key is
unchanged since every new path derives from APPDATA, LOCALAPPDATA or the home.
On an MSIX install the Claude-Data folder is named after the package family,
<publisher>.claude_<hash>, not only claude_<hash>, so the startsWith('claude_')
filter skipped it. Match names that start with claude_ or contain .claude_,
case-insensitively, like the Packages filter.

This branch has not been deployed

No deployments
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.

2 participants