Session auto-title latches onto an interrupted first message and never regenerates

Open 💬 3 comments Opened Jun 23, 2026 by maherr

Symptom

The interactive CLI generates a session's auto-title once, from the first non-command user message, and never updates it. When that first message is one I submitted and then interrupted with Esc before it ran, the title sticks to that aborted message for the rest of the session, even after I send real follow-up prompts and do substantial work. The stale title shows in claude --resume, the Recents sidebar, and the terminal tab, and stays until I run /rename.

Reproducer

  1. Start a session whose first turn is a slash command, so the first turn is a command rather than prose (a custom skill works).
  2. Type a prose message, press Enter, then interrupt it with Esc before it produces a response.
  3. Send a different prose message and let it complete normally.
  4. Look at the session title.

Expected: the title reflects the actual conversation, or at least is not derived from the aborted turn.

Actual: the title is generated from the interrupted message in step 2 and never changes, including after step 3.

Determinism

Reproduces every time the first title-eligible user message is an interrupted turn. This is easy to hit when a session opens with a slash command, since command turns are skipped for titling and the next prose message becomes the title source.

Root cause (observable)

The title is persisted to the session transcript as a single ai-title entry, generated once from the first eligible user message and not regenerated. In ~/.claude/projects/<project>/<session>.jsonl the ai-title entry is written right after the interrupted turn and before the real follow-up message, and it never updates for the rest of the session.

Suggested fix directions

  • Regenerate the auto-title over the conversation after a few messages instead of one-shot on the first eligible message.
  • Exclude interrupted or aborted turns from title generation.
  • For sessions that open with a slash command, derive the title from the first substantive turn rather than the first stray prose message.

Environment

  • Claude Code 2.1.186, interactive CLI, Linux. Observed June 2026.

Related

#61179 (make auto-generated session titles more descriptive or configurable) is adjacent but distinct: this is about the title being derived from the wrong, aborted message and never updating, not about title quality.

View original on GitHub ↗

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