What problem does it solve?
When prompt caching is configured for LLM calls, it is hard to know whether it is actually working. This Skill measures the real cache hit rate from LingTai's append-only token ledgers, so you can verify cache effectiveness or diagnose a drop after a refresh, affinity, or cache-key change.
Core Features & Use Cases
- Rolling-window metrics: Computes hit rate as sum(cached)/sum(input) over default windows of 1h, 5h, 1d, and 3d, with custom window support.
- Double-count protection: Resolves agent workdirs, project roots, or single ledger files while avoiding double-counting daemon calls that appear in two ledgers.
- Read-only stdlib script: Ships scripts/cache_hit_rate.py, a deterministic Python script using only the standard library, with JSON output, source filtering, and a pinnable clock for reproducible runs.
- Use Case: After deploying a cache-affinity fix, run the script against .lingtai/codex to confirm the hit rate recovered, instead of guessing from provider dashboards.
Quick Start
Ask the agent to run the cache hit rate script against the current agent workdir or project .lingtai directory and report the 1h, 5h, 1d, and 3d hit rates.