Skip to content

[BUG] Some sessions are missing due to inconsistent drive letter casing in cwd on Windows #123

@chuan13

Description

@chuan13

Describe the bug
The drive letter in the cwd field of session log files can differ in casing.

  • Sessions started from Claude Code CLI use uppercase (e.g., C:\...)
  • Sessions started from the Claude Code VS Code extension use lowercase (e.g., c:\...)

As a result, only one group of sessions is shown in this application.

To Reproduce

  1. On Windows, in the same directory:
    • Start one session using Claude Code CLI
    • Start another session using Claude Code for VS Code
  2. Inspect the session log files at ~/.claude/project/<project-path>/<session-id>.jsonl, will find that the cwd values use different drive letter casing
  3. Open this application and open the project, only one set of sessions is displayed

Expected behavior
All sessions from the same directory (project) should be displayed together.

Desktop:

  • OS: Windows 11
  • claude-devtools version: 0.4.8

Additional context
Claude Code suggested to modify these code at src/main/services/discovery/ProjectScanner.ts:244:

// cwd = await extractCwd(filePath, this.fsProvider);  // original code
  const rawCwd = await extractCwd(filePath, this.fsProvider);
  cwd = rawCwd && process.platform === 'win32'
    ? path.normalize(rawCwd.toLowerCase())
    : rawCwd;

This fix resolves the issue and passes tests, but I'm not sure whether it might have side effect elsewhere.

Thanks for developing this great tool 👍

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions