/rename applies title to wrong session — custom-title scanner ignores sessionId field

Resolved 💬 4 comments Opened Feb 20, 2026 by mjkerrison Closed Mar 21, 2026

Description

/rename writes custom-title entries into the JSONL transcript with a sessionId field targeting the intended session. However, the session list scanner appears to apply the title to the file the entry appears in, not the session specified in sessionId. This means /rename after /resume titles the wrong session.

Steps to Reproduce

  1. Start session A, do some work
  2. /resume → pick session B (a different session)
  3. /rename "My Title" to rename session B
  4. Exit and check /resume
  5. Session A now shows "My Title" — session B still shows (session) or its first message

Root Cause

/rename correctly writes a custom-title entry with the target sessionId:

{"type":"custom-title","customTitle":"My Title","sessionId":"<session-B-uuid>"}

But this entry is written into session A's JSONL file (the file currently being appended to). The scanner then reads this entry and applies "My Title" to session A (the file it was found in), ignoring the sessionId field entirely.

Evidence

We inspected a file (f0a45df3-....jsonl, 19KB) containing multiple custom-title entries targeting other sessions:

Line 1:  customTitle: "General"  → sessionId: f0a45df3 (self)     ← correct
Line 8:  customTitle: "Trash"    → sessionId: 97901283 (other)    ← ignored
Line 32: customTitle: "Trash 3"  → sessionId: 97901283 (other)    ← ignored
Line 37: customTitle: "Trash 4"  → sessionId: d2372569 (other)    ← ignored

In /resume, "Trash 4" appears at 19KB (the size of f0a45df3, the containing file), not at 550 bytes (the size of d2372569, the intended target). Neither 97901283 nor d2372569 show their intended titles — they appear as (session).

Additional Context

The scanner reads custom-title entries during its disk scan of JSONL files (readdirSync + parse). It correctly finds these entries but appears to use only the last customTitle value per file, rather than routing by sessionId.

Impact on workarounds

We've had to build a parallel session management system (cc — an fzf-based session picker with its own cc-titles.json title store) to work around multiple /rename and /resume reliability issues. This specific bug means that even the new custom-title JSONL approach (which replaced the old sessions-index.json system) doesn't reliably deliver renamed titles.

Related issues:

  • #24065 — /rename not persisting (older versions)
  • #27195 — claude -r <name> lookup fails intermittently
  • #22994 — auto-titler overrides /rename

Environment

  • Claude Code 2.1.49
  • Linux (Fedora 43)
  • sessions-index.json has zero references in the binary — confirmed /resume now scans JSONL files directly

View original on GitHub ↗

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