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
- Have a macOS username containing a dot (e.g.
john.doe)
- Open CLUI, select a project directory
- Click the History (clock) icon
- 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.
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:However, CLUI's
listSessionshandler (insrc/main/index.ts) only replaces/:This produces
-Users-john.doe-Dev-my-project— note the dot is preserved. Since no directory with that name exists,existsSyncreturns 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
john.doe)~/.claude/projects/has valid session files for that projectFix
Replace:
With:
in both
LIST_SESSIONSandLOAD_SESSIONhandlers.