Session name set by /rename is overwritten after /resume
Status Fixed / completed
Reported on v2.1.33
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 8 comments · opened Feb 6, 2026 · closed Feb 18, 2026
Description
When resuming a named session via /resume, the custom session name set by /rename gets overwritten with an auto-generated title based on conversation content.
Steps to Reproduce
- Start a session
- Run
/rename my-session-nameto name the session - Exit the session
- Run
/resumeorclaude --resume my-session-nameto resume the session - Work in the session, then exit
- Run
/resumeagain to see the session list
Expected Behavior
The session should retain the custom name my-session-name set by /rename.
Actual Behavior
The custom name is replaced with an auto-generated title based on conversation content. The original name is lost.
Additional Context
- This happens consistently across multiple sessions
- Renaming again with
/renameworks temporarily, but the name gets overwritten again after the next resume - Version: 2.1.33
- OS: macOS (Darwin 25.2.0)
8 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
I can confirm that this issue can easily be reproduced on version 2.1.34
<img width="684" height="667" alt="Image" src="https://github.com/user-attachments/assets/fd00d8d7-fce0-48e0-bd16-c6691d8f3641" />
up
up, please this is really annoying!
Adding another voice here — this is a significant UX blocker for power users.
I run multiple concurrent Claude Code sessions across different projects and tasks.
/renameis great for labeling terminal tabs, but the fact that session names don't persist through/resumemakes session management painful in practice:/resumeshows a list of auto-generated titles that all look similarThis feels like a small fix that would be a big unlock.
/renameshould durably set the session name so it survives resume cycles. Right now the feature is half-built — it names the tab but the name evaporates on resume.Please fix this, it would be highly impactful.
ROOT CAUSE
In the compiled bundle (versions/2.1.39), the function
yw8performs a fast metadata read of session JSONL files for the/resumepicker:The
/renamecommand (functionx$T) appends a single line to the JSONL:This line is ~80–100 bytes. After 16KB of additional conversation (roughly 2–5 more exchanges depending on tool use), the
custom-titleline falls outside the tail window andnKTreturnsnull.The full JSONL parser (
R1T) correctly readscustom-titleevents from anywhere in the file, butR1Tis only used for the first ~10 sessions shown in the picker (the “enrichment” pass viaA1T). All other sessions use the fastyw8path and lose their titles.---
REPRODUCTION
``
``claude
``
``/rename test-rename-bug
(typically 3–5 exchanges with tool use, or ~10 text-only exchanges)
``
``claude
/resumeand search fortest-rename-bug---
VERIFICATION
To confirm the bug on any session, check if the
custom-titleline is in the last 16KB:---
WORKAROUND
Re-append the
custom-titleline to the end of affected JSONL files. This puts it back within the 16KB tail window:This can be automated via a Stop hook in
~/.claude/settings.json:---
SUGGESTED FIX (UPSTREAM)
Option A (minimal):
In
x$T(the/renamehandler), after writing thecustom-titleevent, also write it as the last line of the file. The duplicate is harmless sinceR1TusesMap.set()which overwrites, andnKTjust does a string scan. This ensures it is always in the tail.Option B (better):
In
yw8, ifnKTfails to findcustomTitlein the tail buffer, fall back to scanning from the head. Thecustom-titleline is small and typically near the end of the non-message section, so a secondary scan of the first ~64KB would catch it.Option C (best):
Avoid relying on tail-scanning for metadata. Write an explicit metadata header or maintain a small sidecar JSON file per session (e.g.,
<session-id>.meta.json) that storescustomTitle, tags, and other metadata written by slash commands. This removes the dependency on JSONL byte offsets entirely.---
RELATED ISSUES
“Session name set by /rename is overwritten after /resume”
“Conversation name lost in active session after /resume”
Both likely stem from the same 16KB tail-read limitation.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.