claude-code - 💡(How to fix) Fix [Bug] Sidebar session grouping uses git root instead of session subdirectory [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#51722Fetched 2026-04-22 07:54:35
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

Code Example

[]
RAW_BUFFERClick to expand / collapse

Bug Description [Bug + Feature Request] Desktop sidebar grouping & hierarchical display

Version: Claude Code 2.1.92 OS: macOS

--- Bug --- Expected behavior: Sessions opened in a subdirectory (e.g., /Users/me/repo/consulting/new-clients/) should appear under that subdirectory name in the sidebar groups, as they did until 2026-04-21.

Actual behavior (as of 2026-04-22): Sessions now appear grouped under the parent git repository root name (e.g., "repo") regardless of the cwd subdirectory.

Note: Data layer seems healthy — ~/.claude/projects/ correctly stores the session under the cwd-specific directory. Only the sidebar grouping UI displays them under the git root.

Repro:

  1. cd into a subdirectory of a git repo
  2. Start a new Claude Code session
  3. Observe sidebar — session is grouped under the git root, not the subdirectory

Related: Issue #51539 (worktree sessions in "Other" group) may share a cause.

--- Feature Request --- Ideally, the sidebar should display folders hierarchically (tree view): a parent folder expands to show its subfolders as nested children, so users can navigate the directory structure rather than seeing a flat list of group names. For example: repo/ └ consulting/ └ new-clients/ └ (sessions)

Environment Info

  • Platform: darwin
  • Terminal: Apple_Terminal
  • Version: 2.1.92
  • Feedback ID: 0852a68e-33a2-42a7-a8b3-d5260fdbe588

Errors

[]

extent analysis

TL;DR

The issue can be addressed by investigating and adjusting the logic that determines the grouping of sessions in the sidebar, potentially involving changes to how the application resolves the current working directory (cwd) and its relationship to the git repository root.

Guidance

  • Review the code responsible for populating the sidebar groups, focusing on how it handles sessions opened in subdirectories of a git repository.
  • Verify that the ~/.claude/projects/ data layer correctly stores session information under the cwd-specific directory, as noted in the issue.
  • Investigate the difference in behavior between the data layer storage and the sidebar display to identify the point of discrepancy.
  • Consider the related issue #51539 and whether resolving one issue might impact the other.

Example

No specific code example can be provided without more details on the application's codebase, but the investigation should involve examining functions or methods that handle session grouping and directory resolution.

Notes

The solution may involve adjusting the application's logic to correctly identify and display the subdirectory structure within the git repository, potentially requiring changes to how the application navigates and resolves directory paths.

Recommendation

Apply a workaround by manually adjusting the session storage or display logic to correctly group sessions under their respective subdirectories until a permanent fix can be implemented, as the root cause seems related to the application's internal logic rather than an external dependency or version issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [Bug] Sidebar session grouping uses git root instead of session subdirectory [1 comments, 2 participants]