Skip to content

Session Explorer misses sessions created inside git worktrees #104

Description

@gi11es

Bug

A Claude tab whose agent cds into a git worktree (e.g. via the worktree tooling) writes its session file under the worktree's project directory, but Session Explorer only scans the project directory derived from the workspace path. The session becomes invisible and cannot be resumed or forked from the UI, even though it is intact on disk.

Repro

  1. Open workspace ~/Documents/foo.
  2. In a Claude tab, enter a worktree at ~/Documents/foo/.claude/worktrees/bar (agent cwd changes).
  3. Session file is written to ~/.claude/projects/-Users-…-foo--claude-worktrees-bar/<id>.jsonl, while Explorer scans ~/.claude/projects/-Users-…-foo/.
  4. The session is missing from Session Explorer for that workspace.

Expected

Sessions belonging to worktrees under the workspace should be listed (ideally labelled with their worktree), and resumable/forkable.

Notes

Observed twice on real sessions (a 1.2 MB and a 30 MB session file). Workaround is to open the worktree directory itself as a workspace, or resume by id from the worktree directory. A fix could scan sibling project dirs whose decoded path is a descendant of the workspace path.

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