codeburn icon indicating copy to clipboard operation
codeburn copied to clipboard

By Project dashboard shows parent folder name instead of actual project name for Claude Code projects

Open Akramihyar opened this issue 5 months ago • 1 comments

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

  1. Have Claude Code sessions in projects under ~/Projects/ (e.g. ~/Projects/Swiftbar, ~/Projects/Content-OS)
  2. Run codeburn to open the dashboard
  3. View the By Project panel

Expected Behavior

Each project should show its actual name:

  • Swiftbar
  • Content-OS
  • Instagram
  • 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.

Akramihyar avatar Jun 15 '26 02:06 Akramihyar

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.

ozymandiashh avatar Jun 21 '26 13:06 ozymandiashh