Bug description
Sessions teleported from Claude Code Web (claude.ai/code) to the local CLI sometimes don't appear in the Resume Session picker (claude -r / /resume).
Root cause
The session .jsonl file's first line has type: "file-history-snapshot" instead of a session-type entry. The actual conversation data (with type: "system", type: "user", etc.) starts from line 1 onward.
It appears the session indexer (sessions-index.json) only inspects the first line of each .jsonl file to determine whether it's a session. When it sees file-history-snapshot, it skips the file entirely — even though valid session data exists in subsequent lines.
Line 0: {"type": "file-history-snapshot", ...} ← indexer stops here
Line 1: {"type": "system", "sessionId": "004cc9d6-...", "gitBranch": "claude/fix-toc-formatting-Px8XU", "slug": "sharded-sleeping-pebble", "compactMetadata": {...}, ...}
Line 2: {"type": "user", "sessionId": "004cc9d6-...", ...}
Line 3: {"type": "assistant", "sessionId": "004cc9d6-...", ...}
...
Steps to reproduce
- Start a session on Claude Code Web (claude.ai/code)
- Work for a while (long enough for auto-compaction to trigger)
- Teleport the session to the local CLI
- Complete the work and exit
- Try to resume with
claude -r — the session does not appear in the list
Expected behavior
Teleported sessions should be registered in sessions-index.json and appear in the Resume Session picker, regardless of the first line's type in the .jsonl file.
Environment
- Claude Code CLI version: 2.1.49 (version at time of teleport)
- OS: macOS (Darwin 25.3.0)
Additional context
- The session data is fully intact in the
.jsonl file — it's only the index that's missing the entry
- The
compactMetadata field suggests the web session was auto-compacted before teleport, which may be related to the write order issue
- Out of 87
.jsonl files in the project directory, only 29 were indexed — 68 were orphaned (most are file-history-snapshot type)
Bug description
Sessions teleported from Claude Code Web (claude.ai/code) to the local CLI sometimes don't appear in the Resume Session picker (
claude -r//resume).Root cause
The session
.jsonlfile's first line hastype: "file-history-snapshot"instead of a session-type entry. The actual conversation data (withtype: "system",type: "user", etc.) starts from line 1 onward.It appears the session indexer (
sessions-index.json) only inspects the first line of each.jsonlfile to determine whether it's a session. When it seesfile-history-snapshot, it skips the file entirely — even though valid session data exists in subsequent lines.Steps to reproduce
claude -r— the session does not appear in the listExpected behavior
Teleported sessions should be registered in
sessions-index.jsonand appear in the Resume Session picker, regardless of the first line's type in the.jsonlfile.Environment
Additional context
.jsonlfile — it's only the index that's missing the entrycompactMetadatafield suggests the web session was auto-compacted before teleport, which may be related to the write order issue.jsonlfiles in the project directory, only 29 were indexed — 68 were orphaned (most arefile-history-snapshottype)