[FEATURE] Desktop sidebar: group sessions by working directory, not only by repository root
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
The Code tab sidebar groups sessions by project, and in practice the group key is the git repository root. A session started in a subfolder of a repository is folded into the repository-level group — even though the app already records that session's full working directory (it shows up correctly in the session metadata).
I work in a single large repository that is organized by business area rather than by code module: dozens of top-level subfolders, each a separate line of work (a different client, a different product line). Every session I start lives in one of those subfolders, so the sidebar ends up showing one flat list of 20+ unrelated sessions under a single repository name, with nothing to indicate which area each one belongs to. The information needed to separate them already exists per session — it just isn't used for grouping.
This is distinct from the worktree case: worktrees of one repository hit the same wall, but here it's ordinary subdirectories of a single checkout.
Proposed Solution
Allow the sidebar to group by the session's working directory, not only by the repository root:
- A grouping option such as Group by: repository / working directory in the sidebar's existing grouping control.
- When grouping by working directory, render nested, collapsible groups that follow the real path (
repo > area > client-a), collapsing single-child levels so the tree doesn't become needlessly deep. - Optionally, a per-repository setting for how many path levels below the repository root are exposed as groups.
Alternative Solutions
- Renaming every session to embed the subfolder name (
[client-a] ...) — works, but is manual and rots as sessions accumulate. - Turning each subfolder into its own git repository purely to obtain separate sidebar groups — this would break how the repository is shared and synced across the team, so it isn't viable.
- Related but not the same: #74129 requests user-defined nested folders with drag-and-drop (manual organization), and #86259 requests showing each session's directory on its row (display, not grouping). This request is for automatic grouping derived from the working directory the app already tracks, which neither of those covers.
Priority
Medium - Would be very helpful
Feature Category
Other
Use Case Example
- One repository holds ~10 business areas, each in its own subfolder, and each subfolder holds the work for a different client or product line.
- Over a week I start 20+ sessions, each one in a different subfolder of that repository.
- The sidebar lists all of them under a single repository group as a flat list, so finding "the session for client A" means opening sessions to check where they run.
- With this feature the same sessions would appear under collapsible groups matching the folders they actually run in, so I could collapse the areas I'm not working on and land on the right session immediately.