Session names from /rename are lost after resuming and continuing work

Resolved 💬 3 comments Opened Feb 17, 2026 by hbcuconnect Closed Feb 20, 2026

Description

Session names set via /rename are lost after resuming the session and doing additional work. The custom title only persists if it remains near the end of the .jsonl session file.

Steps to Reproduce

  1. Start a new session
  2. Do some work
  3. Run /rename my-project-name
  4. Exit the session
  5. /resume my-project-name — works fine
  6. Do more work in the resumed session
  7. Exit the session
  8. /resume my-project-name"Session my-project-name was not found"

Root Cause

/rename appends a {"type":"custom-title","customTitle":"..."} JSON line to the session .jsonl file. When the session is resumed and more work is done, additional lines are written after the custom-title entry. On the next /resume, Claude Code appears to only scan near the end of the file for the custom-title entry, so it can no longer find the name.

Expected Behavior

A session name set via /rename should persist permanently, regardless of how much additional content is written to the session file after renaming. The name should survive multiple resume/work/exit cycles without needing to re-rename.

Current Workaround

Run /rename with the same name again right before every /exit, so the custom-title entry stays at the end of the file.

Environment

  • Claude Code version: 2.1.42 / 2.1.44
  • OS: Ubuntu 24.04.3 LTS
  • Shell: bash

View original on GitHub ↗

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