You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Session name set by /rename is overwritten after /resume #23610
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-name to name the session
Exit the session
Run /resume or claude --resume my-session-name to resume the session
Work in the session, then exit
Run /resume again 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 /rename works temporarily, but the name gets overwritten again after the next resume
Version: 2.1.33
OS: macOS (Darwin 25.2.0)
Reacted by giulio, Dale, Alex, Domonkos Debreczeni, Daniel Bak, Kyle, Manuel Llaguno, Mohamed, Andrii Bezzub, sergei l. and 3 more
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. /rename is great for labeling terminal tabs, but the fact that session names don't persist through /resume makes session management painful in practice:
After a restart, /resume shows a list of auto-generated titles that all look similar
I've accidentally launched the same session multiple times because I couldn't tell them apart
I end up hopping between sessions trying to find the right one
This feels like a small fix that would be a big unlock. /rename should 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.
In the compiled bundle (versions/2.1.39), the function yw8 performs a fast metadata read of session JSONL files for the /resume picker:
let BbR = 16384; // 16KB tail buffer
let J = Math.max(0, R - BbR); // offset = fileSize - 16KB
let W = /* read last 16KB of file */;
let Q = nKT(W, "customTitle"); // string scan for customTitle
The /rename command (function x$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-title line falls outside the tail window and nKT returns null.
The full JSONL parser (R1T) correctly reads custom-title events from anywhere in the file, but R1T is only used for the first ~10 sessions shown in the picker (the “enrichment” pass via A1T). All other sessions use the fast yw8 path and lose their titles.
REPRODUCTION
Start a new session:
claude
Rename it:
/rename test-rename-bug
Have a conversation that generates >16KB of JSONL content
(typically 3–5 exchanges with tool use, or ~10 text-only exchanges)
Exit the session
Run:
claude
Open /resume and search for test-rename-bug
Expected: Session appears with custom title
Actual: Session appears with first prompt text, not searchable by title
VERIFICATION
To confirm the bug on any session, check if the custom-title line is in the last 16KB:
python3 -c "
import os, json, sys
path = sys.argv[1]
size = os.path.getsize(path)
tail_start = max(0, size - 16384)
offset = 0
with open(path) as f:
for line in f:
if '\"custom-title\"' in line:
in_tail = offset >= tail_start
obj = json.loads(line.strip())
print(f'{\"OK\" if in_tail else \"MISS\"}: {obj.get(\"customTitle\")} (offset={offset}, tail_starts={tail_start})')
offset += len(line.encode('utf-8'))
" ~/.claude/projects/<project-dir>/<session-id>.jsonl
WORKAROUND
Re-append the custom-title line to the end of affected JSONL files. This puts it back within the 16KB tail window:
python3 -c "
import json, os
from pathlib import Path
TAIL = 16384
for d in (Path.home() / '.claude/projects').iterdir():
if not d.is_dir(): continue
for f in d.glob('*.jsonl'):
size = f.stat().st_size
title_line = title_off = None; off = 0
with open(f) as fh:
for line in fh:
if '\"custom-title\"' in line:
try:
obj = json.loads(line.strip())
if obj.get('type') == 'custom-title':
title_line, title_off = line.strip(), off
except: pass
off += len(line.encode('utf-8'))
if title_line and title_off < max(0, size - TAIL):
with open(f, 'a') as fh: fh.write(title_line + '\n')
print(f'Fixed: {json.loads(title_line)[\"customTitle\"]}')
"
This can be automated via a Stop hook in ~/.claude/settings.json:
Option A (minimal):
In x$T (the /rename handler), after writing the custom-title event, also write it as the last line of the file. The duplicate is harmless since R1T uses Map.set() which overwrites, and nKT just does a string scan. This ensures it is always in the tail.
Option B (better):
In yw8, if nKT fails to find customTitle in the tail buffer, fall back to scanning from the head. The custom-title line 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 stores customTitle, tags, and other metadata written by slash commands. This removes the dependency on JSONL byte offsets entirely.
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.
Activity
github-actions commentedon Feb 6, 2026
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
zhijun42 commentedon Feb 7, 2026
I can confirm that this issue can easily be reproduced on version 2.1.34
kuzmany commentedon Feb 10, 2026
up
giulioiannelli commentedon Feb 11, 2026
up, please this is really annoying!
krasmussen37 commentedon Feb 11, 2026
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.DanielPBak commentedon Feb 11, 2026
Please fix this, it would be highly impactful.
rfaile313 commentedon Feb 12, 2026
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
Start a new session:
Rename it:
Have a conversation that generates >16KB of JSONL content
(typically 3–5 exchanges with tool use, or ~10 text-only exchanges)
Exit the session
Run:
Open
/resumeand search fortest-rename-bugExpected: Session appears with custom title
Actual: Session appears with first prompt text, not searchable by title
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 #23610
“Session name set by /rename is overwritten after /resume”
[BUG] Conversation name lost in active session after /resume, despite showing in picker #16973
“Conversation name lost in active session after /resume”
Both likely stem from the same 16KB tail-read limitation.
chore: Update CHANGELOG.md
github-actions commentedon Feb 27, 2026
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.
chore: Update CHANGELOG.md