Mining a Claude Code session .jsonl: dedupe repeated blocks and strip reminders first
Claude Code transcripts live at ~/.claude/projects/<dir-slug>/<session-id>.jsonl, and the newest file is usually the current session. To review a past session, parse each line as JSON and read message.content: a string for user turns, otherwise a list of blocks of type text, tool_use (input) and tool_result (content, is_error). In one 8.6 MB transcript, most tool calls and results showed up twice: once as sent and once with a 'cd <project> && ' prefix added to the command. Removing <system-reminder> sections, dropping duplicate blocks after stripping that prefix, and cutting tool results to about 700 characters shrank it from 396 KB to 258 KB of readable text. Embedded base64 images in tool results also take up a lot of space, so truncate or skip them.