fix(claude): support Windows Desktop sessions via APPDATA#615
Open
ozymandiashh wants to merge 1 commit into
Open
fix(claude): support Windows Desktop sessions via APPDATA#615ozymandiashh wants to merge 1 commit into
ozymandiashh wants to merge 1 commit into
Conversation
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.
Summary
Fixes #611.
Claude Desktop / Cowork stores local agent mode sessions under a platform-specific application data directory. CodeBurn already supports the macOS Desktop sessions path, but the Windows branch was assuming that the roaming profile is always located at
homedir()/AppData/Roaming.That assumption misses valid Windows installs where the roaming profile is redirected, customized, or managed by the OS. In that case
npx codeburncan report zero Claude Desktop / Cowork usage even when sessions exist at the real Windows path:This PR resolves the Windows Desktop sessions root from
%APPDATA%first, while preserving the previoushomedir()/AppData/Roamingpath as a fallback.Root cause
The Claude provider has two separate discovery paths:
~/.claude/projectsorCLAUDE_CONFIG_DIR(S).local-agent-mode-sessions.The workaround suggested in the issue, setting
CLAUDE_CONFIG_DIR=%APPDATA%\Claude, does not fix Cowork discovery because the config-dir flow expects aprojects/directory structure. Cowork sessions use a different layout underlocal-agent-mode-sessions, so the Desktop sessions root itself needs to be discovered correctly.Before this PR, Windows Desktop discovery used:
That is only an approximation of
%APPDATA%. It is not guaranteed to match the real Windows roaming profile location.What changed
Windows now resolves Claude Desktop / Cowork sessions from:
CODEBURN_DESKTOP_SESSIONS_DIRremains the highest-priority override for tests and manual debugging.If
APPDATAis unset or blank, the provider falls back to the old path:macOS and Linux behavior is unchanged.
Regression tests cover the Windows APPDATA path, fallback behavior, and override precedence.
Behavior matrix
CODEBURN_DESKTOP_SESSIONS_DIRis setAPPDATAset%APPDATA%\Claude\local-agent-mode-sessionsAPPDATAmissing or blankhomedir()/AppData/Roaming/Claude/local-agent-mode-sessions~/Library/Application Support/Claude/local-agent-mode-sessions~/.config/Claude/local-agent-mode-sessionsWhy this is safe
Testing
Focused validation:
npm test -- --run tests/providers/claude-config-dirs.test.ts tests/parser-claude-cwd.test.tsResult:
Build validation:
Result:
Full suite note:
npm test -- --runLocal result:
The failures are unrelated to this Claude provider change:
tests/cli-status-menubar.test.tshas 2 local data-dependent failures.tests/cli-proxy-path.test.tshas 1 local data-dependent failure.tests/cli-provider-validation.test.tshad 1 timeout under full-suite load, and did not reproduce on focused rerun.I reran the affected menubar/proxy files on
origin/main; those failures reproduce there as well, so they are not introduced by this PR.GitHub Actions on this PR:
checkpassedassesspassedsemgreppassed