C:/Program Files/Git/resume fails to match customTitle when session grows beyond 64KB after /rename

Status Closed — not planned
Maintainer reply None cached
Activity 2 comments · opened Apr 20, 2026 · closed May 27, 2026

The lite metadata scanner (lXA) reads only the first and last 64KB of the session JSONL to extract customTitle. When a session is renamed early/mid-conversation and then grows significantly, the {"type":"custom-title"} lines get pushed outside the 64KB tail window and become invisible to /resume title matching.

Reproduction

  1. Start a session, /rename my-session
  2. Keep working until JSONL grows well past 128KB after the rename point
  3. Exit, then /resume my-session"Session not found"
  4. /resume <uuid> works fine and shows the correct title

Evidence

  • Session file: 2.8MB
  • custom-title entries at byte offsets: 147K, 148K, 172K, 2.4M
  • Tail window starts at byte 2.75M (file size minus 64KB)
  • All custom-title entries are outside the 64KB tail — the last one is ~355KB before the tail window

Code References (v2.1.81)

  • lXA: reads head/tail with ha = 65536 buffer
  • NHY: extracts customTitle via iZ(Y, "customTitle") from tail only
  • yF: searches sessions by customTitle for /resume matching
  • W3Y: the /resume command handler that calls yF

Suggested Fix

Re-append custom-title (and other metadata lines) at session close so they're always in the tail window. This is the simplest fix — just one extra append at shutdown.

Alternatively, scan backward from EOF until all metadata types are found, or maintain a separate lightweight index file.

Environment

  • Claude Code v2.1.81
  • Windows 11 Enterprise
  • Session storage: JSONL files in ~/.claude/projects/

View original on GitHub ↗

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