claude-code - 💡(How to fix) Fix Native project-prefix session titles for cross-project date view [1 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#55952Fetched 2026-05-05 06:02:02
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
labeled ×2

Code Example

{
  \"sessionTitlePrefix\": {
    \"enabled\": true,
    \"format\": \"[{alias}] {title}\",
    \"aliasMap\": {
      \"/path/to/project-a\": \"ProjectA\",
      \"/path/to/project-b\": \"ProjectB\",
      \"/path/to/personal-blog\": \"Blog\"
    },
    \"fallback\": \"basename\"
  }
}
RAW_BUFFERClick to expand / collapse

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 to basename(cwd) (or skip the prefix if fallback: 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:

  1. Write a shell script.
  2. Maintain the alias map themselves.
  3. 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.

extent analysis

TL;DR

Implement a native session title prefix feature with a configurable alias map to disambiguate project context in the desktop sidebar's date-sorted view.

Guidance

  • Introduce a sessionTitlePrefix setting in settings.json with options for enabling, formatting, and alias mapping to provide project context.
  • Develop a path-prefix-match lookup mechanism to derive the alias from the current working directory (cwd) and apply it to auto-generated session titles.
  • Consider implementing a fallback to basename(cwd) or skipping the prefix if no match is found in the alias map.
  • Evaluate the feasibility of supporting nested paths and per-project overrides in the project's CLAUDE.md file.

Example

{
  "sessionTitlePrefix": {
    "enabled": true,
    "format": "[{alias}] {title}",
    "aliasMap": {
      "/path/to/project-a": "ProjectA",
      "/path/to/project-b": "ProjectB"
    },
    "fallback": "basename"
  }
}

Notes

The proposed solution relies on the existence of a settings.json file and the ability to modify it. The implementation details, such as the exact syntax and behavior, may vary depending on the underlying system.

Recommendation

Apply workaround by implementing the proposed sessionTitlePrefix setting and alias map, as it provides a flexible and configurable solution to disambiguate project context in the desktop sidebar.

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 Native project-prefix session titles for cross-project date view [1 participants]