@liam-public/claude-log-core
v0.1.0
Published
Parse Claude Code JSONL session logs into a normalized event model and define the ingest wire contract.
Downloads
101
Readme
@liam-public/claude-log-core
Pure, runtime-agnostic parsing and modeling of Claude Code JSONL session logs, plus the ingest wire contract shared by the collector agent (producer) and the API (validator). No database, no filesystem, no framework.
What it does
parseLine/parseLines— tolerant JSONL → validatedRawLogEvents (blank/malformed lines are dropped, never thrown).normalizeEvent—RawLogEvent→ a normalizedLogEvent: camelCased tokenusage, extracted tool names, ISO timestamp, and akind.- Classification — distinguishes a real user prompt (
kind: 'user_prompt') from auserevent that merely carries tool results (kind: 'tool_result'). This is the turn boundary used downstream. - Helpers —
isUserPromptEvent,extractPromptText,tokenUsageOf. - Contract —
IngestEventSchema,IngestEventsRequestSchema({ machineId, events }),IngestEventsResponse.
Turn-grouping and scoring live in @liam-public/node-claude-log-analytics.
