Skip to content

Add per-model cost and cache hit rate breakdown #3

@li195111

Description

@li195111

Summary

Add a new CLI command or report section that shows cost and cache hit rate broken down by model (e.g., Opus, Sonnet, Haiku).

Current Behavior

cta cost-report shows aggregate costs. Model-level breakdown requires manual session inspection.

Expected Behavior

A cta model-breakdown command (or --by-model flag) that shows:

Model Sessions Total Cost Avg Cache Hit Avg Cost/Session
claude-opus-4-6 120 $2,340 45% $19.50
claude-sonnet-4-6 5,200 $3,100 72% $0.60

Implementation Hints

  • storage.rs already stores model information per session
  • Add a query method that groups by model
  • Use existing analyzer.rs aggregation patterns as reference

Acceptance Criteria

  • Per-model breakdown displayed with cost, session count, cache hit rate
  • Works as both CLI command and MCP tool
  • Handles unknown/fallback models gracefully

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions