Task · CAOT-0008

Claude Code decoder: sessions, turns and usage

Description

Claude Code writes one record per message with a parentUuid chain. A turn is a walk from a user prompt to the next stop_reason of end_turn, and there is no explicit turn id anywhere.

message.usage is finer than anything the native exporter emits: thinking tokens, the 1h versus 5m ephemeral cache split, and a per-iteration breakdown inside one response.

Acceptance Criteria

Definition of Done

Implementation Plan

Wave 1 lane 4: write table-driven synthetic-fixture tests first, implement the Claude decoder across all documented record types, then run focused decoder tests; root integrates and runs the final gate.

Final Summary

Claude sessions, turns, usage including iterations and cache splits, attribution, and bounded fields decode from synthetic fixtures; corpus gate passed.

References

View the source file on GitHub