Repository navigation
Description
Before submitting
- I searched existing issues and did not find a duplicate. [Bug]: Claude Code session import skips long sessions (transcript over 32 MiB memory budget) #29153 covers the 32 MiB history budget and [Bug]: Shared import record limit skips valid conversations #17484 (closed) the old record cap shared across a project. this one is the per-transcript record cap: it hits even when the session fits the 32 MiB budget, and nothing gets logged.
- I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
- have a claude code session whose
~/.claude/projects/<encoded-cwd>/<sessionId>.jsonlhas 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 - 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
juliusmarminge commentedon Nov 11, 2026
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.