/rename doesn't persist when session is missing from sessions-index.json

Resolved 💬 3 comments Opened Feb 13, 2026 by gulliversgames Closed Feb 17, 2026

Bug Description

/rename <name> silently fails to persist the new name when the session is not present in sessions-index.json.

Steps to Reproduce

  1. Open a session in a project where sessions-index.json is stale (not updated recently)
  2. Run /rename terminal-playground
  3. CLI outputs: Session and agent renamed to: terminal-playground
  4. Exit and run claude --resume — the session appears without the custom name

Expected Behavior

The rename should persist and show the custom name in the resume picker.

Actual Behavior

The rename is lost. Investigation shows:

  • No rename or metadata entry is written to the session JSONL
  • The name field on JSONL entries remains empty ("")
  • The slug field retains the auto-generated value (e.g., crispy-orbiting-crane)
  • sessions-index.json was stale (last updated Feb 4) and didn't contain the session
  • /rename likely only updates sessions-index.json, so if the session isn't indexed, the rename is silently dropped

Root Cause (Suspected)

/rename writes to sessions-index.json but doesn't:

  1. Verify the session exists in the index first
  2. Write a fallback entry to the JSONL transcript
  3. Warn the user if the rename couldn't be persisted

Workaround

Manually add the session entry to sessions-index.json with the name field set.

Environment

  • Claude Code: 2.1.41
  • macOS (Darwin 24.6.0)

🤖 Generated with Claude Code

View original on GitHub ↗

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