How to Build a Stable Parser for Claude Code's Undocumented JSONL Logs
Claude Code stores every conversation session as JSONL files on disk under ~/.claude/projects/, but the format is an undocumented internal detail with no version field or stability guarantee. The schema can change with nearly every daily CLI update, making it unreliable for developers who build tools on top of these logs. A developer building a read-only replay and search tool identified key patterns for handling this instability, including preserving unknown data types rather than discarding them, and normalizing input at the parsing boundary. The approach uses an explicit whitelist of known message types, archiving unrecognized entries as raw JSON for future re-parsing once the schema is better understood. A versioning mechanism called SUMMARY_VERSION automates re-indexing of stale sessions whenever the parser is updated, avoiding manual data migrations.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in