claude-code - 💡(How to fix) Fix C:/Program Files/Git/resume fails to match customTitle when session grows beyond 64KB after /rename

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
RAW_BUFFERClick to expand / collapse

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/

extent analysis

TL;DR

Re-append custom-title lines at session close to ensure they are within the 64KB tail window for the lite metadata scanner.

Guidance

  • Verify that re-appending custom-title lines at session close resolves the issue by checking if the /resume command can match sessions with renamed titles.
  • Consider implementing a separate lightweight index file to store metadata, allowing for more efficient searching and reducing reliance on the 64KB tail window.
  • To mitigate the issue temporarily, users can try using the /resume <uuid> command instead of /resume <custom-title>.
  • Review the lXA and NHY code to ensure that the buffer size (ha = 65536) is sufficient for most use cases and consider increasing it if necessary.

Example

No code snippet is provided as the issue does not require a specific code change, but rather a design or implementation adjustment.

Notes

The suggested fix assumes that re-appending custom-title lines at session close is feasible and efficient. However, this may have performance implications for very large sessions or high-volume usage. The alternative approach of scanning backward from EOF or maintaining a separate index file may be more suitable for certain use cases.

Recommendation

Apply the workaround of re-appending custom-title lines at session close, as it is the simplest fix and can be implemented without significant changes to the existing codebase. This will ensure that the /resume command can match sessions with renamed titles, even if they are not within the 64KB tail window.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix C:/Program Files/Git/resume fails to match customTitle when session grows beyond 64KB after /rename