Skip to content

Fix session history not found for usernames containing dots#54

Open
JasprW wants to merge 1 commit intolcoutodemos:mainfrom
JasprW:fix/session-path-encoding
Open

Fix session history not found for usernames containing dots#54
JasprW wants to merge 1 commit intolcoutodemos:mainfrom
JasprW:fix/session-path-encoding

Conversation

@JasprW
Copy link
Copy Markdown

@JasprW JasprW commented Apr 10, 2026

Summary

  • Fix path encoding in listSessions and loadSession to replace both / and . with -, matching Claude Code's actual encoding
  • Without this fix, users whose OS username contains a dot (e.g. john.doe) can never see session history

Root Cause

Claude Code encodes project paths like:

/Users/john.doe/Dev/project → -Users-john-doe-Dev-project

CLUI only replaced /-, producing -Users-john.doe-Dev-project, which doesn't match the directory on disk.

Changes

src/main/index.ts: Changed cwd.replace(/\//g, '-')cwd.replace(/[/.]/g, '-') in both LIST_SESSIONS and LOAD_SESSION handlers.

Fixes #53

Test plan

  • Verified the actual .claude/projects/ directory naming uses - for dots
  • Confirmed from debug logs that the old encoding produced a non-matching path
  • Manual test: select a project directory → click History → sessions now appear

🤖 Generated with Claude Code

Claude Code encodes project paths by replacing both '/' and '.' with '-',
but listSessions/loadSession only replaced '/'. This caused the encoded
path to not match the actual directory on disk when the OS username
contains a dot (e.g. john.doe), making all session history invisible.

Fixes lcoutodemos#53

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

Session history not found: path encoding mismatch with Claude Code

1 participant