Skip to content

Windows: the same archived conversation is indexed under two path spellings (C-- vs c--), showing as orphans and duplicates #202

Open

Description

@RoJLD

What happens. On Windows, Claude Code's project folders can be named with the drive letter in either case: C--Users-… or c--Users-…. VS Code launches with c:\, the CLI and the desktop app with C:\. NTFS treats both names as the same folder, and the archive folder keeps whichever spelling was seen first. But exchanges.archive_path is stored with the spelling of the run that indexed it, and verifyIndex compares paths as exact strings (foundFiles.has(exchange.archivePath)).

Consequences, seen on one machine (v1.0.15 history, now on v1.6.0):

  • 84 archived conversations (246 exchanges) recorded as …\c--Users-…\<id>.jsonl, while the folder on disk is C--Users-…. verify reports all of them as orphaned, and repair would delete them even though the files exist.
  • 9 of those conversations were also indexed under the on-disk spelling, so their 159 exchanges come back twice in search results.

Suggested fix. On win32, normalize an archive path to its on-disk case before storing and before comparing it, for example with fs.realpathSync.native(p), or compare paths case-insensitively there. A one-off cleanup could then drop the rows whose archive_path differs from the on-disk spelling only by case, and let repair re-index what is left without rows (#200 / #201).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions