[BUG] Auto-generated session name matches an unrelated project file, not the conversation — identical name reused across sessions in the same cwd

Status Closed — not planned
Reported on v2.1.220
Maintainer reply None cached
Activity 4 comments · opened Jul 28, 2026 · closed Jul 28, 2026

Summary

Two independent interactive CLI sessions started in the same project working directory received the identical auto-generated session name, and that name has no relation to either session's actual conversation content. Instead, the name exactly matches the title of an unrelated, already-completed spec/doc file that happens to live in the project directory — suggesting the auto-naming heuristic is picking up project-directory file state rather than summarizing the live conversation.

Environment

  • Claude Code CLI, interactive mode
  • Reproduced on v2.1.220 (session A) and v2.1.219 (session B)
  • macOS

Evidence

Both sessions' live process state files under ~/.claude/sessions/<pid>.json show the same name:

Session A — pid 56244, sessionId: 2b010804-3bab-4c08-bf70-b416aacf018b, started 2026-07-27, cwd .../apps/aws-scanner:

{
  "sessionId": "2b010804-3bab-4c08-bf70-b416aacf018b",
  "cwd": ".../apps/aws-scanner",
  "version": "2.1.220",
  "name": "SPEC-UI-002: <resource page UI security-page standard unification>"
}

Session B — pid 74289, sessionId: 09af28a5-801c-40d8-baec-b05c3cc1726c, started 2026-07-24, same cwd:

{
  "sessionId": "09af28a5-801c-40d8-baec-b05c3cc1726c",
  "cwd": ".../apps/aws-scanner",
  "version": "2.1.219",
  "name": "SPEC-UI-002: <resource page UI security-page standard unification>"
}

Both sessions share the same cwd, but their actual conversations are unrelated to each other and never mention "SPEC-UI-002". That exact string is the literal title of a spec.md document living under .moai/specs/SPEC-UI-002/ in the project directory — a spec that was already marked completed days before session A even started. I confirmed directly against session A's full JSONL transcript that "SPEC-UI-002" and its topic are never discussed in that session at all.

Expected behavior

The auto-generated session name should be derived from that specific session's own conversation content. Two sessions started on different days, with completely unrelated conversations, should not receive the identical, conversation-irrelevant name just because they share a working directory.

Suspected root cause

The title-generation heuristic appears to source the name from project-directory file state (e.g. "most recently touched/most prominent spec file under this project"), rather than from the live conversation transcript. Any new session opened in the same cwd then inherits that same stale, project-level title, regardless of what is actually discussed.

Impact

Session names shown in --resume / session pickers become useless for telling apart unrelated conversations that happen to share a project directory — which defeats the entire purpose of auto-naming.

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗