Skip to content

[Bug]: Claude Code session import silently skips transcripts over 100k lines, even under the 32 MiB budget #31677

Closed

Description

@haiderking1

Before submitting

Area

apps/server

Steps to reproduce

  1. have a claude code session whose ~/.claude/projects/<encoded-cwd>/<sessionId>.jsonl has more than 100,000 lines. mine has 116,924 lines (322 MB), and the user/assistant text the importer keeps is only ~8 MB, well under the 32 MiB budget
  2. import claude code sessions for that project (agentSessions.import)

Expected behavior

the session gets imported like the smaller ones in the same project

Actual behavior

it's skipped without a word. AgentSessionScanner.readTranscript counts every jsonl line in finishRecord, and once recordCount > MAX_IMPORT_RECORDS (1e5) it returns false, so readTranscript returns null and the candidate becomes { _tag: "Skipped" }. it doesn't throw, so the "Could not read imported transcript" warning never fires either. the server trace just shows a successful readTranscript span and a successful agentSessions.import, and the thread never shows up.

the count includes lines the importer throws away right after (shouldRetainDecodedRecord keeps only user/assistant records with text). in my transcript most of the lines are claude code bookkeeping:

25779 assistant
19204 api-request-blob
13458 user
12961 api-request
 7957 attachment
 5823 last-prompt
 5803 ai-title
 5803 agent-name
 5802 permission-mode
 5802 mode

so a long session goes over 100k lines while its real conversation is way smaller. the 13 other sessions in the same project imported fine, and so did one 34 MB transcript.

Impact

Major degradation or frequent failure

Version or commit

0.1.8-nightly.20261105.4218

Environment

linux (arch, hyprland), desktop app, claude code 2.1.318, default ~/.claude provider instance

Logs or stack traces

no warning or error is logged for the skipped file. the only data is a 2.6 s AgentSessionScanner.readTranscript span with exit: Success, and no projection_threads row for import:claudeAgent:<sessionId> afterwards.

Suggested direction

  • count only the records that get kept (or the ones that decode into a known record type) against MAX_IMPORT_RECORDS, instead of every line. or drop the cap per transcript and keep a rolling window of recent messages, since the parser only keeps the first user message plus the last ~200 anyway (same idea as [Bug]: Claude Code session import skips long sessions (transcript over 32 MiB memory budget) #29153)
  • when a transcript hits a cap, log it and say why it was skipped in the import result, instead of a bare Skipped

Activity

  1. juliusmarminge commented on Nov 11, 2026

    @juliusmarminge
    Member

    Fixed by #29183, now on main: Re-importing the reported Claude transcript with more than 100,000 lines now imports its conversation instead of silently skipping it, because Claude imports no longer stop at the record cap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions