Skip to content

Session history not found: path encoding mismatch with Claude Code #53

@JasprW

Description

@JasprW

Bug

The History Picker always shows "No previous sessions found" even when valid session JSONL files exist on disk.

Root Cause

Claude Code encodes project paths by replacing both / and . with - when storing session files under ~/.claude/projects/. For example:

/Users/john.doe/Dev/my-project
→ ~/.claude/projects/-Users-john-doe-Dev-my-project/

However, CLUI's listSessions handler (in src/main/index.ts) only replaces /:

const encodedPath = cwd.replace(/\//g, '-')

This produces -Users-john.doe-Dev-my-project — note the dot is preserved. Since no directory with that name exists, existsSync returns false and an empty array is returned.

The same issue affects loadSession.

Expected

Path encoding should match Claude Code's encoding — at minimum, both / and . should be replaced with -.

Steps to Reproduce

  1. Have a macOS username containing a dot (e.g. john.doe)
  2. Open CLUI, select a project directory
  3. Click the History (clock) icon
  4. Observe "No previous sessions found" even though ~/.claude/projects/ has valid session files for that project

Fix

Replace:

const encodedPath = cwd.replace(/\//g, '-')

With:

const encodedPath = cwd.replace(/[/.]/g, '-')

in both LIST_SESSIONS and LOAD_SESSION handlers.

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