/rename without arguments still broken on resumed sessions (stale-closed #26686)
Status Fixed / completed
Reported on v2.1.123
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 6 comments · opened Apr 29, 2026 · closed May 1, 2026
Bug
/rename without arguments fails with Could not generate a name: no conversation context yet even when there is
extensive conversation history. This happens consistently when resuming a session, and sometimes in active sessions too.
Steps to reproduce
- Have a multi-turn conversation with Claude Code
- End the session
- Resume the session with
--resumeor--continue - Run
/rename(no arguments)
Expected: Auto-generates a name from conversation context
Actual: Could not generate a name: no conversation context yet. Usage: /rename <name>
Environment
- Claude Code version: 2.1.123
- OS: macOS (Darwin 25.4.0, arm64)
Prior issues
This was previously reported in #26686 and #27668, both closed by the stale bot without a fix. The underlying bug
still exists.
Workaround
Passing a name explicitly (/rename my-name) works fine. Only the auto-generate (no-argument) form is broken.
6 Comments
Found 2 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
This is session-state carryover failure at the command boundary.
If
/renamewithout arguments is still broken specifically on resumed sessions, then something in the resumed session state is preserving a stale closure or invalid command context that the fresh-session path does not have.Why it matters:
I would want clarity on:
/renameis failing before command parsing, during command resolution, or in the post-resume session adapterSession continuity needs fresh validity, not stale residue. If resumed sessions keep a broken
/renamepath alive after the original issue was considered closed, the resume boundary is rehydrating the wrong state.@0xbrainkid Great analysis — you're on the right track. Did some more digging and here's what I found:
Root cause: JSONL replay failure on resume, not stale command state
The
/renameauto-generate reads from the in-memory conversation message history that the harness loads from the session JSONL file at startup. "No conversation context yet" literally means: the loader didn't reconstruct any usable message history into memory.So it's not really a command-parsing or argument-resolution issue —
/renameitself works fine. The problem is upstream in the conversation replay that feeds it.Why resumed sessions hit this
Session JSONL files are append-only logs with no upfront index. On resume, the loader scans sequentially to find the "live" conversation endpoint. There are known failure modes here (some previously fixed, clearly not all):
Fixed --resume/--continue losing conversation context on large sessions when the loader anchored on a dead-end branch), but clearly doesn't cover all cases.The key point: the harness successfully "resumes" the session (you can keep chatting, tool use works, Claude has context via the system prompt and compacted history) — but the parsed message objects that
/renamereads from may not be populated. The LLM gets context through a different path (compacted prompt) than what/renameinspects.This also makes me wonder — why does
/renameuse a separate context source at all? The LLM clearly has enough context to continue the conversation coherently. It can reference earlier turns, recall tool outputs, maintain topical continuity. If/renameauto-generate simply asked the same LLM "suggest a short name for this session," it would work every time, regardless of session lifecycle. Instead it inspects a raw message list that may or may not be populated depending on how the JSONL loader fared. Feels like the LLM context is the more reliable source of truth here.What "not properly closed" means
A session is not properly closed when the process exits without writing a terminal state marker or flushing the JSONL buffer — e.g.,
Ctrl+Cduring a tool call, terminal window closed, SSH disconnect, or process crash. On next resume, the loader has to guess where the live conversation ended.Why this also happens in fresh sessions (per #26686)
The original report (#26686) noted this happening in fresh sessions too (not just resumed ones), which suggests there may be a second issue: the in-memory message list that
/renamechecks might not be the same object that accumulates conversation turns. Could be reading from a separately-scoped context that never gets populated.Reproducing
I can confirm this is still broken on v2.1.123. In this very session (long multi-turn conversation with extensive tool use),
/renamewithout arguments returned the same error. Providing a name explicitly works fine.What would fix it
The simplest and most robust fix: make
/renameauto-generate a model call using the same conversation context the LLM already has. Ask the model "suggest a short name for this session" — it already knows what the session is about. This sidesteps all the JSONL replay fragility entirely.If that's too heavyweight for a slash command, then at minimum:
/rename <name>formReproducing on Linux/WSL with Bedrock backend, and one fresh data point
Same bug, different environment:
2.1.132CLAUDE_CODE_USE_BEDROCK=1,eu.anthropic.claude-opus-4-7)Triggers in active sessions too, not just resumed ones — happens consistently in tool-heavy multi-turn conversations (mine: 75 user + 119 assistant messages, plenty of plain text content, ~260-line transcript on disk).
Diagnostic — narrows it down
I ran with
CLAUDE_CODE_DEBUG=1and--debug. The renaming flowy38→LnH→k38has three silentnull-returning paths, only the third logs:generateSessionName failed:does not appear in the debug log — so this is not a model-call exception. It's either path 1 (k38returning empty for an in-memory message list whose shape differs from disk) or path 2 (model output failing the{name: string}schema check).Suggested fixes
Workaround confirmed:
/rename <explicit-name>works.Hi @sosukesuzuki is this fixed? Why is it marked as closed?
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.