Task · CAOT-0009

Claude Code decoder: tool pairing and derived durations

Description

There is no model-side duration anywhere in a Claude Code transcript. Pairing a tool_use block to its tool_result record on tool_use_id produces the highest-value derived signal in the whole project, and it checks out against reality: Bash p50 1.8s, Grep p50 0.03s, Read p50 0.2s.

toolUseResult.durationMs exists on a minority of results only and must not be the basis for tool latency.

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 tool pairing and typed results carry derived durations and error outcomes without conflating response duration and TTFT; tests and corpus gate passed.

References

View the source file on GitHub