claude-code - 💡(How to fix) Fix --resume "name" fails: sessions-index.json does not index custom-title/agent-name fields from .jsonl [1 comments, 2 participants]

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…
GitHub stats
anthropics/claude-code#47158Fetched 2026-04-13 05:39:55
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
0
Author
Timeline (top)
labeled ×4commented ×1cross-referenced ×1renamed ×1

Root Cause

When a session is named (e.g. via Plan mode completion), the name is written directly into the session's .jsonl file as event records:

{"type": "custom-title", "customTitle": "discount-rate-limit-preset", "sessionId": "bfc3d699-..."}
{"type": "agent-name",   "agentName":  "discount-rate-limit-preset", "sessionId": "bfc3d699-..."}

These records appear repeatedly throughout the session file. However, sessions-index.json stores "firstPrompt": "No prompt" for all such sessions — the customTitle/agentName fields are never indexed.

As a result, --resume "discount-rate-limit-preset" returns no results even though the session file clearly contains the name.

Fix Action

Workaround

# Find UUID from history
grep -i "keyword" ~/.claude/history.jsonl

# Or search session files for the custom-title
find ~/.claude/projects/ -name "*.jsonl" \
  | xargs grep -l '"customTitle":"discount-rate-limit-preset"' 2>/dev/null

# Resume by UUID
claude --resume bfc3d699-499a-4085-947f-5166105e42b3

Code Example

{"type": "custom-title", "customTitle": "discount-rate-limit-preset", "sessionId": "bfc3d699-..."}
{"type": "agent-name",   "agentName":  "discount-rate-limit-preset", "sessionId": "bfc3d699-..."}

---

# Find UUID from history
grep -i "keyword" ~/.claude/history.jsonl

# Or search session files for the custom-title
find ~/.claude/projects/ -name "*.jsonl" \
  | xargs grep -l '"customTitle":"discount-rate-limit-preset"' 2>/dev/null

# Resume by UUID
claude --resume bfc3d699-499a-4085-947f-5166105e42b3
RAW_BUFFERClick to expand / collapse

Bug Description

--resume "name" cannot find sessions that were named via Plan mode, because sessions-index.json does not index the custom-title / agent-name records stored in .jsonl files.

Root Cause

When a session is named (e.g. via Plan mode completion), the name is written directly into the session's .jsonl file as event records:

{"type": "custom-title", "customTitle": "discount-rate-limit-preset", "sessionId": "bfc3d699-..."}
{"type": "agent-name",   "agentName":  "discount-rate-limit-preset", "sessionId": "bfc3d699-..."}

These records appear repeatedly throughout the session file. However, sessions-index.json stores "firstPrompt": "No prompt" for all such sessions — the customTitle/agentName fields are never indexed.

As a result, --resume "discount-rate-limit-preset" returns no results even though the session file clearly contains the name.

Steps to Reproduce

  1. Start a session, enter Plan mode, let it complete and generate a session name (e.g. discount-rate-limit-preset)
  2. End the session
  3. After ~7+ days, try: claude --resume "discount-rate-limit-preset"
  4. Result: session not found

Expected Behavior

--resume "name" should search customTitle / agentName fields in .jsonl files (or have sessions-index.json index them), so named sessions remain findable by name regardless of age.

Actual Behavior

  • sessions-index.json has "firstPrompt": "No prompt" — name lookup fails
  • Sessions also disappear from the interactive picker after ~7–11 days
  • Workaround: claude --resume <uuid> (requires knowing the UUID via grep on history.jsonl)

Environment

  • Claude Code version: 2.1.104
  • OS: WSL2 (Ubuntu on Windows)

Workaround

# Find UUID from history
grep -i "keyword" ~/.claude/history.jsonl

# Or search session files for the custom-title
find ~/.claude/projects/ -name "*.jsonl" \
  | xargs grep -l '"customTitle":"discount-rate-limit-preset"' 2>/dev/null

# Resume by UUID
claude --resume bfc3d699-499a-4085-947f-5166105e42b3

extent analysis

TL;DR

Update the sessions-index.json to include customTitle and agentName fields from the session's .jsonl files to enable searching by name.

Guidance

  • Verify that the customTitle and agentName records are being written to the session's .jsonl file as expected.
  • Modify the indexing process to include these fields in sessions-index.json.
  • Consider adding a script to backfill existing sessions-index.json files with the missing customTitle and agentName data.
  • Test the updated --resume functionality with named sessions to ensure they can be found by name.

Example

No code example is provided as the necessary changes depend on the implementation details of the indexing process.

Notes

The provided workaround using grep and find can be used to locate sessions by name until the indexing issue is resolved. The --resume functionality by UUID is also available as a temporary solution.

Recommendation

Apply a workaround by modifying the indexing process to include customTitle and agentName fields, as updating the version is not explicitly mentioned as an option in the issue. This will enable searching by name for existing and future sessions.

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