Feature hasn't been suggested before.
Describe the enhancement you want to request
Problem: Sessions are shared across all git worktrees of the same repository because they use projectID (first root commit hash) as the storage key. Users working with multiple worktrees see sessions from all worktrees mixed together, making it difficult to find relevant sessions.
Proposed Solution: Wire up the existing directory API filter so the TUI only shows sessions from the current working directory.
The infrastructure already exists:
- API supports
GET /session?directory=<path> (exact match filter)
tui() accepts a directory prop but it's never passed
- SDK supports
directory parameter in session.list()
Changes needed (TUI-only, no server changes):
- Pass
directory: cwd to tui() call in thread.ts
- Add
directory param to bootstrap session.list call in sync.tsx
- Filter
session.updated realtime events by directory (prevent cross-worktree sessions appearing)
- Add
directory param to session search in dialog-session-list.tsx
Alternatives considered:
- Server-side auto-filter: Rejected because it changes behavior for all clients (web UI, API consumers may want cross-worktree visibility). TUI-only approach is purely additive.
- Plugin approach: Not feasible - no plugin hook exists for session listing.
- Hidden session field: Out of scope - separate feature that requires schema changes.
Known limitations:
- Uses exact directory match (API behavior). Sessions created from a subdirectory won't appear when TUI is launched from repo root.
- No config toggle - filtering is always-on (this is the expected UX for worktree users).
Happy to submit a PR if this approach sounds reasonable.
Feature hasn't been suggested before.
Describe the enhancement you want to request
Problem: Sessions are shared across all git worktrees of the same repository because they use
projectID(first root commit hash) as the storage key. Users working with multiple worktrees see sessions from all worktrees mixed together, making it difficult to find relevant sessions.Proposed Solution: Wire up the existing
directoryAPI filter so the TUI only shows sessions from the current working directory.The infrastructure already exists:
GET /session?directory=<path>(exact match filter)tui()accepts adirectoryprop but it's never passeddirectoryparameter insession.list()Changes needed (TUI-only, no server changes):
directory: cwdtotui()call inthread.tsdirectoryparam to bootstrapsession.listcall insync.tsxsession.updatedrealtime events by directory (prevent cross-worktree sessions appearing)directoryparam to session search indialog-session-list.tsxAlternatives considered:
Known limitations:
Happy to submit a PR if this approach sounds reasonable.