Native project-prefix session titles for cross-project date view
Problem
When working across multiple projects, the desktop sidebar's date-sorted view loses project context. A title like Review monthly costs is ambiguous — which project is it about? Currently the only way to disambiguate is to switch the sidebar into project-grouped mode (which loses chronological context) or manually /rename every session with a prefix.
Use case
Solo operators, consultants, and anyone juggling 5–10 active projects need to scan recent activity across projects in date order. A sidebar entry like [ProjectA] Review monthly costs immediately tells you which project it belongs to without losing the date sort.
Proposed UX
A setting (settings.json or UI) along these lines:
{
\"sessionTitlePrefix\": {
\"enabled\": true,
\"format\": \"[{alias}] {title}\",
\"aliasMap\": {
\"/path/to/project-a\": \"ProjectA\",
\"/path/to/project-b\": \"ProjectB\",
\"/path/to/personal-blog\": \"Blog\"
},
\"fallback\": \"basename\"
}
}
Behaviour:
- When auto-generating a session title, prefix it with
[alias]derived from the cwd. - Lookup is path-prefix-match against
aliasMap; if no match, fall back tobasename(cwd)(or skip the prefix iffallback: null). - Works in both auto-titles and manual
/rename-d titles (or only auto, configurable). - Match nested paths too:
/path/to/project-a/.claude/worktrees/foo→[ProjectA].
Why this should be a native feature, not just a hook
Even with the UserPromptSubmit sessionTitle hook (see related issue), users still need to:
- Write a shell script.
- Maintain the alias map themselves.
- Re-implement title generation (LLM call or heuristic).
That's a lot of plumbing for what's fundamentally one product setting. Native support would let everyone with a multi-project workflow benefit without scripting.
Optional v2
A {project} template variable that resolves to the project name from ~/.claude/projects/ rather than cwd basename, and a per-project override in the project's CLAUDE.md.
Related
Companion issue tracking the underlying hook bug that surfaces this need.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗