Skip to content

fix: MSIX/Store path detection + remove transcriptUnavailable on repair#7

Open
BasedGPT wants to merge 3 commits into
mainfrom
fix/msix-path-detection
Open

fix: MSIX/Store path detection + remove transcriptUnavailable on repair#7
BasedGPT wants to merge 3 commits into
mainfrom
fix/msix-path-detection

Conversation

@BasedGPT
Copy link
Copy Markdown
Owner

Summary

Two fixes for Windows path detection and a one-line repair correctness fix.

MSIX/Store install path detection (fixes #5)

Standard installs store Claude data at %APPDATA%\Claude. MSIX/Store installs use %LOCALAPPDATA%\Packages\Claude_<hash>\LocalCache\Roaming\Claude — a completely different root. diagnose.py was returning 0 metadata files for MSIX users because it never looked there.

Both diagnose.py and repair_session_metadata.py now check %APPDATA%\Claude first. If that directory doesn't exist, they scan %LOCALAPPDATA%\Packages\ for any Claude_* package and use its LocalCache\Roaming\Claude path instead.

Remove transcriptUnavailable on repair

When repair_session_metadata.py --apply writes a repaired metadata file, it now pops transcriptUnavailable from the dict before writing. The Desktop app checks this flag before rendering session content — leaving it set after backfilling cliSessionId caused sessions to still show "Session not found on disk" even after a successful repair. Surfaced by #63082 on the upstream tracker (macOS startup scanner sets both transcriptUnavailable: true and removes cliSessionId; repair was only fixing half the problem).

Files changed

  • tools/diagnose.py — MSIX fallback in main() Windows branch
  • tools/sessions/repair_session_metadata.py — MSIX fallback in _default_paths(), transcriptUnavailable pop in --apply write path

Test plan

  • Run diagnose.py on a machine with an MSIX Claude install — should now show metadata count > 0
  • Manually set transcriptUnavailable: true and clear cliSessionId in a test metadata file, run repair_session_metadata.py --apply, confirm key is removed in the output file
  • Existing fixture tests pass (no changes to fixture logic)

BasedGPT added 3 commits May 29, 2026 18:24
…criptUnavailable on repair

Standard Windows installs store Claude data at %APPDATA%\Claude.
MSIX/Store installs use %LOCALAPPDATA%\Packages\Claude_<hash>\LocalCache\Roaming\Claude.
If %APPDATA%\Claude doesn't exist, both diagnose.py and repair_session_metadata.py
now scan %LOCALAPPDATA%\Packages\ for any Claude_* package and use that path instead.

Also removes the transcriptUnavailable key when repair_session_metadata.py writes
a repaired metadata file. The Desktop app checks this flag before rendering
session content — leaving it set after backfilling cliSessionId caused sessions
to still show "Session not found on disk" even after a successful repair.

Fixes #5
…e removal

Standard Windows installs store Claude data at %APPDATA%\Claude.
MSIX/Store installs use %LOCALAPPDATA%\Packages\Claude_<hash>\LocalCache\Roaming\Claude.
If %APPDATA%\Claude doesn't exist, diagnose.py now scans %LOCALAPPDATA%\Packages\
for any Claude_* package and uses that path.

Fixes #5
…ath fallback

The Desktop checks transcriptUnavailable before rendering session content,
so leaving it set after backfilling cliSessionId caused sessions to still
show 'Session not found on disk'. Now popped from the metadata dict before
writing with --apply.

Also adds MSIX/Store path detection to _default_paths().

Related to #5
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your first PR. Please confirm:

  • CI passes (fixture tests + sanitisation lint)
  • If you added a mutator, it has a matching fixture and passes the five mutator gates (see docs/architecture.md)
  • No personal paths, real UUIDs, or identifying info in committed files

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9c570e7b7f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tools/diagnose.py
appdata_claude_dir = os.path.join(
os.environ.get("APPDATA", os.path.expanduser("~")), "Claude"
)
if not os.path.isdir(appdata_claude_dir):
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Detect MSIX Desktop before printing repair commands

When this new Store fallback makes MSIX metadata visible, desktop_running is still computed by _detect_desktop_running(), which treats a running claude.exe as Desktop only when its executable path contains AnthropicClaude; an MSIX install under the Claude_* package path won't match that check. In that Store-install context, diagnose.py can now emit runnable mutator commands without the QUIT DESKTOP FIRST warning even while Desktop is open, violating the repo's safety boundary and risking Desktop overwriting the repair on its next flush.

Useful? React with 👍 / 👎.

_appdata_claude = os.path.join(
os.environ.get("APPDATA", os.path.expanduser("~")), "Claude"
)
if not os.path.isdir(_appdata_claude):
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Fall back when the AppData root is empty

This guard only checks whether %APPDATA%\Claude exists, not whether it contains usable claude-code-sessions metadata. In a Store/MSIX environment with a leftover or empty standard-install %APPDATA%\Claude directory, the fallback to %LOCALAPPDATA%\Packages\Claude_*\LocalCache\Roaming\Claude is skipped, so diagnose/repair still operate on the empty root and report no metadata even though the Store data exists.

Useful? React with 👍 / 👎.

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.

Win11 path detection error

1 participant