Task · CAOT-0010

Claude Code decoder: cost, compaction and errors

Description

cost-state is the only real USD figure either format carries and it also gives lines added and removed. It is cumulative for the session and present in only a minority of sessions, so treating it as a summable counter overcounts and treating its absence as zero undercounts.

Model keys can carry a context-window suffix such as a 1m marker, so the key does not always equal message.model.

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 last-value cost, incomplete cost, compaction, and bounded error decoding are implemented with absent values preserved; tests passed.

References

View the source file on GitHub