By Project dashboard shows parent folder name instead of actual project name for Claude Code projects
Bug Description
The By Project panel in the TUI dashboard (and the menubar dropdown) shows the parent folder name instead of the actual project name when Claude Code project folders are stored under a subdirectory like ~/Projects/.
Steps to Reproduce
- Have Claude Code sessions in projects under
~/Projects/(e.g.~/Projects/Swiftbar,~/Projects/Content-OS) - Run
codeburnto open the dashboard - View the By Project panel
Expected Behavior
Each project should show its actual name:
SwiftbarContent-OSInstagram- etc.
Actual Behavior
All projects under ~/Projects/ are grouped and displayed as Projects (the parent folder).
Projects opened from the home directory show as home.
Root Cause
Claude Code encodes the CWD as the project folder name by replacing / with -:
/Users/akram/Projects/Swiftbar → ~/.claude/projects/-Users-akram-Projects-Swiftbar
Codeburn appears to extract the project name at depth 3 of the path (the Projects segment) instead of the last segment (Swiftbar).
Environment
- codeburn: 0.9.12
- macOS 15.3 (Darwin)
- Claude Code project folders:
~/.claude/projects/
Suggested Fix
When decoding a Claude Code project folder name, extract the last path segment after reversing the - → / encoding, rather than a fixed depth segment.
Root-caused this to two paths: (1) resolveCanonicalProjectPath walked up to any ancestor .git and used it as the project, so a stray .git in a parent of several projects (e.g. an accidental git init in ~/Projects/) collapsed every sibling to Projects; (2) the no-cwd fallback unsanitized the dir slug by replacing every - with /, so Projects-Content-OS got pop()-ed to os.
Fix: canonicalize to the main repo only for real linked worktrees (.git file pointing at worktrees/); keep the session's own cwd otherwise; and keep the lossy slug intact in the no-cwd fallback. One design note for your call: PR #375 also grouped sessions launched from a subdirectory of an ordinary repo up to the repo root; the worktree-only rule changes that (subdir sessions keep their own cwd). There's no unambiguous signal to tell a project's own repo from an accidental ancestor .git, so I went unambiguous, but happy to do something more surgical if you'd rather preserve subdir grouping. PR incoming.