Session titles go stale after a mid-session pivot; set_session_title refuses to rename the current session from within

Status Open
Reported on v2.1.221
Maintainer reply None cached
Activity 1 comment · opened Aug 5, 2026

What happened

Sessions are auto-titled from the first messages. When a session pivots mid-way (started as "read this thread", became "fix a bug and open a PR"), the title stays frozen on the original topic, so the session becomes hard to find in the session list later.

Asking the agent to fix the title from within the session does not work — the session-management MCP tools deliberately exclude the current session:

  • list_sessions: "The current session is excluded."
  • search_session_transcripts: searches "other" sessions only.
  • set_session_title: errors with Refusing to rename the current session from within itself. even though the id is knowable from CLAUDE_CODE_SESSION_ID / CLAUDE_CODE_HOST_SESSION_ID.

Workaround found

Spawn a separate session (e.g. via the suggested-task chip) whose only job is to call set_session_title on the first session's id. It works, but it is a whole extra session and a user click just to rename the current one.

Suggestion (any of these would resolve it)

  1. Allow set_session_title on the current session — the title is user-facing metadata; self-rename seems low-risk compared to spawning a sibling session to do the same thing.
  2. Or refresh the auto-title when the session's topic clearly shifts (e.g. on compaction), so titles keep matching what the session ended up being about.
  3. Or provide a first-class "rename this session" affordance the model can invoke.

Environment

  • Claude Code 2.1.221 (desktop app, macOS), agent SDK 0.3.221

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗