finops-usage-extractorlisted
Install: claude install-skill cody-hutson/pmo-platform
<!-- repo-integrity: allow-issue-ref -->
# finops-usage-extractor
## Purpose
Read-only extraction of runtime token spend from local Claude Code session transcripts into the operator-local usage store defined by `core/schemas/finops-usage-store-schema.md`. It sums each session's exact `message.usage` token dimensions (input / output / cache-write with tier split / cache-read) plus tool-use request counts and the cost-determining `service_tier`, and normalizes them into a versioned JSONL derived cache. Exact source counts are authoritative; the context-budget-auditor skill's `ceil(words/0.75)` heuristic is the fallback for records that lack `message.usage`.
This skill measures **runtime session spend** — distinct from context-budget-auditor, which measures **static corpus footprint**. It reuses that skill's estimation *method* (the word→token fallback), not its scanner.
## Scope
Two phases over one source (the local session store), one skill:
- **Extraction + normalization (C1).** `extract-usage.sh` parses local Claude Code session transcripts into the frozen **v1.0.0** store (`meta` / `session` / `subagent` record kinds; `provider` reserved-optional). Exact `message.usage` counts are primary; the word→token heuristic is the usage-less fallback.
- **Attribution + roll-up (C2).** `rollup-attribution.sh` reads that store and writes the additive **v1.1.0** `rollup` + `coverage` records: it resolves each `session` to its owning work item, rolls per-session spend up to that w