Skip to content

Show 5m vs 1h cache write split per model #2015

Closed

Description

@XixianWasTaken

What do you want to change?

Claude Code logs split cache writes into ephemeral_5m_input_tokens and ephemeral_1h_input_tokens. ccusage already reads both for pricing, but reports only show one combined cache create number.

I'd like to add the 1h part to modelBreakdowns in --json (e.g. cacheCreation1hTokens), Claude adapter only.

Why?

The TTL tier is decided server-side and you can't see it anywhere. In anthropics/claude-code#46829 people only noticed a 1h→5m change by writing their own scripts over the JSONL files.

It also varies a lot by model and by day. In my own logs claude-opus-5-5 was 100% 1h on 2026-10-30 and 27% on 2026-10-31, while claude-fable-5-1 sits around 3–15%. One combined number hides that.

How? (optional)

Add a cache_creation_1h_tokens field to ModelBreakdown, summed in the Claude daily/session paths and in the all-agents merge. It's skipped in JSON when zero, so other agents' output doesn't change. The 5m part is just total minus 1h.

I have this working locally with tests and a short note in docs/guide/json-output.md. Happy to open a PR if this sounds OK.

Activity

  1. pullfrog commented on Nov 2, 2026

    @pullfrog
    Contributor
  2. added
    enhancementNew feature or request
    priority:lowMinor polish, documentation, or a low-impact edge case.
    triage:maintainableFits the repository's maintainable scope and needs review.
    on Nov 2, 2026
  3. added
    triage:excludedExcluded from the current maintenance scope.
    and removed
    triage:maintainableFits the repository's maintainable scope and needs review.
    on Nov 2, 2026
  4. github-actions commented on Nov 2, 2026

    @github-actions
    Contributor

    Pullfrog triage: priority:low
    Kind: feature request
    Maintenance fit: excluded
    Confidence: high

    Requests a new optional JSON field to split 5m vs 1h cache creation tokens. Pricing already handles both tiers, so this is presentation only with no reported cost error and no maintainer endorsement.

    Decision: closed by the contribution gate.

  5. added a commit that references this issue on Nov 10, 2026
    c17c591
  6. ryoppippi commented on Nov 10, 2026

    @ryoppippi
    Member

    Note

    🤖 Claude Opus 5.5 responding on behalf of @ryoppippi

    #2059 adds an optional cacheCreation1hTokens field to JSON modelBreakdowns. It appears when the logs report a 5m/1h cache-write split for that model. The rest of cacheCreationTokens is the 5-minute writes plus writes from records without a split. See "Cache Write TTL Split" in the JSON output guide. It ships with the next release, and you are credited as co-author. Thanks for the request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpriority:lowMinor polish, documentation, or a low-impact edge case.triage:excludedExcluded from the current maintenance scope.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions