entelligence-ai/agentplay is a tool that replays coding agent sessions as maps and timelines. The latest merge commit in this repository landed through PR #48 on 2026-11-02, and it included a cost fix that calculates 1-hour cache writes at twice the input rate. The change was 102 insertions and 6 deletions, with the main code in python/src/agentplay/builder.py and the verification in python/tests/test_builder.py.
Prompt cache pricing differs depending on how long entries are kept. Claude-family models are billed separately for 5-minute cache writes and 1-hour cache writes, but the previous code combined the two values and handled them only at the 5-minute rate. This commit adds a cache_write_1h argument to estimate_cost_usd so that 1-hour writes are calculated at twice the input rate, and reads the token count from the ephemeral_1h_input_tokens value contained in cache_creation inside the usage of the Claude Code transcript. This value is clipped so that it does not exceed the total cache creation token count, and the same separation is applied via the llm.token_count.cache_write_1h attribute on the span path. Requests that exceed the long-context thresholds (gpt-6-astra, gpt-6-luna) are charged for the entire input at the higher rate, so 1-hour writes are also included in the threshold comparison. The new test uses a rate card based on claude-opus-5-5: $4 per 1 million input tokens, $20 output, $0.20 cache reads, $5 for 5-minute writes, and $8 for 1-hour writes.
However, the displayed costs are only recommended values taken from the bundled rate card. There is no record of independently verifying the figures in this commit, and the 2x rule for 1-hour writes is the default multiplier applied when the card has no cache key. Past transcripts that do not distinguish between 5-minute and 1-hour are still calculated only at the 5-minute rate. It would be premature to say that it matches the actual billed amount exactly, so the cost screen should be treated as for reference.