Skip to content

fix project path resolution for directories with hyphens#3

Open
cce wants to merge 1 commit intoozankasikci:mainfrom
cce:agent-sessions-fix
Open

fix project path resolution for directories with hyphens#3
cce wants to merge 1 commit intoozankasikci:mainfrom
cce:agent-sessions-fix

Conversation

@cce
Copy link

@cce cce commented Feb 6, 2026

Claude Code stores session files in ~/.claude/projects/ using encoded directory names where path separators become hyphens. This caused issues because hyphens in actual directory names (like "agent-sessions") were indistinguishable from path separator hyphens.

Worse, different paths can collide into the same encoded directory:

  • /Users/foo/agent-sessions -> -Users-foo-agent-sessions
  • /Users/foo/agent/sessions -> -Users-foo-agent-sessions

The fix reads the cwd field directly from each JSONL session file and groups files by their actual cwd before matching to processes. (This mirrors how AgentSessions.app handles it... unfortunate name collision with your project but another useful app I use for searching session transcripts!) The original directory name decoding is kept as a fallback for files without a cwd field.

Before:
image

After:
image

Claude Code stores session files in ~/.claude/projects/ using encoded
directory names where path separators become hyphens. This caused issues
because hyphens in actual directory names (like "agent-sessions") were
indistinguishable from path separator hyphens.

Worse, different paths can collide into the same encoded directory:
- /Users/foo/agent-sessions -> -Users-foo-agent-sessions
- /Users/foo/agent/sessions -> -Users-foo-agent-sessions

The fix reads the cwd field directly from each JSONL session file and
groups files by their actual cwd before matching to processes. This
mirrors how AgentSessions.app handles it. The original directory name
decoding is kept as a fallback for files without a cwd field.
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.

1 participant